Esempio n. 1
0
        public void TestMayInjectMembersEvenIfConstructorLoops()
        {
            var injector = new Injector();

            injector.Register(Binding.For <LoopingConstructorOnly> ());

            bool caughtEx = false;

            try {
                injector.Resolve <LoopingConstructorOnly>();
            } catch (InjectorException) {
                caughtEx = true;
            }
            Assert.IsTrue(caughtEx);

            var val = new LoopingConstructorOnly();

            injector.InjectMembers(val);

            Assert.IsNotNull(val.MCls);
        }
Esempio n. 2
0
 public LoopingConstructorOnly(LoopingConstructorOnly c)
 {
 }