@@ -221,251 +221,6 @@ public async Task ValidateAsync_WorkflowValid_Returns204()
221221 Assert . Equal ( 204 , objectResult . StatusCode ) ;
222222 }
223223
224- [ Fact ]
225- public async Task ValidateAsync_ValidWorkflowWithClinicalReview_Returns204 ( )
226- {
227- var newWorkflow = new Workflow ( )
228- {
229- Name = "Basic workflow" ,
230- Description = "Basic workflow update" ,
231- Version = "1" ,
232- Tasks = new TaskObject [ ]
233- {
234- new TaskObject
235- {
236- Id = "argo-task" ,
237- Type = "argo" ,
238- Description = "Argo task" ,
239- Args = new Dictionary < string , string > {
240- { "workflow_template_name" , "Workflow Name" } ,
241- } ,
242- Artifacts = new ArtifactMap ( )
243- {
244- Input = new Artifact [ ]
245- {
246- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
247- } ,
248- Output = new Artifact [ ]
249- {
250- new Artifact { Name = "Argo2" }
251- }
252- } ,
253- TaskDestinations = new TaskDestination [ ] {
254- new TaskDestination
255- {
256- Name = "clinical-review"
257- }
258- }
259- } ,
260- new TaskObject
261- {
262- Id = "clinical-review" ,
263- Type = "aide_clinical_review" ,
264- Description = "Basic Workflow update Task update" ,
265- Args = new Dictionary < string , string >
266- {
267- { "workflow_name" , "test" } ,
268- { "reviewed_task_id" , "argo-task" } ,
269- { "application_name" , "test" } ,
270- { "application_version" , "1.1" } ,
271- { "mode" , "QA" } ,
272- { "notifications" , "true" }
273- } ,
274- Artifacts = new ArtifactMap ( )
275- {
276- Input = new Artifact [ ]
277- {
278- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
279- } ,
280- Output = new Artifact [ ] { }
281- } ,
282- TaskDestinations = new TaskDestination [ ] { }
283- }
284- } ,
285- InformaticsGateway = new InformaticsGateway ( )
286- {
287- AeTitle = "Update" ,
288- DataOrigins = new string [ ] { "test" } ,
289- ExportDestinations = new string [ ] { "test" }
290- }
291- } ;
292-
293- var request = new WorkflowUpdateRequest ( ) ;
294- request . Workflow = newWorkflow ;
295- request . OriginalWorkflowName = newWorkflow . Name + "1" ;
296-
297- var result = await WorkflowsController . ValidateAsync ( request ) ;
298-
299- var objectResult = Assert . IsType < StatusCodeResult > ( result ) ;
300-
301- Assert . Equal ( 204 , objectResult . StatusCode ) ;
302- }
303-
304- [ Fact ]
305- public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewMissingNotifications_ReturnsBadRequest ( )
306- {
307- var newWorkflow = new Workflow ( )
308- {
309- Name = "Basic workflow" ,
310- Description = "Basic workflow update" ,
311- Version = "1" ,
312- Tasks = new TaskObject [ ]
313- {
314- new TaskObject
315- {
316- Id = "argo-task" ,
317- Type = "argo" ,
318- Description = "Argo task" ,
319- Args = new Dictionary < string , string > {
320- { "workflow_template_name" , "Workflow Name" } ,
321- } ,
322- Artifacts = new ArtifactMap ( )
323- {
324- Input = new Artifact [ ]
325- {
326- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
327- } ,
328- Output = new Artifact [ ]
329- {
330- new Artifact { Name = "Argo2" }
331- }
332- } ,
333- TaskDestinations = new TaskDestination [ ] {
334- new TaskDestination
335- {
336- Name = "clinical-review"
337- }
338- }
339- } ,
340- new TaskObject
341- {
342- Id = "clinical-review" ,
343- Type = "aide_clinical_review" ,
344- Description = "Basic Workflow update Task update" ,
345- Args = new Dictionary < string , string >
346- {
347- { "workflow_name" , "test" } ,
348- { "reviewed_task_id" , "argo-task" } ,
349- { "application_name" , "test" } ,
350- { "application_version" , "1.1" } ,
351- { "mode" , "QA" } ,
352- } ,
353- Artifacts = new ArtifactMap ( )
354- {
355- Input = new Artifact [ ]
356- {
357- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
358- } ,
359- Output = new Artifact [ ] { }
360- } ,
361- TaskDestinations = new TaskDestination [ ] { }
362- }
363- } ,
364- InformaticsGateway = new InformaticsGateway ( )
365- {
366- AeTitle = "Update" ,
367- DataOrigins = new string [ ] { "test" } ,
368- ExportDestinations = new string [ ] { "test" }
369- }
370- } ;
371-
372- var request = new WorkflowUpdateRequest ( ) ;
373- request . Workflow = newWorkflow ;
374- request . OriginalWorkflowName = newWorkflow . Name + "1" ;
375-
376- var result = await WorkflowsController . ValidateAsync ( request ) ;
377-
378- var objectResult = Assert . IsType < ObjectResult > ( result ) ;
379-
380- Assert . Equal ( 400 , objectResult . StatusCode ) ;
381-
382- const string expectedInstance = "/workflows" ;
383- Assert . StartsWith ( expectedInstance , ( ( ProblemDetails ) objectResult . Value ) . Instance ) ;
384- }
385-
386- [ Fact ]
387- public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewInvalidNotifications_ReturnsBadRequest ( )
388- {
389- var newWorkflow = new Workflow ( )
390- {
391- Name = "Basic workflow" ,
392- Description = "Basic workflow update" ,
393- Version = "1" ,
394- Tasks = new TaskObject [ ]
395- {
396- new TaskObject
397- {
398- Id = "argo-task" ,
399- Type = "argo" ,
400- Description = "Argo task" ,
401- Args = new Dictionary < string , string > {
402- { "workflow_template_name" , "Workflow Name" } ,
403- } ,
404- Artifacts = new ArtifactMap ( )
405- {
406- Input = new Artifact [ ]
407- {
408- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
409- } ,
410- Output = new Artifact [ ]
411- {
412- new Artifact { Name = "Argo2" }
413- }
414- } ,
415- TaskDestinations = new TaskDestination [ ] {
416- new TaskDestination
417- {
418- Name = "clinical-review"
419- }
420- }
421- } ,
422- new TaskObject
423- {
424- Id = "clinical-review" ,
425- Type = "aide_clinical_review" ,
426- Description = "Basic Workflow update Task update" ,
427- Args = new Dictionary < string , string >
428- {
429- { "workflow_name" , "test" } ,
430- { "reviewed_task_id" , "argo-task" } ,
431- { "application_name" , "test" } ,
432- { "application_version" , "1.1" } ,
433- { "mode" , "QA" } ,
434- { "notifications" , "cat" }
435- } ,
436- Artifacts = new ArtifactMap ( )
437- {
438- Input = new Artifact [ ]
439- {
440- new Artifact { Name = "Dicom" , Value = "{{ context.input.dicom }}" } ,
441- } ,
442- Output = new Artifact [ ] { }
443- } ,
444- TaskDestinations = new TaskDestination [ ] { }
445- }
446- } ,
447- InformaticsGateway = new InformaticsGateway ( )
448- {
449- AeTitle = "Update" ,
450- DataOrigins = new string [ ] { "test" } ,
451- ExportDestinations = new string [ ] { "test" }
452- }
453- } ;
454-
455- var request = new WorkflowUpdateRequest ( ) ;
456- request . Workflow = newWorkflow ;
457- request . OriginalWorkflowName = newWorkflow . Name + "1" ;
458-
459- var result = await WorkflowsController . ValidateAsync ( request ) ;
460-
461- var objectResult = Assert . IsType < ObjectResult > ( result ) ;
462-
463- Assert . Equal ( 400 , objectResult . StatusCode ) ;
464-
465- const string expectedInstance = "/workflows" ;
466- Assert . StartsWith ( expectedInstance , ( ( ProblemDetails ) objectResult . Value ) . Instance ) ;
467- }
468-
469224 [ Fact ]
470225 public async Task UpdateAsync_InvalidWorkflow_ReturnsBadRequest ( )
471226 {
0 commit comments