public void Just_Send_Param_Action_Test() { var sendParam = new ParamObjectLeft() { Both = "Both", OnlySend = "OnlySend", OnlyReceived = "OnlyReceived" }; var receivedParam = new ParamObjectRight(); var sendMapping = new ParamPropertyMappingProvider(sendParam); var receivedMapping = new ParamPropertyMappingProvider(receivedParam); sendMapping.AssignTo(receivedMapping); receivedParam.GetType() .GetProperties() .ToList() .ForEach(o => { Console.WriteLine("{0} = {1}", o.Name, o.GetValue(receivedParam, null) ?? "NULL"); }); Assert.AreEqual("Both", receivedParam.Both); Assert.AreEqual(null, receivedParam.OnlySend); Assert.AreEqual("OnlyReceived", receivedParam.OnlyReceived); }
public void ShouldBe_Return_Value_When_Empty_Property_Test() { var sourceParam = new ParamObjectForDefaultValue(); var targetParam = new ParamObjectForDefaultValue(); var sourceMapping = new ParamPropertyMappingProvider(sourceParam); var targetMapping = new ParamPropertyMappingProvider(targetParam); sourceMapping.AssignTo(targetMapping); Assert.AreEqual("NCsoft", targetParam.UserName); TestContext.WriteLine(targetParam.UserName); }