Exemplo n.º 1
0
        public void RdfXmlTestSuite(string name)
        {
            RdfXmlTestSuiteHelper.GetGraphs(name, out IGraph action, out IGraph expected);

            // If default readers don't agree they're equal, there's nothing to test
            if (!expected.Equals(action))
            {
                Assert.Inconclusive();
            }

            var actual = new Graph();

            actual.LoadFromString(
                StringWriter.Write(action, new FriendlyRdfXmlWriter()),
                new RdfXmlParser());

            Assert.AreEqual(expected, actual);
        }
        public void JsonLDTestSuite(string name)
        {
            RdfXmlTestSuiteHelper.GetGraphs(name, out IGraph action, out IGraph expected);

            if (!expected.Equals(action))
            {
                Assert.Inconclusive();
            }

            var actual = new TripleStore();

            actual.LoadFromString(
                StringWriter.Write(action, new FriendlyJsonLdWriter()),
                new JsonLdParser());

            if (!(actual.IsEmpty && expected.IsEmpty))
            {
                Assert.AreEqual(
                    Normalize(expected),
                    Normalize(actual.Graphs.Single()));
            }
        }