Esempio n. 1
0
        public void Fails_invalid_DataType()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            Assert.Throws <InvalidCastException>(() =>
                                                 ((ILiteralNode)wrapper).DataType);
        }
Esempio n. 2
0
        public void Fails_invalid_Uri()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            Assert.Throws <InvalidCastException>(() =>
                                                 ((IUriNode)wrapper).Uri);
        }
Esempio n. 3
0
        public void Fails_invalid_InternalID()
        {
            var node    = new NodeFactory().CreateLiteralNode(string.Empty);
            var wrapper = new MockWrapperNode(node);

            Assert.Throws <InvalidCastException>(() =>
                                                 ((IBlankNode)wrapper).InternalID);
        }
Esempio n. 4
0
        public void Doesnt_implement_WriteXml()
        {
            var node = new NodeFactory().CreateBlankNode();
            IXmlSerializable wrapper = new MockWrapperNode(node);

            Assert.Throws <NotImplementedException>(() =>
                                                    wrapper.WriteXml(XmlWriter.Create(Stream.Null)));
        }
Esempio n. 5
0
        public void Doesnt_implement_GetSchema()
        {
            var node = new NodeFactory().CreateBlankNode();
            IXmlSerializable wrapper = new MockWrapperNode(node);

            Assert.Throws <NotImplementedException>(() =>
                                                    wrapper.GetSchema());
        }
Esempio n. 6
0
        public void Delegates_Language()
        {
            var expected = "en";
            var node     = new NodeFactory().CreateLiteralNode(string.Empty, expected);
            var wrapper  = new MockWrapperNode(node);

            var actual = ((ILiteralNode)wrapper).Language;

            Assert.Equal(expected, actual);
        }
Esempio n. 7
0
        public void Delegates_Value()
        {
            var expected = string.Empty;
            var node     = new NodeFactory().CreateLiteralNode(expected);
            var wrapper  = new MockWrapperNode(node);

            var actual = ((ILiteralNode)wrapper).Value;

            Assert.Equal(expected, actual);
        }
Esempio n. 8
0
        public void Delegates_Uri()
        {
            var expected = UriFactory.Create("urn:s");
            var node     = new NodeFactory().CreateUriNode(expected);
            var wrapper  = new MockWrapperNode(node);

            var actual = ((IUriNode)wrapper).Uri;

            Assert.Equal(expected, actual);
        }
Esempio n. 9
0
        public void Delegates_InternalID()
        {
            var expected = new Guid().ToString();
            var node     = new NodeFactory().CreateBlankNode(expected);
            var wrapper  = new MockWrapperNode(node);

            var actual = ((IBlankNode)wrapper).InternalID;

            Assert.Equal(expected, actual);
        }
Esempio n. 10
0
        public void Delegates_DataType()
        {
            var expected = UriFactory.Create("urn:s");
            var node     = new NodeFactory().CreateLiteralNode(string.Empty, expected);
            var wrapper  = new MockWrapperNode(node);

            var actual = ((ILiteralNode)wrapper).DataType;

            Assert.Equal(expected, actual);
        }
        public void Delegates_Graph()
        {
            var node    = new Graph().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            var expected = node.Graph;
            var actual   = wrapper.Graph;

            Assert.Same(expected, actual);
        }
        public void Delegates_Equal_variable()
        {
            var node    = new NodeFactory().CreateVariableNode(string.Empty);
            var wrapper = new MockWrapperNode(node);

            var expected = node.Equals(node);
            var actual   = wrapper.Equals(node);

            Assert.Equal(expected, actual);
        }
        public void Delegates_NodeType()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            var expected = node.NodeType;
            var actual   = wrapper.NodeType;

            Assert.Equal(expected, actual);
        }
        public void Delegates_ToString_formatter()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            var expected = node.ToString(new CsvFormatter());
            var actual   = wrapper.ToString(new CsvFormatter());

            Assert.Equal(expected, actual);
        }
        public void Delegates_Equal_uri()
        {
            var node    = new NodeFactory().CreateUriNode(UriFactory.Create("http://example.com/"));
            var wrapper = new MockWrapperNode(node);

            var expected = node.Equals(node);
            var actual   = wrapper.Equals(node);

            Assert.Equal(expected, actual);
        }
        public void Delegates_Equal_graphLiteral()
        {
            var node    = new NodeFactory().CreateGraphLiteralNode();
            var wrapper = new MockWrapperNode(node);

            var expected = node.Equals(node);
            var actual   = wrapper.Equals(node);

            Assert.Equal(expected, actual);
        }
        public void Delegates__CompareTo_literal()
        {
            var node    = new NodeFactory().CreateLiteralNode(string.Empty);
            var wrapper = new MockWrapperNode(node);

            var expected = node.CompareTo(node);
            var actual   = wrapper.CompareTo(node);

            Assert.Equal(expected, actual);
        }
        public void Delegates__CompareTo_blank()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            var expected = node.CompareTo(node);
            var actual   = wrapper.CompareTo(node);

            Assert.Equal(expected, actual);
        }
        public void Delegates_Equals_object()
        {
            var node       = new NodeFactory().CreateBlankNode();
            var nodeObject = node as object;
            var wrapper    = new MockWrapperNode(node);

            var expected = node.Equals(nodeObject);
            var actual   = wrapper.Equals(nodeObject);

            Assert.Equal(expected, actual);
        }
Esempio n. 20
0
        public void Doesnt_implement_GetObjectData()
        {
            var node       = new NodeFactory().CreateBlankNode();
            var wrapper    = new MockWrapperNode(node);
            var serializer = new BinaryFormatter(null, default(StreamingContext));

            using (var stream = new MemoryStream())
            {
                Assert.Throws <NotImplementedException>(() =>
                                                        serializer.Serialize(stream, wrapper));
            }
        }
        public void Delegates_GraphUri()
        {
            var node    = new NodeFactory().CreateBlankNode();
            var wrapper = new MockWrapperNode(node);

            wrapper.GraphUri = UriFactory.Create("http://example.com/");

            var expected = node.GraphUri;
            var actual   = wrapper.GraphUri;

            Assert.Equal(expected, actual);
        }