public void PropertyInjectionWithoutAttributeShouldFail()
        {
            SimpleContainer c = new SimpleContainer();

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

            Assert.IsNull(a.TheFoo3);
        }
        public void PropertyWithGetterOnlyInjectionShouldFail()
        {
            SimpleContainer c = new SimpleContainer();

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

            Assert.IsNull(a.TheFoo2);
        }
        public void PropertyWithSetterAndGetterInjection()
        {
            SimpleContainer c = new SimpleContainer();

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

            Assert.IsNotNull(a.TheFoo);
        }
        public void InjectionOfTwoProperties()
        {
            SimpleContainer c = new SimpleContainer();

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

            Assert.IsNotNull(a.TheFoo);
            Assert.IsNotNull(a.TheBar);
        }
        public void PropertyBuildUpWithoutAttributeShouldFail()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithProperties a = new ClassWithProperties();

            c.BuildUp(a);

            Assert.IsNull(a.TheFoo3);
        }
        public void PropertyWithGetterOnlyBuildUpShouldFail()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithProperties a = new ClassWithProperties();

            c.BuildUp(a);

            Assert.IsNull(a.TheFoo2);
        }
        public void PropertyWithSetterAndGetterBuildUp()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithProperties a = new ClassWithProperties();

            c.BuildUp(a);

            Assert.IsNotNull(a.TheFoo);
        }
        public void BuildUpOfTwoProperties()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithProperties a = new ClassWithProperties();

            c.BuildUp(a);

            Assert.IsNotNull(a.TheFoo);
            Assert.IsNotNull(a.TheBar);
        }
        public void InjectionOfTypeRegistredAsSingletonInTwoObjects()
        {
            SimpleContainer c = new SimpleContainer();

            c.RegisterType <Foo>(true);

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

            Assert.IsNotNull(a1.TheFoo);
            Assert.AreEqual(a1.TheFoo, a2.TheFoo);
        }
        public void BuildUpOfOnePropertyAndNotChangeTheInitializedOne()
        {
            SimpleContainer c = new SimpleContainer();

            ClassWithProperties a = new ClassWithProperties();

            Foo foo = new Foo();

            a.TheFoo = foo;

            c.BuildUp(a);

            Assert.AreEqual(a.TheFoo, foo);
            Assert.IsNotNull(a.TheBar);
        }
        public void BuildUpOfTypeRegistredAsSingletonInTwoObjects()
        {
            SimpleContainer c = new SimpleContainer();

            c.RegisterType <Foo>(true);

            ClassWithProperties a1 = new ClassWithProperties();
            ClassWithProperties a2 = new ClassWithProperties();

            c.BuildUp(a1);
            c.BuildUp(a2);

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