public void Serialize_ShouldReturnValidJson(DegreeAngleJsonSerializationFormat format, number totalSeconds, string expectedJson)
        {
            // arrange
            var angle     = new DegreeAngle(totalSeconds);
            var converter = new DegreeAngleJsonConverter(format);

            // act
            string actualJson = JsonConvert.SerializeObject(angle, converter);

            // assert
            actualJson.Should().Be(expectedJson);
        }
Пример #2
0
 public DegreeAngleJsonConverter(DegreeAngleJsonSerializationFormat serializationFormat = DegreeAngleJsonSerializationFormat.Short)
 {
     _serializationFormat = serializationFormat;
 }