public void BuildUpAppliesDependencyProperty()
        {
            var container = new MicroIocContainer();

            container.GetConfiguration()
                .Property<TestClassWithProperty, string>(x => x.CustomerName, "TestCustomerName");

            var obj = new TestClassWithProperty();

            container.BuildUp(obj);

            Assert.AreEqual("TestCustomerName", obj.CustomerName);
        }
Example #2
0
        public void BuildUpAppliesDependencyProperty()
        {
            var container = new MicroIocContainer();

            container.GetConfiguration()
            .Property <TestClassWithProperty, string>(x => x.CustomerName, "TestCustomerName");

            var obj = new TestClassWithProperty();

            container.BuildUp(obj);

            Assert.AreEqual("TestCustomerName", obj.CustomerName);
        }
        public void BuildUpDoesNotApplyStandardProperty()
        {
            var container = new MicroIocContainer();

            container.GetConfiguration()
                .Property<TestClassWithProperty, string>(x => x.CustomerName, "TestCustomerName")
                .Property<TestClassWithProperty, string>(x => x.NotInjected, "NotInjected");

            var obj = new TestClassWithProperty();

            container.BuildUp(obj);

            Assert.IsNull(obj.NotInjected, string.Format("Should have been null, but was {0}", obj.NotInjected));
        }
Example #4
0
        public void BuildUpDoesNotApplyStandardProperty()
        {
            var container = new MicroIocContainer();

            container.GetConfiguration()
            .Property <TestClassWithProperty, string>(x => x.CustomerName, "TestCustomerName")
            .Property <TestClassWithProperty, string>(x => x.NotInjected, "NotInjected");

            var obj = new TestClassWithProperty();

            container.BuildUp(obj);

            Assert.IsNull(obj.NotInjected, string.Format("Should have been null, but was {0}", obj.NotInjected));
        }