public void WhenLeftWithSamePrimitiveTypesThenSerializesOk() { // Arrange var settings = GetSettings(); EitherStrict <int, int> data = EitherStrict.Left <int, int>(10); // Act string json = JsonConvert.SerializeObject(data, settings); // Assert Assert.AreEqual("{\"Left\":10}", json); }
public void WhenNestedEitherThenSerializesOkCase2() { // Arrange var settings = GetSettings(); EitherStrict <EitherStrict <int, int>, int> data = EitherStrict.Left <EitherStrict <int, int>, int>(EitherStrict.Right <int, int>(20)); // Act string json = JsonConvert.SerializeObject(data, settings); // Assert Assert.AreEqual("{\"Left\":{\"Right\":20}}", json); }