@@ -34,7 +34,11 @@ public void EmptySource()
3434 {
3535 int [ ] source = { } ;
3636
37- Assert . Throws < InvalidOperationException > ( ( ) => source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
37+ Assert . All ( CreateSources ( source ) , source =>
38+ {
39+ Assert . Throws < InvalidOperationException > ( ( ) => source . Aggregate ( ( x , y ) => x + y ) ) ;
40+ Assert . Throws < InvalidOperationException > ( ( ) => source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
41+ } ) ;
3842 }
3943
4044 [ Fact ]
@@ -43,7 +47,10 @@ public void SingleElement()
4347 int [ ] source = { 5 } ;
4448 int expected = 5 ;
4549
46- Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
50+ Assert . All ( CreateSources ( source ) , source =>
51+ {
52+ Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
53+ } ) ;
4754 }
4855
4956 [ Fact ]
@@ -52,7 +59,10 @@ public void SingleElementRunOnce()
5259 int [ ] source = { 5 } ;
5360 int expected = 5 ;
5461
55- Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
62+ Assert . All ( CreateSources ( source ) , source =>
63+ {
64+ Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
65+ } ) ;
5666 }
5767
5868 [ Fact ]
@@ -61,7 +71,10 @@ public void TwoElements()
6171 int [ ] source = { 5 , 6 } ;
6272 int expected = 11 ;
6373
64- Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
74+ Assert . All ( CreateSources ( source ) , source =>
75+ {
76+ Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
77+ } ) ;
6578 }
6679
6780 [ Fact ]
@@ -70,7 +83,10 @@ public void MultipleElements()
7083 int [ ] source = { 5 , 6 , 0 , - 4 } ;
7184 int expected = 7 ;
7285
73- Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
86+ Assert . All ( CreateSources ( source ) , source =>
87+ {
88+ Assert . Equal ( expected , source . Aggregate ( ( x , y ) => x + y ) ) ;
89+ } ) ;
7490 }
7591
7692 [ Fact ]
@@ -79,7 +95,10 @@ public void MultipleElementsRunOnce()
7995 int [ ] source = { 5 , 6 , 0 , - 4 } ;
8096 int expected = 7 ;
8197
82- Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
98+ Assert . All ( CreateSources ( source ) , source =>
99+ {
100+ Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( ( x , y ) => x + y ) ) ;
101+ } ) ;
83102 }
84103
85104 [ Fact ]
@@ -89,7 +108,10 @@ public void EmptySourceAndSeed()
89108 long seed = 2 ;
90109 long expected = 2 ;
91110
92- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
111+ Assert . All ( CreateSources ( source ) , source =>
112+ {
113+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
114+ } ) ;
93115 }
94116
95117 [ Fact ]
@@ -99,7 +121,10 @@ public void SingleElementAndSeed()
99121 long seed = 2 ;
100122 long expected = 10 ;
101123
102- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
124+ Assert . All ( CreateSources ( source ) , source =>
125+ {
126+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
127+ } ) ;
103128 }
104129
105130 [ Fact ]
@@ -109,7 +134,10 @@ public void TwoElementsAndSeed()
109134 long seed = 2 ;
110135 long expected = 60 ;
111136
112- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
137+ Assert . All ( CreateSources ( source ) , source =>
138+ {
139+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
140+ } ) ;
113141 }
114142
115143 [ Fact ]
@@ -119,7 +147,10 @@ public void MultipleElementsAndSeed()
119147 long seed = 2 ;
120148 long expected = - 480 ;
121149
122- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
150+ Assert . All ( CreateSources ( source ) , source =>
151+ {
152+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y ) ) ;
153+ } ) ;
123154 }
124155
125156 [ Fact ]
@@ -129,7 +160,10 @@ public void MultipleElementsAndSeedRunOnce()
129160 long seed = 2 ;
130161 long expected = - 480 ;
131162
132- Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( seed , ( x , y ) => x * y ) ) ;
163+ Assert . All ( CreateSources ( source ) , source =>
164+ {
165+ Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( seed , ( x , y ) => x * y ) ) ;
166+ } ) ;
133167 }
134168
135169 [ Fact ]
@@ -139,7 +173,10 @@ public void NoElementsSeedResultSeletor()
139173 long seed = 2 ;
140174 double expected = 7 ;
141175
142- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
176+ Assert . All ( CreateSources ( source ) , source =>
177+ {
178+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
179+ } ) ;
143180 }
144181
145182 [ Fact ]
@@ -149,7 +186,10 @@ public void SingleElementSeedResultSelector()
149186 long seed = 2 ;
150187 long expected = 15 ;
151188
152- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
189+ Assert . All ( CreateSources ( source ) , source =>
190+ {
191+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
192+ } ) ;
153193 }
154194
155195 [ Fact ]
@@ -159,7 +199,10 @@ public void TwoElementsSeedResultSelector()
159199 long seed = 2 ;
160200 long expected = 65 ;
161201
162- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
202+ Assert . All ( CreateSources ( source ) , source =>
203+ {
204+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
205+ } ) ;
163206 }
164207
165208 [ Fact ]
@@ -169,7 +212,10 @@ public void MultipleElementsSeedResultSelector()
169212 long seed = 2 ;
170213 long expected = - 475 ;
171214
172- Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
215+ Assert . All ( CreateSources ( source ) , source =>
216+ {
217+ Assert . Equal ( expected , source . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
218+ } ) ;
173219 }
174220
175221 [ Fact ]
@@ -179,7 +225,10 @@ public void MultipleElementsSeedResultSelectorRunOnce()
179225 long seed = 2 ;
180226 long expected = - 475 ;
181227
182- Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
228+ Assert . All ( CreateSources ( source ) , source =>
229+ {
230+ Assert . Equal ( expected , source . RunOnce ( ) . Aggregate ( seed , ( x , y ) => x * y , x => x + 5.0 ) ) ;
231+ } ) ;
183232 }
184233
185234 [ Fact ]
0 commit comments