Skip to content

Commit 45c4f06

Browse files
committed
gh-65 Fix unit test
Signed-off-by: Victor Chang <[email protected]>
1 parent 9f55f5f commit 45c4f06

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/InformaticsGateway/Test/Services/Scp/ScpServiceTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public ScpServiceTest()
5656
_loggerFactory.Setup(p => p.CreateLogger(It.IsAny<string>())).Returns(_logger.Object);
5757
_associationDataProvider.Setup(p => p.GetLogger(It.IsAny<string>())).Returns(_loggerInternal.Object);
5858
_associationDataProvider.Setup(p => p.Configuration).Returns(_configuration);
59+
_logger.Setup(p => p.IsEnabled(It.IsAny<LogLevel>())).Returns(true);
60+
_loggerInternal.Setup(p => p.IsEnabled(It.IsAny<LogLevel>())).Returns(true);
5961
}
6062

6163
[RetryFact(5, 250, DisplayName = "StartAsync - shall stop application if failed to start SCP listner")]
@@ -107,7 +109,7 @@ public async Task CEcho_ShallRejectCEchoRequests()
107109
Assert.Equal(DicomRejectSource.ServiceUser, exception.RejectSource);
108110
Assert.Equal(DicomRejectResult.Permanent, exception.RejectResult);
109111

110-
_loggerInternal.VerifyLogging($"Verification service is disabled: rejecting association", LogLevel.Warning, Times.Once());
112+
_loggerInternal.VerifyLogging($"Verification service is disabled: rejecting association.", LogLevel.Warning, Times.Once());
111113

112114
Assert.True(countdownEvent.Wait(1000));
113115
}
@@ -367,7 +369,7 @@ public async Task CStore_OnClientAbort()
367369

368370
await client.SendAsync(_cancellationTokenSource.Token, DicomClientCancellationMode.ImmediatelyAbortAssociation);
369371
Assert.True(countdownEvent.Wait(2000));
370-
_loggerInternal.VerifyLogging($"Aborted {DicomAbortSource.ServiceUser} with reason {DicomAbortReason.NotSpecified}", LogLevel.Warning, Times.Once());
372+
_loggerInternal.VerifyLogging($"Aborted {DicomAbortSource.ServiceUser} with reason {DicomAbortReason.NotSpecified}.", LogLevel.Warning, Times.Once());
371373
}
372374

373375
private ScpService CreateService()

src/InformaticsGateway/Test/Services/Storage/SpaceReclaimerServiceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task ShallHonorCancellationRequest()
6060
_logger.VerifyLogging("Space Reclaimer Service is stopping.", LogLevel.Information, Times.Once());
6161
}
6262

63-
[RetryFact(5, 250, DisplayName = "Shall delete files")]
63+
[RetryFact(10, 250, DisplayName = "Shall delete files")]
6464
public async Task ShallDeleteFiles()
6565
{
6666
var files = new List<FileStorageInfo>() {
@@ -96,7 +96,7 @@ public async Task ShallDeleteFiles()
9696
{
9797
Assert.False(_fileSystem.File.Exists(file.FilePath));
9898
}
99-
Assert.True(_fileSystem.Directory.Exists("/payloads"));
99+
Assert.False(_fileSystem.Directory.Exists("/payloads/dir1"));
100100

101101
_logger.VerifyLogging("Space Reclaimer Service canceled.", LogLevel.Warning, Times.Once());
102102
}

0 commit comments

Comments
 (0)