public void ShouldWorkForNullInstances() { var container = new Container(); ContainerExtensions.Inject(container, new TestClass()); container.Inject <TestClass2>(null); var instance = container.Resolve <TestClass3>(); }
public void ShouldWorkForTheDefaultType() { var container = new Container(); var testClass = new TestClass(); ContainerExtensions.Inject(container, testClass); var instance = container.Resolve <TestClass>(); Assert.AreSame(testClass, instance); }
public void ShouldRemoveInstances2() { var container = new Container(); var class1 = new ClassA1(); var class2 = new ClassA1(); ContainerExtensions.Inject(container, class1); container.RemoveAllRegistrationsAndInstancesOf <ClassA1>(); ContainerExtensions.Inject(container, class2); var classA1 = container.Resolve <ClassA1>(); Assert.AreSame(class2, classA1); }