public void CallReset_AfterSerializingOnce_WithCustomSerializationForProperty_DoesNotPickUpFurtherConfigChangesForPropertyType() { var dto = new Dto { CustomFormatTypeProperty = new CustomFormatType(12345) }; ConfigureCustomFormatType(); TestRoundTripValue(dto); JsConfig.Reset(); ConfigureCustomFormatType(); JsConfig<Dto>.RefreshRead(); TestRoundTripValue(dto); }
public MyClass Any(Dto request) { return new MyClass { Name = request.Name, Sum = (request.x + request.y) * (int)request.e }; }
private static void TestRoundTripValue(Dto dto) { var json = dto.ToJson(); var fromJson = json.FromJson<Dto>(); Assert.That(fromJson.CustomFormatTypeProperty.Value, Is.EqualTo(dto.CustomFormatTypeProperty.Value)); }
public MyClass Any(Dto request) { return(new MyClass { Name = request.Name, Sum = (request.x + request.y) * (int)request.e }); }