File tree Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,11 @@ public async Task<ActionResult<string>> Create(DestinationApplicationEntity item
161
161
}
162
162
catch ( ObjectExistsException ex )
163
163
{
164
- return Problem ( title : "DICOM destination already exists" , statusCode : ( int ) System . Net . HttpStatusCode . Conflict , detail : ex . Message ) ;
164
+ return Problem ( title : "DICOM destination already exists" , statusCode : StatusCodes . Status409Conflict , detail : ex . Message ) ;
165
165
}
166
166
catch ( ConfigurationException ex )
167
167
{
168
- return Problem ( title : "Validation error" , statusCode : ( int ) System . Net . HttpStatusCode . BadRequest , detail : ex . Message ) ;
168
+ return Problem ( title : "Validation error" , statusCode : StatusCodes . Status400BadRequest , detail : ex . Message ) ;
169
169
}
170
170
catch ( Exception ex )
171
171
{
Original file line number Diff line number Diff line change 41
41
42
42
namespace Monai . Deploy . InformaticsGateway . Test . Services . Export
43
43
{
44
- public class ScuExportServiceTest : IClassFixture < DicomScpFixture >
44
+ public class ScuExportServiceTest : IClassFixture < DicomScpFixture > , IDisposable
45
45
{
46
46
private readonly Mock < IStorageService > _storageService ;
47
47
private readonly Mock < IMessageBrokerSubscriberService > _messageSubscriberService ;
@@ -56,6 +56,7 @@ public class ScuExportServiceTest : IClassFixture<DicomScpFixture>
56
56
private readonly CancellationTokenSource _cancellationTokenSource ;
57
57
private readonly DicomScpFixture _dicomScp ;
58
58
private readonly int _port = 11104 ;
59
+ private bool _disposedValue ;
59
60
60
61
public ScuExportServiceTest ( DicomScpFixture dicomScp )
61
62
{
@@ -521,5 +522,25 @@ private async Task StopAndVerify(ScuExportService service)
521
522
_logger . VerifyLogging ( $ "{ service . ServiceName } is stopping.", LogLevel . Information , Times . Once ( ) ) ;
522
523
Thread . Sleep ( 500 ) ;
523
524
}
525
+
526
+ protected virtual void Dispose ( bool disposing )
527
+ {
528
+ if ( ! _disposedValue )
529
+ {
530
+ if ( disposing )
531
+ {
532
+ _dicomScp . Dispose ( ) ;
533
+ }
534
+
535
+ _disposedValue = true ;
536
+ }
537
+ }
538
+
539
+ public void Dispose ( )
540
+ {
541
+ // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
542
+ Dispose ( disposing : true ) ;
543
+ GC . SuppressFinalize ( this ) ;
544
+ }
524
545
}
525
546
}
Original file line number Diff line number Diff line change 30
30
31
31
namespace Monai . Deploy . InformaticsGateway . Test . Services . Scu
32
32
{
33
- public class ScuServiceTest : IClassFixture < DicomScpFixture >
33
+ public class ScuServiceTest : IClassFixture < DicomScpFixture > , IDisposable
34
34
{
35
35
private readonly DicomScpFixture _dicomScp ;
36
- private readonly int _port = 11104 ;
36
+ private readonly int _port = 11105 ;
37
37
38
38
private readonly Mock < IServiceScopeFactory > _serviceScopeFactory ;
39
39
private readonly Mock < ILogger < ScuService > > _logger ;
@@ -44,6 +44,7 @@ public class ScuServiceTest : IClassFixture<DicomScpFixture>
44
44
private readonly CancellationTokenSource _cancellationTokenSource ;
45
45
private readonly ServiceProvider _serviceProvider ;
46
46
private readonly Mock < IServiceScope > _serviceScope ;
47
+ private bool _disposedValue ;
47
48
48
49
public ScuServiceTest ( DicomScpFixture dicomScp )
49
50
{
@@ -154,5 +155,25 @@ public async Task GivenACEchoRequest_WhenRemoteServerIsUnreachable_ReturnStatusA
154
155
Assert . Equal ( ResponseError . Unhandled , response . Error ) ;
155
156
Assert . StartsWith ( "One or more error" , response . Message ) ;
156
157
}
158
+
159
+ protected virtual void Dispose ( bool disposing )
160
+ {
161
+ if ( ! _disposedValue )
162
+ {
163
+ if ( disposing )
164
+ {
165
+ _dicomScp . Dispose ( ) ;
166
+ }
167
+
168
+ _disposedValue = true ;
169
+ }
170
+ }
171
+
172
+ public void Dispose ( )
173
+ {
174
+ // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
175
+ Dispose ( disposing : true ) ;
176
+ GC . SuppressFinalize ( this ) ;
177
+ }
157
178
}
158
179
}
You can’t perform that action at this time.
0 commit comments