示例#1
0
        public void TypeAccessorStructSetValueUsingInterfaceTest()
        {
            IAccessed    obj      = new AccessedStruct();
            TypeAccessor accessor = obj.GetTypeAccessor();

            accessor.SetValue(obj, "TextData", "Some text");
            accessor.SetValue(obj, "IntegerData", 427);

            Assert.AreEqual("Some text", obj.TextData);
            Assert.AreEqual(427, obj.IntegerData);
        }
示例#2
0
        public void TypeAccessorStructGetValueTest()
        {
            AccessedStruct obj      = new AccessedStruct();
            TypeAccessor   accessor = obj.GetTypeAccessor();

            obj.TextData    = "Some text";
            obj.IntegerData = 427;

            Assert.AreEqual("Some text", accessor.GetValue(obj, "TextData"));
            Assert.AreEqual(427, accessor.GetValue(obj, "IntegerData"));
        }
示例#3
0
        public void TypeAccessorStructSetValueTest()
        {
            AccessedStruct obj      = new AccessedStruct();
            TypeAccessor   accessor = obj.GetTypeAccessor();

            accessor.SetValue(obj, "TextData", "Some text");
            accessor.SetValue(obj, "IntegerData", 427);

            Assert.IsNull(obj.TextData);
            Assert.AreEqual(0, obj.IntegerData);
        }