예제 #1
0
        public void CircularReferenceIfInstancesProvided()
        {
            var container = new Container();
            var c3        = new Circular3(null);
            var c2        = new Circular2(c3);
            var c1        = new Circular1(c2);

            container.AddInstance(c1);
            container.AddInstance(c2);
            container.AddInstance(c3);
            Assert.Same(c1, container.Resolve <Circular1>());
            Assert.Same(c2, container.Resolve <Circular2>());
            Assert.Same(c3, container.Resolve <Circular3>());
        }
예제 #2
0
 public Circular3(Circular1 c1)
 {
 }