Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }