5
5
using System . IO ;
6
6
using System . Text ;
7
7
using System . Xml ;
8
+ using NUnit . Common ;
8
9
using NUnit . Engine ;
9
10
using NUnit . Framework ;
10
11
using NUnit . Framework . Api ;
@@ -19,13 +20,11 @@ public class ResultReporterTests
19
20
private StringBuilder _reportBuilder ;
20
21
private ExtendedTextWrapper _writer ;
21
22
22
- private string ReportOutput => _reportBuilder . ToString ( ) ;
23
-
24
23
private List < string > ReportLines
25
24
{
26
25
get
27
26
{
28
- var rdr = new StringReader ( ReportOutput ) ;
27
+ var rdr = new StringReader ( _reportBuilder . ToString ( ) ) ;
29
28
30
29
string ? line ;
31
30
var lines = new List < string > ( ) ;
@@ -86,9 +85,10 @@ public void ReportSequenceTest()
86
85
87
86
int last = - 1 ;
88
87
88
+ string reportOutput = _reportBuilder . ToString ( ) ;
89
89
foreach ( string title in reportSequence )
90
90
{
91
- var index = ReportOutput . IndexOf ( title ) ;
91
+ var index = reportOutput . IndexOf ( title ) ;
92
92
Assert . That ( index > 0 , "Report not found: " + title ) ;
93
93
Assert . That ( index > last , "Report out of sequence: " + title ) ;
94
94
last = index ;
@@ -141,8 +141,9 @@ public void ErrorsFailuresAndWarningsReportTest()
141
141
142
142
ResultReporter . WriteErrorsFailuresAndWarningsReport ( _result , _writer ) ;
143
143
144
+ string reportOutput = _reportBuilder . ToString ( ) ;
144
145
foreach ( var item in expected )
145
- Assert . That ( ReportOutput . Contains ( item ) ) ;
146
+ Assert . That ( reportOutput . Contains ( item ) ) ;
146
147
}
147
148
148
149
[ Test ]
@@ -178,12 +179,6 @@ public void TestsNotRunTest()
178
179
Assert . That ( ReportLines , Is . EqualTo ( expected ) ) ;
179
180
}
180
181
181
- //[Test, Explicit("Displays failure behavior")]
182
- //public void WarningsOnlyDisplayOnce()
183
- //{
184
- // Assert.Warn("Just a warning");
185
- //}
186
-
187
182
[ Test ]
188
183
public void TestParameterSettingsWrittenCorrectly ( )
189
184
{
0 commit comments