Пример #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));
        }
Пример #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));
        }
Пример #3
0
        public void Contains_rejects_missing_subject()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, 0));
        }
Пример #4
0
        public void Contains_rejects_null_value()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.False(d.Contains(s, null));
        }
Пример #5
0
        public void Add_requires_value()
        {
            var d = new DynamicGraph();
            var s = d.CreateBlankNode();

            Assert.Throws <ArgumentNullException>(() =>
                                                  d.Add(s, null));
        }
Пример #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);
        }
Пример #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));
        }