@@ -19,7 +19,7 @@ public void CreateTracker()
19
19
{
20
20
_tracker = new WorkItemTracker ( ) ;
21
21
_listener = _tracker ;
22
- _pendingNotices = new List < string > ( ) ;
22
+ _pendingNotices = [ ] ;
23
23
}
24
24
25
25
[ TestCaseSource ( nameof ( AllItemsComplete ) ) ]
@@ -29,7 +29,7 @@ public void WhenAllItemsComplete_NoAdditionalReportsAreIssued(ReportSequence rep
29
29
30
30
_tracker . SendPendingTestCompletionEvents ( this ) ;
31
31
32
- Assert . That ( _pendingNotices . Count , Is . EqualTo ( 0 ) ) ;
32
+ Assert . That ( _pendingNotices , Is . Empty ) ;
33
33
}
34
34
35
35
[ TestCaseSource ( nameof ( SomeItemsIncomplete ) ) ]
@@ -42,14 +42,9 @@ public void WhenItemsFailToComplete_ReportsAreIssued(ReportSequence reports, Rep
42
42
Assert . That ( _pendingNotices , Is . EqualTo ( expectedNotices . Reports ) ) ;
43
43
}
44
44
45
- public class ReportSequence
45
+ public class ReportSequence ( params string [ ] reports )
46
46
{
47
- public ReportSequence ( params string [ ] reports )
48
- {
49
- Reports = reports ;
50
- }
51
-
52
- public string [ ] Reports { get ; }
47
+ public string [ ] Reports { get ; } = reports ;
53
48
54
49
public void SendTo ( ITestEventListener listener )
55
50
{
@@ -79,8 +74,8 @@ public void SendTo(ITestEventListener listener)
79
74
static readonly string CANCEL_FIXTURE_1 = END_FIXTURE_1 . Replace ( "/>" , CANCEL_INFO ) ;
80
75
static readonly string CANCEL_FIXTURE_2 = END_FIXTURE_2 . Replace ( "/>" , CANCEL_INFO ) ;
81
76
82
- static TestCaseData [ ] AllItemsComplete = new TestCaseData [ ]
83
- {
77
+ static readonly TestCaseData [ ] AllItemsComplete =
78
+ [
84
79
new TestCaseData ( new ReportSequence (
85
80
START_ASSEMBLY , START_NS_1 , START_NS_2 ,
86
81
START_FIXTURE_1 , END_FIXTURE_1 ,
@@ -91,10 +86,10 @@ public void SendTo(ITestEventListener listener)
91
86
START_FIXTURE_1 , START_FIXTURE_2 ,
92
87
END_FIXTURE_1 , END_FIXTURE_2 ,
93
88
END_NS_2 , END_NS_1 , END_ASSEMBLY ) )
94
- } ;
89
+ ] ;
95
90
96
- static TestCaseData [ ] SomeItemsIncomplete = new TestCaseData [ ]
97
- {
91
+ static readonly TestCaseData [ ] SomeItemsIncomplete =
92
+ [
98
93
new TestCaseData (
99
94
new ReportSequence (
100
95
START_ASSEMBLY , START_NS_1 , START_NS_2 ,
@@ -116,7 +111,7 @@ public void SendTo(ITestEventListener listener)
116
111
START_FIXTURE_2 ) , // Both fixtures hang!
117
112
new ReportSequence (
118
113
CANCEL_FIXTURE_2 , CANCEL_FIXTURE_1 , CANCEL_NS_2 , CANCEL_NS_1 , CANCEL_ASSEMBLY ) ) ,
119
- } ;
114
+ ] ;
120
115
121
116
void ITestEventListener . OnTestEvent ( string report )
122
117
{
0 commit comments