Example #1
0
        public void ShouldAssignStructWithArrayByName()
        {
            var aStructInstance = new arrayStruct {
                arr = new int[] { 1 }
            };

            Dictionary <string, object> inst
                = aStruct.AssignValuesFromObject(aStructInstance) as Dictionary <string, object>;

            object[] arrayInst = inst["arr"] as object[];
            Assert.AreEqual(1, arrayInst.Length);
            Assert.AreEqual(1, arrayInst[0]);
        }
Example #2
0
        public void ShouldAssignArrayStructInstanceToNativeArrayStruct()
        {
            var aStructInstance = new arrayStruct
            {
                arr = new int[] { 1 }
            };

            Dictionary <string, object> inst
                = aStruct.AssignValuesFromObject(aStructInstance) as Dictionary <string, object>;
            arrayStruct nativeStruct = (arrayStruct)aStruct.AssignValuesToNativeType(inst, typeof(arrayStruct));

            Assert.AreEqual(1, nativeStruct.arr.Length);
            Assert.AreEqual(1, nativeStruct.arr[0]);
        }
Example #3
0
        public void ShouldAssignStructWithArrayByName()
        {
            var aStructInstance = new arrayStruct {
                arr = new int[] {1}
            };

            Dictionary<string, object> inst
                = aStruct.AssignValuesFromObject(aStructInstance) as Dictionary<string, object>;
            object[] arrayInst = inst["arr"] as object[];
            Assert.AreEqual(1, arrayInst.Length);
            Assert.AreEqual(1, arrayInst[0]);
        }
Example #4
0
        public void ShouldAssignArrayStructInstanceToNativeArrayStruct()
        {
            var aStructInstance = new arrayStruct
            {
                arr = new int[] { 1 }
            };

            Dictionary<string, object> inst
                = aStruct.AssignValuesFromObject(aStructInstance) as Dictionary<string, object>;
            arrayStruct nativeStruct = (arrayStruct)aStruct.AssignValuesToNativeType(inst, typeof(arrayStruct));
            Assert.AreEqual(1, nativeStruct.arr.Length);
            Assert.AreEqual(1, nativeStruct.arr[0]);
        }