Skip to content

Commit 6a2ebb6

Browse files
Updated ReceiveCaasFileTests to use new config object
1 parent b328418 commit 6a2ebb6

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

tests/UnitTests/CaasIntegrationTests/receiveCaasFileTest/ReceiveCaasFileTests.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace NHS.CohortManager.Tests.CaasIntegrationTests;
1414
using DataServices.Client;
1515
using NHS.CohortManager.Tests.TestUtils;
1616
using System.Linq.Expressions;
17+
using System.Runtime.CompilerServices;
18+
using Microsoft.Extensions.Options;
1719

1820
[TestClass]
1921
public class ReceiveCaasFileTests
@@ -27,16 +29,29 @@ public class ReceiveCaasFileTests
2729
private readonly string _blobName;
2830
private readonly Mock<IProcessCaasFile> _mockProcessCaasFile = new();
2931
private readonly Mock<IDataServiceClient<ScreeningLkp>> _mockScreeningLkpClient = new();
32+
private readonly Mock<IOptions<ReceiveCaasFileConfig>> _config = new();
3033

3134
public ReceiveCaasFileTests()
3235
{
3336
_mockLogger = new Mock<ILogger<ReceiveCaasFile>>();
3437
_mockICallFunction = new Mock<ICallFunction>();
3538
_mockIReceiveCaasFileHelper = new Mock<IReceiveCaasFileHelper>();
3639

37-
Environment.SetEnvironmentVariable("BatchSize", "2000");
40+
var testConfig = new ReceiveCaasFileConfig
41+
{
42+
DemographicDataServiceURL = "DemographicDataServiceURL",
43+
ScreeningLkpDataServiceURL = "ScreeningLkpDataServiceURL",
44+
DemographicURI = "DemographicURI",
45+
BatchSize = 2000,
46+
AddQueueName = "AddQueueName",
47+
UpdateQueueName = "UpdateQueueName",
48+
PMSRemoveParticipant = "PMSRemoveParticipant"
49+
};
50+
51+
_config.Setup(c => c.Value).Returns(testConfig);
3852

39-
_receiveCaasFileInstance = new ReceiveCaasFile(_mockLogger.Object, _mockIReceiveCaasFileHelper.Object, _mockProcessCaasFile.Object, _mockScreeningLkpClient.Object);
53+
_receiveCaasFileInstance = new ReceiveCaasFile(_mockLogger.Object, _mockIReceiveCaasFileHelper.Object, _mockProcessCaasFile.Object, _mockScreeningLkpClient.Object,
54+
_config.Object);
4055
_blobName = "add_1_-_CAAS_BREAST_SCREENING_COHORT.parquet";
4156

4257
_participant = new Participant()

0 commit comments

Comments
 (0)