@@ -73,27 +73,39 @@ internal static bool RoughlyEqual<TLhs>(TLhs actual, object? expected)
7373 }
7474
7575 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
76- public static void ShouldEqualEnumerable < T , TRhs > ( this IEnumerable < T > actual , params TRhs ? [ ] expected )
76+ public static void ShouldEqualEnumerable < T , TRhs > ( this IEnumerable < T > ? actual , params TRhs ? [ ] expected )
7777 where TRhs : T
7878 {
7979 ShouldEqualEnumerableInternal ( actual , expected ) ;
8080 }
8181
8282 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
83- public static void ShouldEqualEnumerable < T > ( this IEnumerable < T > actual , params object ? [ ] expected )
83+ public static void ShouldEqualEnumerable < T > ( this IEnumerable < T > ? actual , params object ? [ ] expected )
8484 {
8585 ShouldEqualEnumerableInternal ( actual , expected ) ;
8686 }
8787
8888 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
89- public static void ShouldEqualEnumerable < TLhs , TRhs > ( this IEnumerable < TLhs > actual , IEnumerable < TRhs > expected )
89+ public static void ShouldEqualEnumerable < TLhs , TRhs > ( this IEnumerable < TLhs > ? actual , IEnumerable < TRhs > ? expected )
9090 {
9191 ShouldEqualEnumerableInternal ( actual , expected ) ;
9292 }
9393
9494 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
95- private static void ShouldEqualEnumerableInternal ( IEnumerable actual , IEnumerable expected )
95+ public static void ShouldEqualEnumerable < TLhs , TRhs > ( this IEnumerable < TLhs > ? actual , ReadOnlyMemorySlice < TRhs > ? expected )
9696 {
97+ ShouldEqualEnumerableInternal ( actual , expected ) ;
98+ }
99+
100+ [ MethodImpl ( MethodImplOptions . NoInlining ) ]
101+ private static void ShouldEqualEnumerableInternal ( IEnumerable ? actual , IEnumerable ? expected )
102+ {
103+ if ( actual == null && expected == null ) return ;
104+ if ( actual == null || expected == null )
105+ {
106+ throw new ShouldAssertException (
107+ new ExpectedActualShouldlyMessage ( expected , actual , null ) . ToString ( ) ) ;
108+ }
97109 var actualList = new List < object > ( ) ;
98110 foreach ( var item in actual )
99111 {
0 commit comments