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

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

            Assert.IsNotNull(a.foo);
        }
Beispiel #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);
        }