Exemple #1
0
        public void DotNetCommentListItem_FromXml_Data_Empty()
        {
            //arrange
            XElement element = XElement.Parse("<item/>", LoadOptions.PreserveWhitespace);
            //act
            DotNetCommentListItem result = DotNetCommentListItem.FromVisualStudioXml(element);

            //assert
            Assert.AreEqual(false, result.IsHeader);
            Assert.AreEqual(null, result.Term);
            Assert.AreEqual(null, result.Description);
        }
Exemple #2
0
        public void DotNetCommentListItem_FromXml_Header_Description()
        {
            //arrange
            string   description = "Vivamus odio justo, bibendum non rutrum ac.";
            XElement element     = XElement.Parse("<listheader><description>" + description + "</description></listheader>", LoadOptions.PreserveWhitespace);
            //act
            DotNetCommentListItem result = DotNetCommentListItem.FromVisualStudioXml(element);

            //assert
            Assert.AreEqual(true, result.IsHeader);
            Assert.AreEqual(null, result.Term);
            Assert.AreEqual(description, result.Description[0].ToString());
        }
Exemple #3
0
        public void DotNetCommentListItem_FromXml_Header_Term()
        {
            //arrange
            string   text    = "Lorem ipsum dolor sit amet";
            XElement element = XElement.Parse("<listheader><term>" + text + "</term></listheader>", LoadOptions.PreserveWhitespace);
            //act
            DotNetCommentListItem result = DotNetCommentListItem.FromVisualStudioXml(element);

            //assert
            Assert.AreEqual(true, result.IsHeader);
            Assert.AreEqual(text, result.Term[0].ToString());
            Assert.AreEqual(null, result.Description);
        }
Exemple #4
0
        public void DotNetCommentListItem_FromXml_Data_TermDescription()
        {
            //arrange
            string   text        = "Lorem ipsum dolor sit amet";
            string   description = "Vivamus odio justo, bibendum non rutrum ac.";
            XElement element     = XElement.Parse("<item><term>" + text + "</term><description>" + description + "</description></item>", LoadOptions.PreserveWhitespace);
            //act
            DotNetCommentListItem result = DotNetCommentListItem.FromVisualStudioXml(element);

            //assert
            Assert.AreEqual(false, result.IsHeader);
            Assert.AreEqual(text, result.Term[0].ToString());
            Assert.AreEqual(description, result.Description[0].ToString());
        }
        public void DotNetCommentList_FromXml_InlineTagsInItem()
        {
            //arrange
            XElement element = XElement.Parse("<list type='number'><item>ABC <see cref='OtherClass'/> DEF</item></list>", LoadOptions.PreserveWhitespace);
            //act
            DotNetComment result = DotNetCommentList.FromVisualStudioXml(element);

            //assert
            Assert.IsTrue(result is DotNetCommentList);
            DotNetCommentList list = result as DotNetCommentList;

            Assert.AreEqual(1, list.Length);
            DotNetCommentListItem item = list[0];

            Assert.AreEqual(3, item.Term.Count);
            Assert.IsNull(item.Description);
        }