Example #1
0
        public void Contains_rejects_missing_subject()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, 0));
        }
        public void Contains_rejects_null_value()
        {
            var d = new DynamicGraph() as IDictionary <Uri, object>;
            var s = UriFactory.Create("urn:s");

            Assert.False(d.Contains(new KeyValuePair <Uri, object>(s, null)));
        }
Example #3
0
        public void Contains_rejects_null_value()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, null));
        }
Example #4
0
        public void Contains_rejects_missing_key()
        {
            var d = new DynamicGraph() as IDictionary <string, object>;
            var s = "urn:s";

            Assert.False(d.Contains(new KeyValuePair <string, object>(s, 0)));
        }
        public void Contains_rejects_missing_key()
        {
            var d = new DynamicGraph() as IDictionary <Uri, object>;
            var s = UriFactory.Create("urn:s");

            var condition = d.Contains(new KeyValuePair <Uri, object>(s, 0));

            Assert.False(condition);
        }
Example #6
0
        public void Contains_rejects_missing_statement()
        {
            var d = new DynamicGraph(predicateBaseUri: UriFactory.Create("urn:"));

            d.LoadFromString(@"
<urn:s> <urn:p> <urn:o> .
");

            var s = d.CreateUriNode(UriFactory.Create("urn:s"));

            Assert.False(d.Contains(s, new { p = s }));
        }
Example #7
0
        public void Contains_searches_exisiting_statements()
        {
            var d = new DynamicGraph(predicateBaseUri: UriFactory.Create("urn:"));

            d.LoadFromString(@"
<urn:s> <urn:p> <urn:o> .
");

            var s = d.CreateUriNode(UriFactory.Create("urn:s"));
            var o = d.CreateUriNode(UriFactory.Create("urn:o"));

            Assert.True(d.Contains(s, new { p = o }));
        }
Example #8
0
        public void Contains_fails_unknown_key_type()
        {
            var g = new DynamicGraph(predicateBaseUri: UriFactory.Create("urn:"));

            g.LoadFromString(@"
<urn:s> <urn:p> <urn:o> .
");
            var s = g.CreateUriNode(UriFactory.Create("urn:s"));
            var predicateAndObjects = new Dictionary <object, object>
            {
                { 0, "o" }
            };

            Assert.Throws <InvalidOperationException>(() =>
                                                      g.Contains(s, predicateAndObjects));
        }
        public void Contains_rejects_null_key()
        {
            var d = new DynamicGraph() as IDictionary <Uri, object>;

            Assert.False(d.Contains(new KeyValuePair <Uri, object>(null, null)));
        }
Example #10
0
        public void Contains_rejects_null_subject()
        {
            var d = new DynamicGraph();

            Assert.False(d.Contains(null as INode, null));
        }