public void GraphDiffNullReferenceBoth()
        {
            GraphDiff       diff   = new GraphDiff();
            GraphDiffReport report = diff.Difference(null, null);

            TestTools.ShowDifferences(report);

            Assert.True(report.AreEqual, "Graphs should have been reported as equal for two null references");
            Assert.False(report.AreDifferentSizes, "Graphs should have been reported same size for two null references");
        }
        public void GraphDiffNullReferenceA()
        {
            Graph g = new Graph();

            g.LoadFromFile("resources\\InferenceTest.ttl");

            GraphDiff       diff   = new GraphDiff();
            GraphDiffReport report = diff.Difference(null, g);

            TestTools.ShowDifferences(report);

            Assert.False(report.AreEqual, "Graphs should have been reported as non-equal for one null reference");
            Assert.True(report.AreDifferentSizes, "Graphs should have been reported as different sizes for one null reference");
            Assert.True(report.AddedTriples.Any(), "Report should list added triples");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Computes the Difference between this Graph the given Graph.
        /// </summary>
        /// <param name="g">Graph.</param>
        /// <returns></returns>
        /// <remarks>
        /// <para>
        /// Produces a report which shows the changes that must be made to this Graph to produce the given Graph.
        /// </para>
        /// </remarks>
        public GraphDiffReport Difference(IGraph g)
        {
            GraphDiff differ = new GraphDiff();

            return(differ.Difference(this, g));
        }