Esempio n. 1
0
        public void Remove_po_rejects_missing_statements()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();
            var p = d.CreateBlankNode();

            Assert.False(d.Remove(s, p));
        }
Esempio n. 2
0
        public void Remove_po_rejects_null_predicate_and_object()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Remove(s, null));
        }
Esempio n. 3
0
        public void Contains_rejects_missing_subject()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, 0));
        }
Esempio n. 4
0
        public void Contains_rejects_null_value()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, null));
        }
Esempio n. 5
0
        public void Add_requires_value()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.Throws <ArgumentNullException>(() =>
                                                  d.Add(s, null));
        }
Esempio n. 6
0
        public void TryGetValue_rejects_missing_subject()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            var condition = d.TryGetValue(s, out var value);

            Assert.False(condition);
            Assert.Null(value);
        }
Esempio n. 7
0
        public void Add_fails_unknown_key_type()
        {
            var g = new DynamicGraph(predicateBaseUri: UriFactory.Create("urn:"));
            var s = g.CreateBlankNode();
            var predicateAndObjects = new Dictionary <object, object>
            {
                { 0, "o" }
            };

            Assert.Throws <InvalidOperationException>(() =>
                                                      g.Add(s, predicateAndObjects));
        }