Пример #1
0
        public void ShouldAssignStructFromClassWithFieldsByName()
        {
            var fieldClassInstance = new testClassFields
            {
                x = 1,
                y = 2
            };

            Dictionary <string, object> inst
                = intStruct.AssignValuesFromObject(fieldClassInstance) as Dictionary <string, object>;

            Assert.AreEqual(1, inst["x"]);
            Assert.AreEqual(2, inst["y"]);
        }
Пример #2
0
        public void ShouldAssignStructFromClassWithFieldsByName()
        {
            var fieldClassInstance = new testClassFields
            {
                x = 1,
                y = 2
            };

            Dictionary<string, object> inst
                = intStruct.AssignValuesFromObject(fieldClassInstance) as Dictionary<string, object>;

            Assert.AreEqual(1, inst["x"]);
            Assert.AreEqual(2, inst["y"]);
        }