Exemplo n.º 1
0
        public void WhenRightWithSamePrimitiveTypesThenSerializesOk()
        {
            // Arrange
            var settings = GetSettings();
            EitherStrict <int, int> data = EitherStrict.Right <int, int>(22);

            // Act
            string json = JsonConvert.SerializeObject(data, settings);

            // Assert
            Assert.AreEqual("{\"Right\":22}", json);
        }
Exemplo n.º 2
0
        public void WhenNestedEitherThenSerializesOkCase3()
        {
            // Arrange
            var settings = GetSettings();
            EitherStrict <EitherStrict <int, int>, int> data = EitherStrict.Right <EitherStrict <int, int>, int>(30);

            // Act
            string json = JsonConvert.SerializeObject(data, settings);

            // Assert
            Assert.AreEqual("{\"Right\":30}", json);
        }