Exemple #1
0
        public void PersonShouldSerializeUnformattedToJson()
        {
            var obj = new TestPerson
            {
                Name = "MyName",
                Age  = 200
            };

            var result = obj.SerializeToJson(false);

            result.Should().Be("{\"Name\":\"MyName\",\"Age\":200}");
        }
Exemple #2
0
        public void PersonShouldSerializeToJson()
        {
            var obj = new TestPerson
            {
                Name = "MyName",
                Age  = 200
            };

            var result = obj.SerializeToJson();

            Approvals.Verify(result);
        }