예제 #1
0
        public void TestCreateFromOther()
        {
            var hOtherComment = new HComment("Content");

            var hComment = new HComment(hOtherComment);

            Assert.Equal("Content", hComment.Value);

            Assert.Throws <ArgumentNullException>(() => new HComment((HComment)null));
        }
예제 #2
0
        public void TestValue()
        {
            var hComment = new HComment("Content");

            Assert.Equal("Content", hComment.Value);
            hComment.Value = "Other content";
            Assert.Equal("Other content", hComment.Value);

            Assert.Throws <ArgumentNullException>(() => hComment.Value = null);
        }
예제 #3
0
        public void TestCreate()
        {
            var hComment = new HComment("Content");

            Assert.Equal("Content", hComment.Value);

            hComment = new HComment("");
            Assert.Equal("", hComment.Value);

            Assert.Throws <ArgumentNullException>(() => new HComment((String)null));
        }
예제 #4
0
        public void TestClone()
        {
            HComment hComment = new HComment("Test");

            HContainer parent = new HElement("test");

            parent.Add(hComment);
            Assert.Same(hComment, parent.FirstNode);
            Assert.Same(hComment, parent.LastNode);

            HContainer otherParent = new HElement("test");

            // Do clone
            otherParent.Add(hComment);

            Assert.IsType <HComment>(otherParent.FirstNode);
            Assert.NotSame(otherParent.FirstNode, parent.FirstNode);
        }