@@ -154,17 +154,45 @@ public static IEnumerable<T> AssertContains<T>(this IEnumerable<T> collection, T
154
154
return collection ;
155
155
}
156
156
157
+ [ DebuggerHidden ]
158
+ public static IList < T > AssertContains < T > ( this IList < T > collection , T item , string argumentName = "" , string message = DefaultMessage )
159
+ {
160
+ ( ( IEnumerable < T > ) collection ) . AssertContains ( item , argumentName , message ) ;
161
+ return collection ;
162
+ }
163
+
164
+ [ DebuggerHidden ]
165
+ public static List < T > AssertContains < T > ( this List < T > collection , T item , string argumentName = "" , string message = DefaultMessage )
166
+ {
167
+ ( ( IEnumerable < T > ) collection ) . AssertContains ( item , argumentName , message ) ;
168
+ return collection ;
169
+ }
170
+
157
171
[ DebuggerHidden ]
158
172
public static IEnumerable < T > AssertIsNotNullOrEmpty < T > ( this IEnumerable < T > collection , string argumentName = "" , string message = DefaultMessage )
159
173
{
160
174
collection . AssertIsNotNull ( argumentName ) ;
161
- if ( collection . Any ( ) )
175
+ if ( ! collection . Any ( ) )
162
176
{
163
177
throw new InvalidOperationException ( message == DefaultMessage ? argumentName + " collection have to contain any child" : message ) ;
164
178
}
165
179
return collection ;
166
180
}
167
181
182
+ [ DebuggerHidden ]
183
+ public static IList < T > AssertIsNotNullOrEmpty < T > ( this IList < T > collection , string argumentName = "" , string message = DefaultMessage )
184
+ {
185
+ ( ( IEnumerable < T > ) collection ) . AssertIsNotNullOrEmpty ( argumentName , message ) ;
186
+ return collection ;
187
+ }
188
+
189
+ [ DebuggerHidden ]
190
+ public static List < T > AssertIsNotNullOrEmpty < T > ( this List < T > collection , string argumentName = "" , string message = DefaultMessage )
191
+ {
192
+ ( ( IEnumerable < T > ) collection ) . AssertIsNotNullOrEmpty ( argumentName , message ) ;
193
+ return collection ;
194
+ }
195
+
168
196
[ DebuggerHidden ]
169
197
public static T AssertIs < T > ( this T self , T expected , string argumentName = "" , string message = DefaultMessage )
170
198
{
0 commit comments