Beispiel #1
0
        public void Should_return_that_the_jsons_are_different()
        {
            var diffJason = new DiffJson(_id)
            {
                Left = "{\"key\":\"value\"}", Right = "{\"key\":\"test\"}"
            };
            var differResult = diffJason.Diff();

            Assert.False(differResult.AreEqual);
        }
Beispiel #2
0
        public void Should_return_that_the_jsons_they_are_equal()
        {
            var json      = "{\"some\":\"json\"}";
            var diffJason = new DiffJson(_id)
            {
                Left = json, Right = json
            };
            var differResult = diffJason.Diff();

            Assert.True(differResult.AreEqual);
            Assert.Equal(_id, differResult.Id);
        }
Beispiel #3
0
        public void Should_return_that_the_jsons_they_are_different_and_where_they_are()
        {
            var offset    = 8;
            var length    = 5;
            var diffJason = new DiffJson(_id)
            {
                Left = "{\"key\":\"value\"}", Right = "{\"key\":\"tests\"}"
            };
            var differResult = diffJason.Diff();

            Assert.False(differResult.AreEqual);
            Assert.Contains(differResult.DiffResults, r => r.Offset == offset && r.Length == length);
        }