Skip to content

Commit eef9664

Browse files
authored
Update ExpressionEvaluatorTests.cs
1 parent a831abb commit eef9664

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

ExpressionEvaluatorTests.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,16 @@ public void TypeTesting(string expression, Type type)
409409
[TestCase("default(bool)", TestOf = typeof(bool), ExpectedResult = false, Category = "default values")]
410410
#endregion
411411

412+
#region typeof keyword
413+
[TestCase("typeof(int)", ExpectedResult = typeof(int), Category = "typeof keyword")]
414+
[TestCase("typeof(float)", ExpectedResult = typeof(float), Category = "typeof keyword")]
415+
[TestCase("typeof(string)", ExpectedResult = typeof(string), Category = "typeof keyword")]
416+
[TestCase("typeof(Regex)", ExpectedResult = typeof(Regex), Category = "typeof keyword")]
417+
[TestCase("typeof(string) == \"Hello\".GetType()", ExpectedResult = true, Category = "typeof keyword")]
418+
[TestCase("typeof(int) == 12.GetType()", ExpectedResult = true, Category = "typeof keyword")]
419+
[TestCase("typeof(string) == 12.GetType()", ExpectedResult = false, Category = "typeof keyword")]
420+
#endregion
421+
412422
#region Logical And Shift Operators
413423
[TestCase("2 & 8", TestOf = typeof(int), ExpectedResult = 0, Category = "LogicalAndOperator")]
414424
[TestCase("10 & 8", TestOf = typeof(int), ExpectedResult = 8, Category = "LogicalAndOperator")]
@@ -439,14 +449,14 @@ public void TypeTesting(string expression, Type type)
439449
[TestCase("Abs(-4) > 10 / 2 ? (true ? 6 : 3+2) : (false ? Abs(-18) : 100 / 2)", ExpectedResult = 50, Category = "Conditional Operator t ? x : y")]
440450
#endregion
441451

442-
#region C# Keywords
443-
[TestCase("typeof(int)", ExpectedResult = typeof(int), Category = "C# Keywords,typeof")]
444-
[TestCase("typeof(float)", ExpectedResult = typeof(float), Category = "C# Keywords,typeof")]
445-
[TestCase("typeof(string)", ExpectedResult = typeof(string), Category = "C# Keywords,typeof")]
446-
[TestCase("typeof(Regex)", ExpectedResult = typeof(Regex), Category = "C# Keywords,typeof")]
447-
[TestCase("typeof(string) == \"Hello\".GetType()", ExpectedResult = true, Category = "C# Keywords,typeof")]
448-
[TestCase("typeof(int) == 12.GetType()", ExpectedResult = true, Category = "C# Keywords,typeof")]
449-
[TestCase("typeof(string) == 12.GetType()", ExpectedResult = false, Category = "C# Keywords,typeof")]
452+
#region typeof
453+
[TestCase("typeof(int)", ExpectedResult = typeof(int), Category = "typeof")]
454+
[TestCase("typeof(float)", ExpectedResult = typeof(float), Category = "typeof")]
455+
[TestCase("typeof(string)", ExpectedResult = typeof(string), Category = "typeof")]
456+
[TestCase("typeof(Regex)", ExpectedResult = typeof(Regex), Category = "typeof")]
457+
[TestCase("typeof(string) == \"Hello\".GetType()", ExpectedResult = true, Category = "typeof")]
458+
[TestCase("typeof(int) == 12.GetType()", ExpectedResult = true, Category = "typeof")]
459+
[TestCase("typeof(string) == 12.GetType()", ExpectedResult = false, Category = "typeof")]
450460
#endregion
451461

452462
#region Math Constants

0 commit comments

Comments
 (0)