Skip to content

Commit 5fedb9d

Browse files
committed
Support for parsing equality operator with constant operand.
1 parent f6a35c5 commit 5fedb9d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

TestStack.FluentMVCTesting.Tests/Internal/ExpressionInspectorTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,15 @@ public void Correctly_parse_inequality_comparison_with_int_operands()
3434
var actual = sut.Inspect(func);
3535
Assert.AreEqual("number => number != 5", actual);
3636
}
37+
38+
[Test]
39+
public void Correctly_parse_equality_comparison_with_captured_constant_operand()
40+
{
41+
const int Number = 5;
42+
Expression<Func<int, bool>> func = number => number == Number;
43+
ExpressionInspector sut = new ExpressionInspector();
44+
var actual = sut.Inspect(func);
45+
Assert.AreEqual("number => number == " + Number, actual);
46+
}
3747
}
3848
}

0 commit comments

Comments
 (0)