Ejemplo n.º 1
0
        public void Test1()
        {
            ReflectionTypeAnalyzer.AddCustomInjectAttribute(typeof(InjectCustomAttribute));

            Container.Bind <Bar>().AsSingle();
            Container.Bind <Foo>().AsSingle();

            var foo = Container.Resolve <Foo>();
            var bar = Container.Resolve <Bar>();

            Assert.IsEqual(foo.BarProperty, bar);
            Assert.IsEqual(foo.BarField, bar);
            Assert.IsEqual(foo.BarMethod, bar);
            Assert.IsEqual(foo.BarParam, bar);
        }
 private void CreateContainer()
 {
     container = new DiContainer();
     ReflectionTypeAnalyzer.AddCustomInjectAttribute(typeof(ImportAttribute));
 }