|
5 | 5 | using System.Linq; |
6 | 6 | using System.Text; |
7 | 7 | using System.Web.UI; |
| 8 | + using TestStack.ConventionTests.ConventionData; |
8 | 9 | using TestStack.ConventionTests.Internal; |
9 | 10 |
|
10 | 11 | public class HtmlConventionResultsReporter : GroupedByDataTypeConventionResultsReporterBase |
@@ -61,28 +62,35 @@ protected override string Process(IConventionFormatContext context, IEnumerable< |
61 | 62 | conventionResult.DataDescription.Replace("'", string.Empty).Replace(" ", string.Empty).Replace(".", string.Empty); |
62 | 63 | html.AddAttribute("style", "margin-left:20px;"); |
63 | 64 | html.RenderBeginTag(HtmlTextWriterTag.H4); |
64 | | - |
65 | | - html.AddAttribute("class", "menu-toggle"); |
66 | | - html.AddAttribute("data-toggle", "collapse"); |
67 | | - html.AddAttribute("data-target", "." + targetId); |
68 | | - html.RenderBeginTag(HtmlTextWriterTag.A); |
69 | | - html.AddAttribute("class", "icon-angle-down"); |
70 | | - html.RenderBeginTag(HtmlTextWriterTag.I); |
71 | | - html.RenderEndTag(); |
72 | | - html.RenderEndTag(); |
73 | 65 | html.Write(conventionResult.ConventionTitle); |
74 | 66 | html.RenderEndTag(); |
75 | | - html.AddAttribute("class", targetId + " collapse"); |
76 | | - html.AddAttribute("style", "margin-left:20px;"); |
77 | | - html.RenderBeginTag(HtmlTextWriterTag.Div); |
78 | | - html.RenderBeginTag(HtmlTextWriterTag.Ul); |
79 | | - foreach (var o in conventionResult.Data) |
| 67 | + if (conventionResult.Data.Any()) |
80 | 68 | { |
81 | | - html.RenderBeginTag(HtmlTextWriterTag.Li); |
82 | | - html.Write(context.FormatDataAsHtml(o)); |
| 69 | + html.AddAttribute("style", "margin-left:20px;"); |
| 70 | + html.RenderBeginTag(HtmlTextWriterTag.Div); |
| 71 | + html.AddAttribute("class", "menu-toggle"); |
| 72 | + html.AddAttribute("data-toggle", "collapse"); |
| 73 | + html.AddAttribute("data-target", "." + targetId); |
| 74 | + html.RenderBeginTag(HtmlTextWriterTag.A); |
| 75 | + html.AddAttribute("class", "icon-angle-down"); |
| 76 | + html.RenderBeginTag(HtmlTextWriterTag.I); |
| 77 | + html.RenderEndTag(); |
| 78 | + html.Write("With the exception of the following {0}: ", conventionResult.DataType.GetSentenceCaseName()); |
| 79 | + html.RenderEndTag(); |
| 80 | + html.AddAttribute("class", targetId + " collapse"); |
| 81 | + html.AddAttribute("style", "margin-left:20px;"); |
| 82 | + html.RenderBeginTag(HtmlTextWriterTag.Div); |
| 83 | + html.RenderBeginTag(HtmlTextWriterTag.Ul); |
| 84 | + foreach (var o in conventionResult.Data) |
| 85 | + { |
| 86 | + html.RenderBeginTag(HtmlTextWriterTag.Li); |
| 87 | + html.Write(context.FormatDataAsHtml(o)); |
| 88 | + html.RenderEndTag(); |
| 89 | + } |
| 90 | + html.RenderEndTag(); |
83 | 91 | html.RenderEndTag(); |
84 | 92 | } |
85 | | - html.RenderEndTag(); |
| 93 | + |
86 | 94 | html.RenderEndTag(); |
87 | 95 | } |
88 | 96 | html.RenderEndTag(); |
|
0 commit comments