@@ -14,7 +14,7 @@ public void Correctly_parse_equality_comparison_with_string_operands()
1414 Expression < Func < string , bool > > func = text => text == "any" ;
1515 ExpressionInspector sut = new ExpressionInspector ( ) ;
1616 var actual = sut . Inspect ( func ) ;
17- Assert . AreEqual ( "text => text == \" any\" " , actual ) ;
17+ Assert . AreEqual ( "text => ( text == \" any\" ) " , actual ) ;
1818 }
1919
2020 [ Test ]
@@ -23,7 +23,7 @@ public void Correctly_parse_equality_comparison_with_int_operands()
2323 Expression < Func < int , bool > > func = number => number == 5 ;
2424 ExpressionInspector sut = new ExpressionInspector ( ) ;
2525 var actual = sut . Inspect ( func ) ;
26- Assert . AreEqual ( "number => number == 5" , actual ) ;
26+ Assert . AreEqual ( "number => ( number == 5) " , actual ) ;
2727 }
2828
2929 [ Test ]
@@ -32,7 +32,7 @@ public void Correctly_parse_equality_comparison_with_property_operand()
3232 Expression < Func < PostViewModel , bool > > func = post => post . Title == "A" ;
3333 ExpressionInspector sut = new ExpressionInspector ( ) ;
3434 var actual = sut . Inspect ( func ) ;
35- Assert . AreEqual ( "post => post.Title == \" A\" " , actual ) ;
35+ Assert . AreEqual ( "post => ( post.Title == \" A\" ) " , actual ) ;
3636 }
3737
3838 [ Test ]
@@ -41,7 +41,7 @@ public void Correctly_parse_equality_comparison_with_property_operands()
4141 Expression < Func < PostViewModel , bool > > func = post => post . Title == post . Slug ;
4242 ExpressionInspector sut = new ExpressionInspector ( ) ;
4343 var actual = sut . Inspect ( func ) ;
44- Assert . AreEqual ( "post => post.Title == post.Slug" , actual ) ;
44+ Assert . AreEqual ( "post => ( post.Title == post.Slug) " , actual ) ;
4545 }
4646
4747 [ Test ]
@@ -50,7 +50,7 @@ public void Correctly_parse_inequality_comparison()
5050 Expression < Func < int , bool > > func = number => number != 5 ;
5151 ExpressionInspector sut = new ExpressionInspector ( ) ;
5252 var actual = sut . Inspect ( func ) ;
53- Assert . AreEqual ( "number => number != 5" , actual ) ;
53+ Assert . AreEqual ( "number => ( number != 5) " , actual ) ;
5454 }
5555
5656 [ Test ]
@@ -60,7 +60,8 @@ public void Correctly_parse_equality_comparison_with_captured_constant_operand()
6060 Expression < Func < int , bool > > func = number => number == Number ;
6161 ExpressionInspector sut = new ExpressionInspector ( ) ;
6262 var actual = sut . Inspect ( func ) ;
63- Assert . AreEqual ( "number => number == " + Number , actual ) ;
63+ Assert . AreEqual (
64+ string . Concat ( "number => (number == " , Number , ")" ) , actual ) ;
6465 }
6566
6667 [ Test ]
@@ -69,7 +70,7 @@ public void Correctly_parse_relational_comparison()
6970 Expression < Func < int , bool > > func = number => number < 5 ;
7071 ExpressionInspector sut = new ExpressionInspector ( ) ;
7172 var actual = sut . Inspect ( func ) ;
72- Assert . AreEqual ( "number => number < 5" , actual ) ;
73+ Assert . AreEqual ( "number => ( number < 5) " , actual ) ;
7374 }
7475
7576 [ Test ]
@@ -79,7 +80,7 @@ public void Correctly_parse_conditional_or_operator()
7980 text => text == "any" || text . Length == 3 ;
8081 ExpressionInspector sut = new ExpressionInspector ( ) ;
8182 var actual = sut . Inspect ( func ) ;
82- Assert . AreEqual ( "text => text == \" any\" || text.Length == 3" , actual ) ;
83+ Assert . AreEqual ( "text => (( text == \" any\" ) || ( text.Length == 3)) " , actual ) ;
8384 }
8485
8586 [ Test ]
@@ -89,7 +90,7 @@ public void Correctly_parse_two_conditional_or_operators()
8990 text => text == "any" || text . Length == 3 || text . Length == 9 ;
9091 ExpressionInspector sut = new ExpressionInspector ( ) ;
9192 var actual = sut . Inspect ( func ) ;
92- Assert . AreEqual ( "text => text == \" any\" || text.Length == 3 || text.Length == 9" , actual ) ;
93+ Assert . AreEqual ( "text => ((( text == \" any\" ) || ( text.Length == 3)) || ( text.Length == 9)) " , actual ) ;
9394 }
9495
9596 [ Test ]
@@ -99,7 +100,7 @@ public void Not_mistake_property_called_OrElse_for_conditional_or_operator()
99100 post => post . Title == "" || post . OrElse == "" ;
100101 ExpressionInspector sut = new ExpressionInspector ( ) ;
101102 var actual = sut . Inspect ( func ) ;
102- Assert . AreEqual ( "post => post.Title == \" \" || post.OrElse == \" \" " , actual ) ;
103+ Assert . AreEqual ( "post => (( post.Title == \" \" ) || ( post.OrElse == \" \" )) " , actual ) ;
103104 }
104105
105106 [ Test ]
0 commit comments