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"]); }
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); }
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); }
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"]); }