public void TestXmlCommentsFormatter_NotXml() { var testComment = @"not xml"; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("not xml", result.OtherText); }
public void TestCommentsFormatter_Remove_CommentsSyntaxSimple() { var testComment = @" // Simple comment "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("Simple comment", result.OtherText); }
public void TestCommentsFormatter_Remove_CommentsSyntaxMultilineWithExtraSlashes() { var testComment = @" /// Simple comment /// Second line "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("Simple comment\r\nSecond line", result.OtherText); }
public void TestXmlCommentsFormatter_Summary() { var testComment = @" /// <summary> /// This is function to do something /// </summary> "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("This is function to do something", result.Summary, "Summary not match"); }
public void TestCommentsFormatter_Remove_CommentsSyntaxMultiline2() { var testComment = @" /* First line Second line */"; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("First line\r\nSecond line", result.OtherText); }
public void TestXmlCommentsFormatter_OtherTags() { var testComment = @" /// <summary> /// This is function to do something /// </summary> /// <customsummary> /// This is custom tag /// </customsummary> "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("This is function to do something", result.Summary, "Summary not match"); Assert.AreEqual("This is custom tag", result.OtherText, "Other text not match"); }
public void TestCommentsFormatter_Remove_CommentsSyntaxMultilineBoxStyle() { var testComment = @" /************************************************************ * Box styling comment * * Looks like a very solid block * * * * * * Author: Person who likes blocks * ************************************************************/ "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("Box styling comment\r\nLooks like a very solid block\r\nAuthor: Person who likes blocks", result.OtherText); }
public void TestXmlCommentsFormatter_Params() { var testComment = @" /// <summary> /// This is function to do something /// </summary> /// <param name=""par1""> /// Param # 1 /// </param> /// <param name=""par2""> /// Param # 2 /// </param> "; var result = CommentTipFormatter.ParseCommentStructure(testComment); Assert.AreEqual("This is function to do something", result.Summary, "Summary not match"); Assert.AreEqual(2, result.Parameters.Count, "Parameters count not match"); Assert.AreEqual("par1", result.Parameters[0].Key, "Parameter not match"); Assert.AreEqual("Param # 1", result.Parameters[0].Value, "Parameter not match"); Assert.AreEqual("par2", result.Parameters[1].Key, "Parameter not match"); Assert.AreEqual("Param # 2", result.Parameters[1].Value, "Parameter not match"); }