コード例 #1
0
        public void CompareTwoPropertiesSecondThatIsJtokenNull()
        {
            var jObject1 = new JObject();

            jObject1.Add("Prop", JObject.FromObject(new ComplexObject(false)));
            var jObject2 = new JObject();

            jObject2.Add("Prop", new JValue((object)null));

            var result = new JTokenComparer(new IndexArrayKeySelector()).CompareTokens("root", jObject1, jObject2);

            Assert.True(result.ComparisonResult.Equals(ComparisonResult.Different));
            var resultReport = ComparisonResultTextExporter.Report(result, new ComparisonResult[] { ComparisonResult.Different, ComparisonResult.DifferentTypes, ComparisonResult.Filtered, ComparisonResult.Identical, ComparisonResult.MissingInSource1, ComparisonResult.MissingInSource2 }, new ReporterSettings {
                Source1Name = "QA", Source2Name = "PROD"
            });
        }
コード例 #2
0
        public void CompareTwoPropertiesThatAreJTokenNull()
        {
            var jObject1 = new JObject();

            jObject1.Add("Prop", new JValue((object)null));
            var jObject2 = new JObject();

            jObject2.Add("Prop", new JValue((object)null));

            var result = new JTokenComparer(new IndexArrayKeySelector()).CompareTokens("root", jObject1, jObject2);

            result.ComparrisonResult.Should().Be(ComparisonResult.Identical);
            var resultReport = ComparrisonResultTextExporter.Report(result, new ComparisonResult[] { ComparisonResult.Different, ComparisonResult.DifferentTypes, ComparisonResult.Filtered, ComparisonResult.Identical, ComparisonResult.MissingInSource1, ComparisonResult.MissingInSource2 }, new ReporterSettings {
                Source1Name = "QA", Source2Name = "PROD"
            });
        }