Beispiel #1
0
        public void GetPropertyData()
        {
            TestObject test1 = new TestObject();

            test1.Desc = "xxx";

            ICompactContainer container = mocks.CreateMock <ICompactContainer>();

            Expect.Call(container.Resolve(typeof(ITestObject))).Return(test1);

            mocks.ReplayAll();

            PropertyDataResolver resolver = new PropertyDataResolver(container);
            PropertyData         data     = resolver.Get("InversionOfControl.Tests.PropertyDataResolverTests+ITestObject, CompactContainer.Tests, Desc");

            mocks.VerifyAll();

            Assert.AreEqual(test1, data.Owner);
            Assert.AreEqual("Desc", data.Name);
            Assert.AreEqual("xxx", data.Value);
            Assert.AreEqual(typeof(ITestObject).GetProperty("Desc"), data.Info);
        }
 public object Resolve(string key, Type type, ComponentInfo componentContext)
 {
     return(container.Resolve(type));
 }