Ejemplo n.º 1
0
        public void ShouldAssignStructFromClassWithBothByName()
        {
            var bothClassInstance = new testClassBoth
            {
                x = 1,
                y = 2
            };

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

            Assert.AreEqual(1, inst["x"]);
            Assert.AreEqual(2, inst["y"]);
        }
Ejemplo n.º 2
0
        public void ShouldAssignStructInstanceToNativeClassWithBoth()
        {
            var bothClassInstance = new testClassBoth
            {
                x = 1,
                y = 2
            };

            Dictionary <string, object> inst
                = intStruct.AssignValuesFromObject(bothClassInstance) as Dictionary <string, object>;
            testClassBoth nativeClass = (testClassBoth)intStruct.AssignValuesToNativeType(inst, typeof(testClassBoth));

            Assert.AreEqual(1, nativeClass.x);
            Assert.AreEqual(2, nativeClass.y);
        }
Ejemplo n.º 3
0
        public void ShouldAssignStructInstanceToNativeClassWithBoth()
        {
            var bothClassInstance = new testClassBoth
            {
                x = 1,
                y = 2
            };

            Dictionary<string, object> inst
                = intStruct.AssignValuesFromObject(bothClassInstance) as Dictionary<string, object>;
            testClassBoth nativeClass = (testClassBoth)intStruct.AssignValuesToNativeType(inst, typeof(testClassBoth));
            Assert.AreEqual(1, nativeClass.x);
            Assert.AreEqual(2, nativeClass.y);
        }
Ejemplo n.º 4
0
        public void ShouldAssignStructFromClassWithBothByName()
        {
            var bothClassInstance = new testClassBoth
            {
                x = 1,
                y = 2
            };

            Dictionary<string, object> inst
                = intStruct.AssignValuesFromObject(bothClassInstance) as Dictionary<string, object>;
            Assert.AreEqual(1, inst["x"]);
            Assert.AreEqual(2, inst["y"]);
        }