Skip to content

Commit 3c6e4cc

Browse files
committed
Support for parsing null coalescing operator.
1 parent 1bfb9a3 commit 3c6e4cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

TestStack.FluentMVCTesting.Tests/Internal/ExpressionInspectorTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ public void Correctly_parse_logical_or_operator()
125125
Assert.AreEqual("text => ((text == \"any\") | (text.Length == 3))", actual);
126126
}
127127

128+
[Test]
129+
public void Correctly_parse_null_coalescing_operator()
130+
{
131+
Expression<Func<string, bool>> func =
132+
text => text == ("" ?? "a");
133+
ExpressionInspector sut = new ExpressionInspector();
134+
var actual = sut.Inspect(func);
135+
Assert.AreEqual("text => (text == (\"\" ?? \"a\"))", actual);
136+
}
128137

129138
[Test]
130139
public void Not_mistake_property_called_OrElse_for_conditional_or_operator()

0 commit comments

Comments
 (0)