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);
        }
Пример #2
0
 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));
 }
Пример #4
0
 public MyClass Any(Dto request)
 {
     return(new MyClass {
         Name = request.Name, Sum = (request.x + request.y) * (int)request.e
     });
 }