Ejemplo n.º 1
0
        public static void AssertSameJsonLdObject(JsonLdObject obj, string eventReferenceFile)
        {
            var eventJsonString = obj.ToJsonLdString();
            var eventJObject    = JObject.Parse(eventJsonString);
            var refJsonString   = TestUtils.LoadReferenceJsonFile(eventReferenceFile);
            var refJObject      = JObject.Parse(refJsonString);

            var diff = ObjectDiffPatch.GenerateDiff(refJObject, eventJObject);

            Debug.WriteLine(diff.NewValues);
            Debug.WriteLine(diff.OldValues);

            Assert.Null(diff.NewValues);
            Assert.Null(diff.OldValues);
        }
Ejemplo n.º 2
0
        public static void AssertSameObjectJson(object obj, string eventReferenceFile)
        {
            var eventJsonString = JsonConvert.SerializeObject(obj, SerializerSettings);
            var eventJObject    = JObject.Parse(eventJsonString);
            var refJsonString   = TestUtils.LoadReferenceJsonFile(eventReferenceFile);
            var refJObject      = JObject.Parse(refJsonString);

            var diff = ObjectDiffPatch.GenerateDiff(refJObject, eventJObject);

            Debug.WriteLine(diff.NewValues);
            Debug.WriteLine(diff.OldValues);

            Assert.True(diff.NewValues == null, diff.NewValues?.ToString());
            Assert.True(diff.OldValues == null, diff.NewValues?.ToString());
        }
Ejemplo n.º 3
0
        internal static void AssertSameObjectJson(JObject expected, JObject actual)
        {
            var diff = ObjectDiffPatch.GenerateDiff(expected, actual);

            Assert.True(diff.NewValues == null && diff.OldValues == null, "Expected:\n" + diff.OldValues + "\nActual:\n" + diff.NewValues);
        }