public void DotNetCommentText_FromXml_Short()
        {
            //arrange
            string text = "Lorem ipsum dolor sit amet";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(text);

            //assert
            Assert.AreEqual(text, result.Text);
        }
        public void DotNetCommentText_FromXml_Empty()
        {
            //arrange
            string text = "";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(text);

            //assert
            Assert.AreEqual(null, result.Text);
        }
        public void DotNetCommentText_FromXml_InLine()
        {
            //arrange
            string originalText   = " or ";
            string expectedResult = " or ";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(originalText);

            //assert
            Assert.AreEqual(expectedResult, result.Text);
        }
        public void DotNetCommentText_FromXml_RealExample_A()
        {
            //arrange
            string originalText   = @"
            Tests the display of common data types that have recognized aliases in .Net.
            Also common data types that have long fully-qualified names.
            ";
            string expectedResult = "Tests the display of common data types that have recognized aliases in .Net.\nAlso common data types that have long fully-qualified names.";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(originalText);

            //assert
            Assert.AreEqual(expectedResult, result.Text);
        }
        public void DotNetCommentText_FromXml_RealExample_A2()
        {
            //arrange
            XElement element        = XElement.Parse(@"<summary>
            Tests the display of common data types that have recognized aliases in .Net.
            Also common data types that have long fully-qualified names.
            </summary>", LoadOptions.PreserveWhitespace);
            string   originalText   = Utilities.XNodeToString(element.Nodes().First());
            string   expectedResult = "Tests the display of common data types that have recognized aliases in .Net.\nAlso common data types that have long fully-qualified names.";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(originalText);

            //assert
            Assert.AreEqual(expectedResult, result.Text);
        }
        public void DotNetCommentText_FromXml_Formatted()
        {
            //arrange
            string originalText   = @"
	  Lorem ipsum dolor sit amet. 
	  ultricies hendrerit vehicula. 

	  In tempus id diam eu mollis. Donec 
	  vulputate, nunc massa bibendum purus."    ;
            string expectedResult = "Lorem ipsum dolor sit amet. \nultricies hendrerit vehicula. \n\nIn tempus id diam eu mollis. Donec \nvulputate, nunc massa bibendum purus.";
            //act
            DotNetCommentText result = DotNetCommentText.FromVisualStudioXml(originalText);

            //assert
            Assert.AreEqual(expectedResult, result.Text);
        }
        public void DotNetCommentText_FromXml_RealExample_A3()
        {
            //arrange
            XElement element        = XElement.Parse(@"<summary>
            Tests the display of common data types that have recognized aliases in .Net.
            Also common data types that have long fully-qualified names.
            </summary>", LoadOptions.PreserveWhitespace);
            string   expectedResult = "Tests the display of common data types that have recognized aliases in .Net.\nAlso common data types that have long fully-qualified names.";
            //act
            DotNetComment      result      = DotNetComment.FromVisualStudioXml(element);
            DotNetCommentGroup groupResult = result as DotNetCommentGroup;

            result = groupResult.Comments.First();
            DotNetCommentText textResult = result as DotNetCommentText;

            //assert
            Assert.AreEqual(expectedResult, textResult.Text);
        }