@@ -166,8 +166,6 @@ public async Task Cannot_create_resource_with_multiple_violations()
166
166
type = "systemDirectories" ,
167
167
attributes = new
168
168
{
169
- isCaseSensitive = false ,
170
- sizeInBytes = - 1
171
169
}
172
170
}
173
171
} ;
@@ -192,9 +190,9 @@ public async Task Cannot_create_resource_with_multiple_violations()
192
190
ErrorObject error2 = responseDocument . Errors [ 1 ] ;
193
191
error2 . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
194
192
error2 . Title . Should ( ) . Be ( "Input validation failed." ) ;
195
- error2 . Detail . Should ( ) . Be ( "The field SizeInBytes must be between 0 and 9223372036854775807 ." ) ;
193
+ error2 . Detail . Should ( ) . Be ( "The IsCaseSensitive field is required ." ) ;
196
194
error2 . Source . ShouldNotBeNull ( ) ;
197
- error2 . Source . Pointer . Should ( ) . Be ( "/data/attributes/sizeInBytes " ) ;
195
+ error2 . Source . Pointer . Should ( ) . Be ( "/data/attributes/isCaseSensitive " ) ;
198
196
}
199
197
200
198
[ Fact ]
@@ -205,15 +203,14 @@ public async Task Does_not_exceed_MaxModelValidationErrors()
205
203
{
206
204
data = new
207
205
{
208
- type = "systemDirectories " ,
206
+ type = "systemFiles " ,
209
207
attributes = new
210
208
{
211
- sizeInBytes = - 1
212
209
}
213
210
}
214
211
} ;
215
212
216
- const string route = "/systemDirectories " ;
213
+ const string route = "/systemFiles " ;
217
214
218
215
// Act
219
216
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecutePostAsync < Document > ( route , requestBody ) ;
@@ -232,16 +229,16 @@ public async Task Does_not_exceed_MaxModelValidationErrors()
232
229
ErrorObject error2 = responseDocument . Errors [ 1 ] ;
233
230
error2 . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
234
231
error2 . Title . Should ( ) . Be ( "Input validation failed." ) ;
235
- error2 . Detail . Should ( ) . Be ( "The Name field is required." ) ;
232
+ error2 . Detail . Should ( ) . Be ( "The FileName field is required." ) ;
236
233
error2 . Source . ShouldNotBeNull ( ) ;
237
- error2 . Source . Pointer . Should ( ) . Be ( "/data/attributes/directoryName " ) ;
234
+ error2 . Source . Pointer . Should ( ) . Be ( "/data/attributes/fileName " ) ;
238
235
239
236
ErrorObject error3 = responseDocument . Errors [ 2 ] ;
240
237
error3 . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
241
238
error3 . Title . Should ( ) . Be ( "Input validation failed." ) ;
242
- error3 . Detail . Should ( ) . Be ( "The IsCaseSensitive field is required." ) ;
239
+ error3 . Detail . Should ( ) . Be ( "The Attributes field is required." ) ;
243
240
error3 . Source . ShouldNotBeNull ( ) ;
244
- error3 . Source . Pointer . Should ( ) . Be ( "/data/attributes/isCaseSensitive " ) ;
241
+ error3 . Source . Pointer . Should ( ) . Be ( "/data/attributes/attributes " ) ;
245
242
}
246
243
247
244
[ Fact ]
@@ -360,30 +357,30 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
360
357
public async Task Can_update_resource_with_omitted_required_attribute_value ( )
361
358
{
362
359
// Arrange
363
- SystemDirectory existingDirectory = _fakers . SystemDirectory . Generate ( ) ;
360
+ SystemFile existingFile = _fakers . SystemFile . Generate ( ) ;
364
361
365
- long newSizeInBytes = _fakers . SystemDirectory . Generate ( ) . SizeInBytes ;
362
+ long ? newSizeInBytes = _fakers . SystemFile . Generate ( ) . SizeInBytes ;
366
363
367
364
await _testContext . RunOnDatabaseAsync ( async dbContext =>
368
365
{
369
- dbContext . Directories . Add ( existingDirectory ) ;
366
+ dbContext . Files . Add ( existingFile ) ;
370
367
await dbContext . SaveChangesAsync ( ) ;
371
368
} ) ;
372
369
373
370
var requestBody = new
374
371
{
375
372
data = new
376
373
{
377
- type = "systemDirectories " ,
378
- id = existingDirectory . StringId ,
374
+ type = "systemFiles " ,
375
+ id = existingFile . StringId ,
379
376
attributes = new
380
377
{
381
378
sizeInBytes = newSizeInBytes
382
379
}
383
380
}
384
381
} ;
385
382
386
- string route = $ "/systemDirectories/ { existingDirectory . StringId } ";
383
+ string route = $ "/systemFiles/ { existingFile . StringId } ";
387
384
388
385
// Act
389
386
( HttpResponseMessage httpResponse , string responseDocument ) = await _testContext . ExecutePatchAsync < string > ( route , requestBody ) ;
0 commit comments