@@ -68,6 +68,9 @@ public void Test_ReadOnlyMemory2DT_Array1DConstructor()
6868 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , - 10 , 1 , 1 ) ) ;
6969 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 1 , 1 , - 1 ) ) ;
7070 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 1 , - 100 , 1 ) ) ;
71+ Assert . ThrowsException < ArgumentException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 2 , 4 , 0 ) ) ;
72+ Assert . ThrowsException < ArgumentException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 3 , 3 , 0 ) ) ;
73+ Assert . ThrowsException < ArgumentException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 2 , 3 , 0 ) ) ;
7174 Assert . ThrowsException < ArgumentException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 10 , 1 , 120 ) ) ;
7275 }
7376
@@ -144,6 +147,7 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_1()
144147
145148 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , - 1 ) ) ;
146149 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 20 ) ) ;
150+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 2 ) ) ;
147151 }
148152
149153 [ TestCategory ( "ReadOnlyMemory2DT" ) ]
@@ -176,6 +180,10 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_2()
176180 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 1 , - 1 , 1 , 1 ) ) ;
177181 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 1 , 1 , - 1 , 1 ) ) ;
178182 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 1 , 1 , 1 , - 1 ) ) ;
183+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 2 , 0 , 0 , 2 , 3 ) ) ;
184+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 0 , 1 , 2 , 3 ) ) ;
185+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 0 , 0 , 2 , 4 ) ) ;
186+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 0 , 0 , 3 , 3 ) ) ;
179187 }
180188
181189#if ! WINDOWS_UWP
@@ -201,6 +209,9 @@ public void Test_ReadOnlyMemory2DT_ReadOnlyMemoryConstructor()
201209 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => memory . AsMemory2D ( 0 , - 10 , 1 , 1 ) ) ;
202210 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => memory . AsMemory2D ( 0 , 1 , 1 , - 1 ) ) ;
203211 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => memory . AsMemory2D ( 0 , 1 , - 100 , 1 ) ) ;
212+ Assert . ThrowsException < ArgumentException > ( ( ) => memory . AsMemory2D ( 0 , 2 , 4 , 0 ) ) ;
213+ Assert . ThrowsException < ArgumentException > ( ( ) => memory . AsMemory2D ( 0 , 3 , 3 , 0 ) ) ;
214+ Assert . ThrowsException < ArgumentException > ( ( ) => memory . AsMemory2D ( 1 , 2 , 3 , 0 ) ) ;
204215 Assert . ThrowsException < ArgumentException > ( ( ) => memory . AsMemory2D ( 0 , 10 , 1 , 120 ) ) ;
205216 }
206217#endif
@@ -241,6 +252,10 @@ public void Test_ReadOnlyMemory2DT_Slice_1()
241252 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 10 , 1 , 1 , 1 ) ) ;
242253 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 1 , 12 , 1 , 12 ) ) ;
243254 Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 1 , 1 , 55 , 1 ) ) ;
255+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 0 , 0 , 2 , 4 ) ) ;
256+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 0 , 0 , 3 , 3 ) ) ;
257+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 0 , 1 , 2 , 3 ) ) ;
258+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 1 , 0 , 2 , 3 ) ) ;
244259 }
245260
246261 [ TestCategory ( "ReadOnlyMemory2DT" ) ]
0 commit comments