public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.String) { throw new JsonSerializationException("ThrowResult should be string in json"); } return(ThrowResult.Parse(reader.Value.ToString())); }
public void Parse(string input, int expectedSector, SectionArea expedtedMultiplier) { var t = ThrowResult.Parse(input); Assert.AreEqual(new ThrowResult(expectedSector, expedtedMultiplier), t); }