@@ -83,6 +83,16 @@ public void Correctly_parse_conditional_or_operator()
8383 Assert . AreEqual ( "text => ((text == \" any\" ) || (text.Length == 3))" , actual ) ;
8484 }
8585
86+ [ Test ]
87+ public void Correctly_parse_two_conditional_or_operators ( )
88+ {
89+ Expression < Func < string , bool > > func =
90+ text => text == "any" || text . Length == 3 || text . Length == 9 ;
91+ ExpressionInspector sut = new ExpressionInspector ( ) ;
92+ var actual = sut . Inspect ( func ) ;
93+ Assert . AreEqual ( "text => (((text == \" any\" ) || (text.Length == 3)) || (text.Length == 9))" , actual ) ;
94+ }
95+
8696
8797 [ Test ]
8898 public void Correctly_parse_conditional_and_operator ( )
@@ -95,15 +105,27 @@ public void Correctly_parse_conditional_and_operator()
95105 }
96106
97107 [ Test ]
98- public void Correctly_parse_two_conditional_or_operators ( )
108+ public void Correctly_parse_logical_and_operator ( )
99109 {
100110 Expression < Func < string , bool > > func =
101- text => text == "any" || text . Length == 3 || text . Length == 9 ;
111+ text => text == "any" & text . Length == 3 ;
102112 ExpressionInspector sut = new ExpressionInspector ( ) ;
103113 var actual = sut . Inspect ( func ) ;
104- Assert . AreEqual ( "text => ((( text == \" any\" ) || (text.Length == 3)) || (text.Length == 9 ))" , actual ) ;
114+ Assert . AreEqual ( "text => ((text == \" any\" ) & (text.Length == 3))" , actual ) ;
105115 }
106116
117+
118+ [ Test ]
119+ public void Correctly_parse_logical_or_operator ( )
120+ {
121+ Expression < Func < string , bool > > func =
122+ text => text == "any" | text . Length == 3 ;
123+ ExpressionInspector sut = new ExpressionInspector ( ) ;
124+ var actual = sut . Inspect ( func ) ;
125+ Assert . AreEqual ( "text => ((text == \" any\" ) | (text.Length == 3))" , actual ) ;
126+ }
127+
128+
107129 [ Test ]
108130 public void Not_mistake_property_called_OrElse_for_conditional_or_operator ( )
109131 {
0 commit comments