@@ -68,6 +68,9 @@ public void Test_ReadOnlyMemory2DT_Array1DConstructor()
68
68
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , - 10 , 1 , 1 ) ) ;
69
69
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 1 , 1 , - 1 ) ) ;
70
70
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 ) ) ;
71
74
Assert . ThrowsException < ArgumentException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 0 , 10 , 1 , 120 ) ) ;
72
75
}
73
76
@@ -144,6 +147,7 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_1()
144
147
145
148
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , - 1 ) ) ;
146
149
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 20 ) ) ;
150
+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 2 ) ) ;
147
151
}
148
152
149
153
[ TestCategory ( "ReadOnlyMemory2DT" ) ]
@@ -176,6 +180,10 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_2()
176
180
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 1 , - 1 , 1 , 1 ) ) ;
177
181
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array , 1 , 1 , 1 , - 1 , 1 ) ) ;
178
182
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 ) ) ;
179
187
}
180
188
181
189
#if ! WINDOWS_UWP
@@ -201,6 +209,9 @@ public void Test_ReadOnlyMemory2DT_ReadOnlyMemoryConstructor()
201
209
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => memory . AsMemory2D ( 0 , - 10 , 1 , 1 ) ) ;
202
210
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => memory . AsMemory2D ( 0 , 1 , 1 , - 1 ) ) ;
203
211
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 ) ) ;
204
215
Assert . ThrowsException < ArgumentException > ( ( ) => memory . AsMemory2D ( 0 , 10 , 1 , 120 ) ) ;
205
216
}
206
217
#endif
@@ -241,6 +252,10 @@ public void Test_ReadOnlyMemory2DT_Slice_1()
241
252
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 10 , 1 , 1 , 1 ) ) ;
242
253
Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => new ReadOnlyMemory2D < int > ( array ) . Slice ( 1 , 12 , 1 , 12 ) ) ;
243
254
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 ) ) ;
244
259
}
245
260
246
261
[ TestCategory ( "ReadOnlyMemory2DT" ) ]
0 commit comments