Skip to content

Commit 3b2cfa0

Browse files
authored
Update ExpressionEvaluatorTests.cs
1 parent 85d94be commit 3b2cfa0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ExpressionEvaluatorTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void TypeTesting(string expression, Type type)
352352
[TestCase("6 % 3", TestOf = typeof(int), ExpectedResult = 0, Category = "SimpleModulo")]
353353
#endregion
354354

355-
#region BooleanTestsOperators
355+
#region Boolean Tests Operators
356356
[TestCase("1 < 5", TestOf = typeof(bool), ExpectedResult = true, Category = "LowerThanBooleanOperator")]
357357
[TestCase("5 < 5", TestOf = typeof(bool), ExpectedResult = false, Category = "LowerThanBooleanOperator")]
358358
[TestCase("7 < 5", TestOf = typeof(bool), ExpectedResult = false, Category = "LowerThanBooleanOperator")]
@@ -679,7 +679,9 @@ public void TypeTesting(string expression, Type type)
679679
#endregion
680680

681681
#region new Function
682-
// TODO Tests For new Function
682+
[TestCase("New(ClassForTest1).GetType()", ExpectedResult = typeof(ClassForTest1), Category = "Standard Functions,New Function")]
683+
[TestCase("New(ClassForTest2, 15).GetType()", ExpectedResult = typeof(ClassForTest2), Category = "Standard Functions,New Function")]
684+
[TestCase("New(ClassForTest2, 15).Value1", ExpectedResult = 15, Category = "Standard Functions,New Function")]
683685
#endregion
684686

685687
#region Pow Function
@@ -789,6 +791,8 @@ public object DirectExpressionEvaluation(string expression)
789791
{
790792
ExpressionEvaluator evaluator = new ExpressionEvaluator();
791793

794+
evaluator.Namespaces.Add("WpfMvvmFw.Utils.Tests");
795+
792796
return evaluator.Evaluate(expression);
793797
}
794798

0 commit comments

Comments
 (0)