@@ -137,7 +137,8 @@ public async Task Search_SearchFileWith_From_To_Success()
137
137
{
138
138
// Arrange
139
139
DateTimeOffset dateTimeFrom = DateTime . Now . AddMinutes ( - 2 ) ;
140
- var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
140
+ var file = FileInitializeExtTestFactory . BasicFile ( ) ;
141
+ var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , file ) ;
141
142
Assert . True ( initializeFileResponse . IsSuccessStatusCode , await initializeFileResponse . Content . ReadAsStringAsync ( ) ) ;
142
143
DateTimeOffset dateTimeTo = DateTime . Now . AddMinutes ( 2 ) ;
143
144
var fileId = await initializeFileResponse . Content . ReadAsStringAsync ( ) ;
@@ -153,7 +154,7 @@ public async Task Search_SearchFileWith_From_To_Success()
153
154
var uploadedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
154
155
155
156
// Act
156
- var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } ") ;
157
+ var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?resourceId= { file . ResourceId } & from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } ") ;
157
158
string contentstring = await searchResult . Content . ReadAsStringAsync ( ) ;
158
159
159
160
// Assert
@@ -166,7 +167,8 @@ public async Task Search_SearchFileWith_From_To_Status_Success()
166
167
// Arrange
167
168
string status = "Published" ;
168
169
DateTimeOffset dateTimeFrom = DateTime . Now . AddMinutes ( - 2 ) ;
169
- var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
170
+ var file = FileInitializeExtTestFactory . BasicFile ( ) ;
171
+ var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , file ) ;
170
172
Assert . True ( initializeFileResponse . IsSuccessStatusCode , await initializeFileResponse . Content . ReadAsStringAsync ( ) ) ;
171
173
DateTimeOffset dateTimeTo = DateTime . Now . AddMinutes ( 2 ) ;
172
174
var fileId = await initializeFileResponse . Content . ReadAsStringAsync ( ) ;
@@ -182,7 +184,7 @@ public async Task Search_SearchFileWith_From_To_Status_Success()
182
184
var uploadedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
183
185
184
186
// Act
185
- var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
187
+ var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?resourceId= { file . ResourceId } & from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
186
188
string contentstring = await searchResult . Content . ReadAsStringAsync ( ) ;
187
189
188
190
// Assert
@@ -195,7 +197,8 @@ public async Task Search_SearchFileWith_From_Status_Success()
195
197
// Arrange
196
198
string status = "Published" ;
197
199
DateTimeOffset dateTimeFrom = DateTime . Now . AddMinutes ( - 2 ) ;
198
- var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
200
+ var file = FileInitializeExtTestFactory . BasicFile ( ) ;
201
+ var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , file ) ;
199
202
Assert . True ( initializeFileResponse . IsSuccessStatusCode , await initializeFileResponse . Content . ReadAsStringAsync ( ) ) ;
200
203
DateTimeOffset dateTimeTo = DateTime . Now . AddMinutes ( 2 ) ;
201
204
var fileId = await initializeFileResponse . Content . ReadAsStringAsync ( ) ;
@@ -211,7 +214,7 @@ public async Task Search_SearchFileWith_From_Status_Success()
211
214
var uploadedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
212
215
213
216
// Act
214
- var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
217
+ var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?resourceId= { file . ResourceId } & from={ dateTimeFrom . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
215
218
string contentstring = await searchResult . Content . ReadAsStringAsync ( ) ;
216
219
217
220
// Assert
@@ -224,7 +227,8 @@ public async Task Search_SearchFileWith_To_Status_Success()
224
227
// Arrange
225
228
string status = "Published" ;
226
229
DateTimeOffset dateTimeFrom = DateTime . Now . AddMinutes ( - 2 ) ;
227
- var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
230
+ var file = FileInitializeExtTestFactory . BasicFile ( ) ;
231
+ var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , file ) ;
228
232
Assert . True ( initializeFileResponse . IsSuccessStatusCode , await initializeFileResponse . Content . ReadAsStringAsync ( ) ) ;
229
233
DateTimeOffset dateTimeTo = DateTime . Now . AddMinutes ( 2 ) ;
230
234
var fileId = await initializeFileResponse . Content . ReadAsStringAsync ( ) ;
@@ -240,7 +244,7 @@ public async Task Search_SearchFileWith_To_Status_Success()
240
244
var uploadedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
241
245
242
246
// Act
243
- var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
247
+ var searchResult = await _senderClient . GetAsync ( $ "broker/api/v1/file?resourceId= { file . ResourceId } & to={ dateTimeTo . ToString ( "yyyy-MM-dd HH:mm:ss" , CultureInfo . InvariantCulture . DateTimeFormat ) } &status={ status } ") ;
244
248
string contentstring = await searchResult . Content . ReadAsStringAsync ( ) ;
245
249
246
250
// Assert
@@ -253,7 +257,8 @@ public async Task Search_SearchFileWith_RecipientStatus_Success()
253
257
// Arrange
254
258
string status = "Published" ;
255
259
string recipientStatus = "Initialized" ;
256
- var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
260
+ var file = FileInitializeExtTestFactory . BasicFile ( ) ;
261
+ var initializeFileResponse = await _senderClient . PostAsJsonAsync ( "broker/api/v1/file" , file ) ;
257
262
var fileId = await initializeFileResponse . Content . ReadAsStringAsync ( ) ;
258
263
var initializedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
259
264
Assert . NotNull ( initializedFile ) ;
@@ -267,7 +272,7 @@ public async Task Search_SearchFileWith_RecipientStatus_Success()
267
272
var uploadedFile = await _senderClient . GetFromJsonAsync < FileOverviewExt > ( $ "broker/api/v1/file/{ fileId } ", _responseSerializerOptions ) ;
268
273
269
274
// Act
270
- var searchResult = await _recipientClient . GetAsync ( $ "broker/api/v1/file?status={ status } &recipientStatus={ recipientStatus } ") ;
275
+ var searchResult = await _recipientClient . GetAsync ( $ "broker/api/v1/file?resourceId= { file . ResourceId } & status={ status } &recipientStatus={ recipientStatus } ") ;
271
276
string contentstring = await searchResult . Content . ReadAsStringAsync ( ) ;
272
277
273
278
// Assert
@@ -304,12 +309,12 @@ public async Task Search_SearchFileWith_RecipientStatus_NotFound()
304
309
}
305
310
306
311
[ Fact ]
307
- public async Task SendFile_UsingUnregisteredService_Fails ( )
312
+ public async Task SendFile_UsingUnregisteredUser_Fails ( )
308
313
{
309
314
var initializeFileResponse = await _unregisteredClient . PostAsJsonAsync ( "broker/api/v1/file" , FileInitializeExtTestFactory . BasicFile ( ) ) ;
310
315
Assert . False ( initializeFileResponse . IsSuccessStatusCode ) ;
311
316
var parsedError = await initializeFileResponse . Content . ReadFromJsonAsync < ProblemDetails > ( ) ;
312
317
Assert . NotNull ( parsedError ) ;
313
- Assert . Equal ( Errors . ServiceNotConfigured . Message , parsedError . Detail ) ;
318
+ Assert . Equal ( Errors . NoAccessToResource . Message , parsedError . Detail ) ;
314
319
}
315
320
}
0 commit comments