@@ -7,7 +7,7 @@ public class XsParserExpressionTests
77{
88 public static XsParser Xs { get ; } = new ( ) ;
99
10- [ DataTestMethod ]
10+ [ TestMethod ]
1111 [ DataRow ( CompilerType . Fast ) ]
1212 [ DataRow ( CompilerType . System ) ]
1313 [ DataRow ( CompilerType . Interpret ) ]
@@ -23,7 +23,7 @@ public void Compile_ShouldSucceed_Constant( CompilerType compiler )
2323 Assert . AreEqual ( 5 , result ) ;
2424 }
2525
26- [ DataTestMethod ]
26+ [ TestMethod ]
2727 [ DataRow ( CompilerType . Fast ) ]
2828 [ DataRow ( CompilerType . System ) ]
2929 [ DataRow ( CompilerType . Interpret ) ]
@@ -39,7 +39,7 @@ public void Compile_ShouldSucceed_UnaryNegate( CompilerType compiler )
3939 Assert . AreEqual ( 2 , result ) ;
4040 }
4141
42- [ DataTestMethod ]
42+ [ TestMethod ]
4343 [ DataRow ( CompilerType . Fast ) ]
4444 [ DataRow ( CompilerType . System ) ]
4545 [ DataRow ( CompilerType . Interpret ) ]
@@ -55,7 +55,7 @@ public void Compile_ShouldSucceed_UnaryNot( CompilerType compiler )
5555 Assert . IsTrue ( result ) ;
5656 }
5757
58- [ DataTestMethod ]
58+ [ TestMethod ]
5959 [ DataRow ( CompilerType . Fast ) ]
6060 [ DataRow ( CompilerType . System ) ]
6161 [ DataRow ( CompilerType . Interpret ) ]
@@ -71,7 +71,7 @@ public void Compile_ShouldSucceed_UnaryIsFalse( CompilerType compiler )
7171 Assert . IsTrue ( result ) ;
7272 }
7373
74- [ DataTestMethod ]
74+ [ TestMethod ]
7575 [ DataRow ( CompilerType . Fast ) ]
7676 [ DataRow ( CompilerType . System ) ]
7777 [ DataRow ( CompilerType . Interpret ) ]
@@ -87,7 +87,7 @@ public void Compile_ShouldSucceed_UnaryIsTrue( CompilerType compiler )
8787 Assert . IsTrue ( result ) ;
8888 }
8989
90- [ DataTestMethod ]
90+ [ TestMethod ]
9191 [ DataRow ( CompilerType . Fast ) ]
9292 [ DataRow ( CompilerType . System ) ]
9393 [ DataRow ( CompilerType . Interpret ) ]
@@ -103,7 +103,7 @@ public void Compile_ShouldSucceed_UnaryNot_Grouping( CompilerType compiler )
103103 Assert . IsTrue ( result ) ;
104104 }
105105
106- [ DataTestMethod ]
106+ [ TestMethod ]
107107 [ DataRow ( CompilerType . Fast ) ]
108108 [ DataRow ( CompilerType . System ) ]
109109 [ DataRow ( CompilerType . Interpret ) ]
@@ -119,7 +119,7 @@ public void Compile_ShouldSucceed_BinaryAdd( CompilerType compiler )
119119 Assert . AreEqual ( 22 , result ) ;
120120 }
121121
122- [ DataTestMethod ]
122+ [ TestMethod ]
123123 [ DataRow ( CompilerType . Fast ) ]
124124 [ DataRow ( CompilerType . System ) ]
125125 [ DataRow ( CompilerType . Interpret ) ]
@@ -135,7 +135,7 @@ public void Compile_ShouldSucceed_BinaryAdd_WithMultiple( CompilerType compiler
135135 Assert . AreEqual ( 36 , result ) ;
136136 }
137137
138- [ DataTestMethod ]
138+ [ TestMethod ]
139139 [ DataRow ( CompilerType . Fast ) ]
140140 [ DataRow ( CompilerType . System ) ]
141141 [ DataRow ( CompilerType . Interpret ) ]
@@ -151,7 +151,7 @@ public void Compile_ShouldSucceed_BinaryAdd_WithGrouping( CompilerType compiler
151151 Assert . AreEqual ( 44 , result ) ;
152152 }
153153
154- [ DataTestMethod ]
154+ [ TestMethod ]
155155 [ DataRow ( CompilerType . Fast ) ]
156156 [ DataRow ( CompilerType . System ) ]
157157 [ DataRow ( CompilerType . Interpret ) ]
@@ -167,7 +167,7 @@ public void Compile_ShouldSucceed_BinaryAdd_WithMultipleGrouping( CompilerType c
167167 Assert . AreEqual ( 44 , result ) ;
168168 }
169169
170- [ DataTestMethod ]
170+ [ TestMethod ]
171171 [ DataRow ( CompilerType . Fast ) ]
172172 [ DataRow ( CompilerType . System ) ]
173173 [ DataRow ( CompilerType . Interpret ) ]
@@ -183,7 +183,7 @@ public void Compile_ShouldSucceed_BinaryLessThan( CompilerType compiler )
183183 Assert . IsTrue ( result ) ;
184184 }
185185
186- [ DataTestMethod ]
186+ [ TestMethod ]
187187 [ DataRow ( CompilerType . Fast ) ]
188188 [ DataRow ( CompilerType . System ) ]
189189 [ DataRow ( CompilerType . Interpret ) ]
@@ -199,7 +199,7 @@ public void Compile_ShouldSucceed_BinaryExponentiation( CompilerType compiler )
199199 Assert . AreEqual ( 8 , result ) ;
200200 }
201201
202- [ DataTestMethod ]
202+ [ TestMethod ]
203203 [ DataRow ( CompilerType . Fast ) ]
204204 [ DataRow ( CompilerType . System ) ]
205205 [ DataRow ( CompilerType . Interpret ) ]
@@ -215,14 +215,15 @@ public void Compile_ShouldSucceed_BinaryExponentiation_WithGrouping( CompilerTyp
215215 Assert . AreEqual ( 25 , result ) ;
216216 }
217217
218- [ DataTestMethod ]
218+ [ TestMethod ]
219219 [ DataRow ( CompilerType . Fast ) ]
220220 [ DataRow ( CompilerType . System ) ]
221221 [ DataRow ( CompilerType . Interpret ) ]
222- [ ExpectedException ( typeof ( SyntaxException ) ) ]
223222 public void Compile_ShouldFail_WithInvalidOperator ( CompilerType compiler )
224223 {
225- try
224+ Assert . ThrowsExactly < SyntaxException > ( ( ) =>
225+ {
226+ try
226227 {
227228 Xs . Parse ( "x = 5 $ 10;" ) ;
228229 }
@@ -231,16 +232,18 @@ public void Compile_ShouldFail_WithInvalidOperator( CompilerType compiler )
231232 Console . WriteLine ( ex . Message ) ;
232233 throw ;
233234 }
235+ } ) ;
234236 }
235237
236- [ DataTestMethod ]
238+ [ TestMethod ]
237239 [ DataRow ( CompilerType . Fast ) ]
238240 [ DataRow ( CompilerType . System ) ]
239241 [ DataRow ( CompilerType . Interpret ) ]
240- [ ExpectedException ( typeof ( SyntaxException ) ) ]
241242 public void Compile_ShouldFail_WithInvalidMathOperator ( CompilerType compiler )
242243 {
243- try
244+ Assert . ThrowsExactly < SyntaxException > ( ( ) =>
245+ {
246+ try
244247 {
245248 Xs . Parse ( "5 ++ 10;" ) ;
246249 }
@@ -249,16 +252,18 @@ public void Compile_ShouldFail_WithInvalidMathOperator( CompilerType compiler )
249252 Console . WriteLine ( ex . Message ) ;
250253 throw ;
251254 }
255+ } ) ;
252256 }
253257
254- [ DataTestMethod ]
258+ [ TestMethod ]
255259 [ DataRow ( CompilerType . Fast ) ]
256260 [ DataRow ( CompilerType . System ) ]
257261 [ DataRow ( CompilerType . Interpret ) ]
258- [ ExpectedException ( typeof ( SyntaxException ) ) ]
259262 public void Compile_ShouldFail_WithInvalidGrouping ( CompilerType compiler )
260263 {
261- try
264+ Assert . ThrowsExactly < SyntaxException > ( ( ) =>
265+ {
266+ try
262267 {
263268 Xs . Parse ( "(5 **) 2;" ) ;
264269 }
@@ -267,16 +272,18 @@ public void Compile_ShouldFail_WithInvalidGrouping( CompilerType compiler )
267272 Console . WriteLine ( ex . Message ) ;
268273 throw ;
269274 }
275+ } ) ;
270276 }
271277
272- [ DataTestMethod ]
278+ [ TestMethod ]
273279 [ DataRow ( CompilerType . Fast ) ]
274280 [ DataRow ( CompilerType . System ) ]
275281 [ DataRow ( CompilerType . Interpret ) ]
276- [ ExpectedException ( typeof ( SyntaxException ) ) ]
277282 public void Compile_ShouldFail_WithMissingRight ( CompilerType compiler )
278283 {
279- try
284+ Assert . ThrowsExactly < SyntaxException > ( ( ) =>
285+ {
286+ try
280287 {
281288 Xs . Parse ( "5 +;" ) ;
282289 }
@@ -285,5 +292,6 @@ public void Compile_ShouldFail_WithMissingRight( CompilerType compiler )
285292 Console . WriteLine ( ex . Message ) ;
286293 throw ;
287294 }
295+ } ) ;
288296 }
289297}
0 commit comments