public void TestResolveToNamespaceTransient() { var container = new InjectionContainer(); container.Bind <IMockInterface>().ToNamespace("Adic.Tests"); var instance = container.ResolveAll <IMockInterface>(); Assert.AreEqual(3, instance.Length); Assert.IsTrue(instance[0] is MockIClass); Assert.IsTrue(instance[1] is MockIClassWithoutAttributes); Assert.IsTrue(instance[2] is MockIClassWithAttributes); }
public void TestResolveToNamespaceSingleton() { var container = new InjectionContainer(); container.Bind <IMockInterface>().ToNamespaceSingleton("Adic.Tests"); var bindings = container.GetBindingsFor <IMockInterface>(); var instance = container.ResolveAll <IMockInterface>(); Assert.AreEqual(3, instance.Length); Assert.IsTrue(instance[0] is MockIClass); Assert.IsTrue(instance[1] is MockIClassWithoutAttributes); Assert.IsTrue(instance[2] is MockIClassWithAttributes); Assert.IsTrue(instance[0] == bindings[0].value); Assert.IsTrue(instance[1] == bindings[1].value); Assert.IsTrue(instance[2] == bindings[2].value); }
public void TestResolveToNamespaceTransient() { var container = new InjectionContainer(); container.Bind<IMockInterface>().ToNamespace("Adic.Tests"); var instance = container.ResolveAll<IMockInterface>(); Assert.AreEqual(3, instance.Length); Assert.IsTrue(instance[0] is MockIClass); Assert.IsTrue(instance[1] is MockIClassWithoutAttributes); Assert.IsTrue(instance[2] is MockIClassWithAttributes); }
public void TestResolveToNamespaceSingleton() { var container = new InjectionContainer(); container.Bind<IMockInterface>().ToNamespaceSingleton("Adic.Tests"); var bindings = container.GetBindingsFor<IMockInterface>(); var instance = container.ResolveAll<IMockInterface>(); Assert.AreEqual(3, instance.Length); Assert.IsTrue(instance[0] is MockIClass); Assert.IsTrue(instance[1] is MockIClassWithoutAttributes); Assert.IsTrue(instance[2] is MockIClassWithAttributes); Assert.IsTrue(instance[0] == bindings[0].value); Assert.IsTrue(instance[1] == bindings[1].value); Assert.IsTrue(instance[2] == bindings[2].value); }