@@ -83,6 +83,16 @@ public void Correctly_parse_conditional_or_operator()
83
83
Assert . AreEqual ( "text => ((text == \" any\" ) || (text.Length == 3))" , actual ) ;
84
84
}
85
85
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
+
86
96
87
97
[ Test ]
88
98
public void Correctly_parse_conditional_and_operator ( )
@@ -95,15 +105,27 @@ public void Correctly_parse_conditional_and_operator()
95
105
}
96
106
97
107
[ Test ]
98
- public void Correctly_parse_two_conditional_or_operators ( )
108
+ public void Correctly_parse_logical_and_operator ( )
99
109
{
100
110
Expression < Func < string , bool > > func =
101
- text => text == "any" || text . Length == 3 || text . Length == 9 ;
111
+ text => text == "any" & text . Length == 3 ;
102
112
ExpressionInspector sut = new ExpressionInspector ( ) ;
103
113
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 ) ;
105
115
}
106
116
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
+
107
129
[ Test ]
108
130
public void Not_mistake_property_called_OrElse_for_conditional_or_operator ( )
109
131
{
0 commit comments