예제 #1
0
        [Test] public void TestPropertiesSetValue()
        {
            PropClz clz     = new PropClz();
            object  wrapped = typeIlWrapper.CreateWrapperFromInstance(clz);

            wrapped.GetType().GetProperty("PropInt").SetValue(wrapped, 999, null);
            wrapped.GetType().GetProperty("PropString").SetValue(wrapped, "stringval", null);

            Assert.AreEqual(999, clz.PropInt);
            Assert.AreEqual("stringval", clz.PropString);
        }
예제 #2
0
        [Test] public void TestPropertiesGetValue()
        {
            PropClz clz     = new PropClz();
            object  wrapped = typeIlWrapper.CreateWrapperFromInstance(clz);

            clz.PropInt    = 10;
            clz.PropString = "100";

            Assert.AreEqual(10, wrapped.GetType().GetProperty("PropInt").GetValue(wrapped, null));
            Assert.AreEqual("100", wrapped.GetType().GetProperty("PropString").GetValue(wrapped, null));
        }