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); }
private void FillNodes(Hierarchy <CodeNode> source, TreeNodeCollection dest, int level, IList <CodeNode> functions) { if (!source.HasChildren) { return; } var isSort = Settings.SortingEnabled; var childrens = source.Children; if (isSort) { childrens.Sort((a1, a2) => string.Compare(a1.Item.Alias, a2.Item.Alias)); } foreach (var item in childrens) { CodeNode node = item.Item; if (node.StartLine > _lastCodeLine) { _lastCodeLine = node.StartLine; } CustomTreeNode treeNode = new CustomTreeNode(node.Alias); treeNode.CodeNode = node; treeNode.ToolTipText = CommentTipFormatter.FormatPlainTextComment(node.Comment); treeNode.StateImageIndex = GetImageIndex(node.NodeType); _sourceFileSpecificSettingsManager.RestoreMark(treeNode); dest.Add(treeNode); functions.Add(node); if (item.HasChildren) { FillNodes(item, treeNode.Nodes, level + 1, functions); } var isExpanded = _expandedNodesManager.IsNoteExpanded(treeNode); if (isExpanded.HasValue) { if (isExpanded.Value) { treeNode.Expand(); } } else { if (Settings.AutoExpandAll) { treeNode.Expand(); } } } }
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"); }