Skip to content

Commit 3e4641d

Browse files
committed
Add test for PR #106
1 parent 1cded3a commit 3e4641d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,25 @@ void Evaluator_PreEvaluateVariable(object sender, VariablePreEvaluationEventArg
19391939
.SetCategory("On the fly var")
19401940
.SetCategory("Static Onthefly");
19411941

1942+
// MR #106
1943+
ExpressionEvaluator nullForceevaluator = new ExpressionEvaluator();
1944+
nullForceevaluator.Variables = new Dictionary<string, object>()
1945+
{
1946+
{ "obj", new { }}
1947+
};
1948+
1949+
nullForceevaluator.EvaluateVariable += (sender, e) =>
1950+
{
1951+
e.HasValue = true;
1952+
e.Value = null;
1953+
};
1954+
1955+
yield return new TestCaseData(nullForceevaluator
1956+
, "obj.x"
1957+
, null)
1958+
.Returns(null)
1959+
.SetCategory("On the fly var");
1960+
19421961
#endregion
19431962

19441963
#region With Context object

0 commit comments

Comments
 (0)