public void ShouldAssignStructToNativeStruct() { var structInstance = new testStruct { x = 1, y = 2 }; Dictionary <string, object> inst = intStruct.AssignValuesFromObject(structInstance) as Dictionary <string, object>; testStruct nativeStruct = (testStruct)intStruct.AssignValuesToNativeType(inst, typeof(testStruct)); Assert.AreEqual(1, nativeStruct.x); Assert.AreEqual(2, nativeStruct.y); }
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]); }