예제 #1
0
        public void ClassWithOneParameterConstructorCreation()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithSimpleField a = c.Resolve <ClassWithSimpleField>();

            Assert.IsNotNull(a.foo);
        }
예제 #2
0
        public void ClassWithConstructorParameterRegistredAsSingleton()
        {
            SimpleContainer c = new SimpleContainer();

            c.RegisterType <Foo>(true);

            ClassWithSimpleField a1 = c.Resolve <ClassWithSimpleField>();
            ClassWithSimpleField a2 = c.Resolve <ClassWithSimpleField>();

            Assert.IsNotNull(a1.foo);
            Assert.AreEqual(a1.foo, a2.foo);
        }