public void shouldResolveProperlyByLocator() { ServiceLocator.SetContainerProvider(() => new SimpleContainer()); DI3Foo3 fs = ServiceLocator.Current.GetInstance <DI3Foo3>(); Assert.IsTrue(fs.field2 != null); Assert.IsTrue(fs.field2.field1 != null); Assert.IsTrue(fs.field3 != null); }
public void shouldInjectionMoreThanOneFieldWithAttribute() { SimpleContainer simpleContainer = new SimpleContainer(); DI3Foo3 fs = simpleContainer.Resolve <DI3Foo3>(); Assert.IsTrue(fs.field2 != null); Assert.IsTrue(fs.field2.field1 != null); Assert.IsTrue(fs.field3 != null); }
public void shouldBuildUpObjectWithMoreThanOneField() { SimpleContainer simpleContainer = new SimpleContainer(); DI3Foo3 fs = new DI3Foo3(); simpleContainer.BuildUp <DI3Foo3>(fs); Assert.IsTrue(fs.field2 != null); Assert.IsTrue(fs.field2.field1 != null); Assert.IsTrue(fs.field3 != null); }