Exemplo n.º 1
0
        public void TryGetValue_rejects_missing_key()
        {
            var d = new DynamicGraph();
            var s = "urn:s";

            Assert.False(d.TryGetValue(s, out var value));
        }
        public void TryGetValue_rejects_missing_key()
        {
            var d = new DynamicGraph();
            var s = UriFactory.Create("urn:s");

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

            Assert.False(condition);
        }
Exemplo n.º 3
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);
        }
        public void TryGetValue_returns_dynamic_subject()
        {
            var d = new DynamicGraph();

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

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

            Assert.True(d.TryGetValue(s, out var value));
            Assert.Equal(value, d.CreateUriNode(s));
            Assert.IsType <DynamicNode>(value);
        }
Exemplo n.º 5
0
        public void TryGetValue_returns_dynamic_subject()
        {
            var d = new DynamicGraph();

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

            var s = d.Nodes.First();

            Assert.True(d.TryGetValue(s, out var value));
            Assert.Equal(value, s);
            Assert.NotNull(value);
            Assert.IsType <DynamicNode>(value);
        }
        public void TryGetValue_rejects_null_key()
        {
            var d = new DynamicGraph();

            Assert.False(d.TryGetValue(null as Uri, out var value));
        }
Exemplo n.º 7
0
        public void TryGetValue_rejects_null_subject()
        {
            var d = new DynamicGraph();

            Assert.False(d.TryGetValue(null as INode, out var value));
        }