Example #1
0
        public void ToString_WithTextNotNull_ShouldReturnText()
        {
            const string text = "test";
            var node = new TextNode(text);

            Assert.AreEqual(text, node.ToString());
        }
        public void AsTextNode_WithTextNode_ShouldBeCastToTextNode()
        {
            Node node = new TextNode(string.Empty);
            var castNode = node.AsTextNode();

            Assert.IsInstanceOfType(castNode, typeof(TextNode));
        }
Example #3
0
        public void Constructor_WithText_ShouldSetTextProperty()
        {
            const string text = "test";
            var node = new TextNode(text);

            Assert.AreEqual(text, node.Text);
        }
Example #4
0
        public void ToString_WithTextNull_ShouldReturnEmptyString()
        {
            var node = new TextNode(null);

            Assert.AreEqual(string.Empty, node.ToString());
        }
 public void AsTagNode_WithNonTagNode_ShouldThrowInvalidCastException()
 {
     Node node = new TextNode(string.Empty);
     node.AsTagNode();
 }