Skip to content

Commit 18f018a

Browse files
committed
Added failing test.
1 parent f49642d commit 18f018a

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
@@ -82,6 +82,7 @@ public void Correctly_parse_conditional_or_operator()
8282
Assert.AreEqual("text => text == \"any\" || text.Length == 3", actual);
8383
}
8484

85+
[Test]
8586
public void Correctly_parse_two_conditional_or_operators()
8687
{
8788
Expression<Func<string, bool>> func =
@@ -100,6 +101,15 @@ public void Not_mistake_property_called_OrElse_for_conditional_or_operator()
100101
var actual = sut.Inspect(func);
101102
Assert.AreEqual("post => post.Title == \"\" || post.OrElse == \"\"", actual);
102103
}
104+
105+
[Test]
106+
public void Correctly_parse_expression_whose_source_text_contains_parentheses()
107+
{
108+
Expression<Func<PostViewModel, bool>> func = post => post.Title.Contains("");
109+
ExpressionInspector sut = new ExpressionInspector();
110+
var actual = sut.Inspect(func);
111+
Assert.AreEqual("post => post.Title.Contains(\"\")", actual);
112+
}
103113
}
104114

105115
public class PostViewModel

0 commit comments

Comments
 (0)