File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
TestStack.FluentMVCTesting.Tests/Internal Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,24 @@ public void Correctly_parse_equality_comparison_with_int_operands()
2626 Assert . AreEqual ( "number => number == 5" , actual ) ;
2727 }
2828
29+ [ Test ]
30+ public void Correctly_parse_equality_comparison_with_property_operand ( )
31+ {
32+ Expression < Func < PostViewModel , bool > > func = post => post . Title == "A" ;
33+ ExpressionInspector sut = new ExpressionInspector ( ) ;
34+ var actual = sut . Inspect ( func ) ;
35+ Assert . AreEqual ( "post => post.Title == \" A\" " , actual ) ;
36+ }
37+
38+ [ Test ]
39+ public void Correctly_parse_equality_comparison_with_property_operands ( )
40+ {
41+ Expression < Func < PostViewModel , bool > > func = post => post . Title == post . Slug ;
42+ ExpressionInspector sut = new ExpressionInspector ( ) ;
43+ var actual = sut . Inspect ( func ) ;
44+ Assert . AreEqual ( "post => post.Title == post.Slug" , actual ) ;
45+ }
46+
2947 [ Test ]
3048 public void Correctly_parse_inequality_comparison ( )
3149 {
@@ -54,4 +72,10 @@ public void Correctly_parse_relational_comparison()
5472 Assert . AreEqual ( "number => number < 5" , actual ) ;
5573 }
5674 }
75+
76+ public class PostViewModel
77+ {
78+ public string Title { get ; set ; }
79+ public string Slug { get ; set ; }
80+ }
5781}
You can’t perform that action at this time.
0 commit comments