I have the following code using the lightcore IoC container. But it fails with "NUnit.Framework.AssertionException: Contained objects are equal" which indicates that the objects that should be transient, are not.
Is this a bug in lightcore, or am I doing it wrong? My German isn't good enough to read the documentation.
[Test]
public void JellybeanDispenserHasNewInstanceEachTimeWithDefault()
{
var builder = new ContainerBuilder();
builder.DefaultControlledBy<TransientLifecycle>();
builder.Register<IJellybeanDispenser, VanillaJellybeanDispenser>();
builder.Register<SweetVendingMachine>().ControlledBy<TransientLifecycle>();
builder.Register<SweetShop>();
IContainer container = builder.Build();
SweetShop sweetShop = container.Resolve<SweetShop>();
SweetShop sweetShop2 = container.Resolve<SweetShop>();
Assert.IsFalse(ReferenceEquals(sweetShop, sweetShop2), "Root objects are equal");
Assert.IsFalse(ReferenceEquals(sweetShop.SweetVendingMachine, sweetShop2.SweetVendingMachine), "Contained objects are equal");
Assert.IsFalse(ReferenceEquals(sweetShop.SweetVendingMachine.JellybeanDispenser, sweetShop2.SweetVendingMachine.JellybeanDispenser), "services are equal");
}