Skip to content

Commit 95cf4dd

Browse files
committed
Retry ScuService tests
Signed-off-by: Victor Chang <[email protected]>
1 parent 90c67a8 commit 95cf4dd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/InformaticsGateway/Test/Services/Scu/ScuServiceTest.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using Monai.Deploy.InformaticsGateway.Services.Scu;
2727
using Monai.Deploy.InformaticsGateway.SharedTest;
2828
using Moq;
29+
using xRetry;
2930
using Xunit;
3031

3132
namespace Monai.Deploy.InformaticsGateway.Test.Services.Scu
@@ -70,7 +71,7 @@ public ScuServiceTest(DicomScpFixture dicomScp)
7071
_dicomScp.Start(_port);
7172
}
7273

73-
[Fact]
74+
[RetryFact]
7475
public void GivenAScuService_WhenInitialized_ExpectParametersToBeValidated()
7576
{
7677
Assert.Throws<ArgumentNullException>(() => new ScuService(null, null, null));
@@ -79,7 +80,7 @@ public void GivenAScuService_WhenInitialized_ExpectParametersToBeValidated()
7980
_ = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);
8081
}
8182

82-
[Fact]
83+
[RetryFact]
8384
public void GivenAScuService_WhenStartAsyncIsCalled_ExpectServiceStatusToBeSet()
8485
{
8586
var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);
@@ -88,7 +89,7 @@ public void GivenAScuService_WhenStartAsyncIsCalled_ExpectServiceStatusToBeSet()
8889
Assert.Equal(ServiceStatus.Running, svc.Status);
8990
}
9091

91-
[Fact]
92+
[RetryFact]
9293
public async Task GivenAValidDicomEntity_WhenRequestToCEcho_ExpectToReturnSucess()
9394
{
9495
var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);
@@ -105,7 +106,7 @@ public async Task GivenAValidDicomEntity_WhenRequestToCEcho_ExpectToReturnSucess
105106
Assert.Empty(response.Message);
106107
}
107108

108-
[Fact]
109+
[RetryFact]
109110
public async Task GivenACEchoRequest_WhenRejected_ReturnStatusAssociationRejected()
110111
{
111112
var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);
@@ -122,7 +123,7 @@ public async Task GivenACEchoRequest_WhenRejected_ReturnStatusAssociationRejecte
122123
Assert.StartsWith("Association rejected", response.Message);
123124
}
124125

125-
[Fact]
126+
[RetryFact]
126127
public async Task GivenACEchoRequest_WhenAborted_ReturnStatusAssociationAborted()
127128
{
128129
var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);
@@ -139,7 +140,7 @@ public async Task GivenACEchoRequest_WhenAborted_ReturnStatusAssociationAborted(
139140
Assert.StartsWith("Association Abort", response.Message);
140141
}
141142

142-
[Fact]
143+
[RetryFact]
143144
public async Task GivenACEchoRequest_WhenRemoteServerIsUnreachable_ReturnStatusAssociationRejected()
144145
{
145146
var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);

0 commit comments

Comments
 (0)