Skip to content

Commit b7b276c

Browse files
committed
Renamed Smoke context to end to end context
1 parent 9e0742c commit b7b276c

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

tests/e2e-tests/dtos-cohort-manager-e2e-tests/Contexts/SmokeTestsContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace dtos_cohort_manager_e2e_tests.Contexts;
1010

11-
public class SmokeTestsContext
11+
public class EndToEndTestsContext
1212
{
1313
public string FilePath { get; set; }
1414

tests/e2e-tests/dtos-cohort-manager-e2e-tests/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ private static void ConfigureServices(IServiceCollection services)
4848
services.AddSingleton(sp => sp.GetRequiredService<IOptions<AppSettings>>().Value);
4949
services.AddTransient<EndToEndFileUploadService>();
5050

51-
services.AddScoped(_ => new SmokeTestsContext());
51+
services.AddScoped(_ => new EndToEndTestsContext());
5252
}
5353
}

tests/e2e-tests/dtos-cohort-manager-e2e-tests/Steps/Epic1_AutomatedRegressionSuiteSteps.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public class Epic1_AutomatedRegressionSuiteSteps
2020
private readonly EndToEndFileUploadService _fileUploadService;
2121

2222
private readonly AppSettings _appSettings;
23-
private SmokeTestsContext _smokeTestsContext;
23+
private EndToEndTestsContext _endtoendTestsContext;
2424

2525

26-
public Epic1_AutomatedRegressionSuiteSteps(IServiceProvider services, AppSettings appSettings, SmokeTestsContext smokeTestsContext, ILogger<Epic1_AutomatedRegressionSuiteSteps> logger)
26+
public Epic1_AutomatedRegressionSuiteSteps(IServiceProvider services, AppSettings appSettings, EndToEndTestsContext endtoendTestsContext, ILogger<Epic1_AutomatedRegressionSuiteSteps> logger)
2727
{
2828
_appSettings = appSettings;
29-
_smokeTestsContext = smokeTestsContext;
29+
_endtoendTestsContext = endtoendTestsContext;
3030
_fileUploadService = services.GetRequiredService<EndToEndFileUploadService>();
3131

3232
}
@@ -35,10 +35,10 @@ public Epic1_AutomatedRegressionSuiteSteps(IServiceProvider services, AppSetting
3535
public async Task ThenVerifyTheNHSNumbersInParticipantManagementAndParticipantDemographicTableShouldMatchTheFileData()
3636
{
3737

38-
var recordType = _smokeTestsContext.RecordType.ToString().ToUpper();
38+
var recordType = _endtoendTestsContext.RecordType.ToString().ToUpper();
3939
await _fileUploadService.VerifyNhsNumbersAsync(
4040
"PARTICIPANT_MANAGEMENT",
41-
_smokeTestsContext.NhsNumbers!,
41+
_endtoendTestsContext.NhsNumbers!,
4242
recordType,
4343
"PARTICIPANT_DEMOGRAPHIC"
4444
);
@@ -50,32 +50,32 @@ public async Task ThenVerifyTheInParticipantManagementShouldMatchAmended(string
5050

5151
await _fileUploadService.VerifyNhsNumbersAsync(
5252
"PARTICIPANT_MANAGEMENT",
53-
_smokeTestsContext.NhsNumbers!,
53+
_endtoendTestsContext.NhsNumbers!,
5454
expectedRecordType.ToUpper());
5555
}
5656

5757
[Then(@"the Participant_Demographic table should match the (.*) for the NHS Number")]
5858
public async Task ThenTheParticipantDemographicTableShouldMatchTheAmendedAMENDEDNewTestForTheNHSNumber(string expectedGivenName)
5959
{
60-
await _fileUploadService.VerifyFieldUpdateAsync("PARTICIPANT_DEMOGRAPHIC", _smokeTestsContext.NhsNumbers.FirstOrDefault(), "GIVEN_NAME", expectedGivenName);
60+
await _fileUploadService.VerifyFieldUpdateAsync("PARTICIPANT_DEMOGRAPHIC", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), "GIVEN_NAME", expectedGivenName);
6161
}
6262

6363
[Then(@"the NHS Number should have exactly (.*) record in Participant_Management")]
6464
public async Task ThenTheNHSNumberShouldHaveExactlyRecordInParticipantManagement(int count)
6565
{
66-
await _fileUploadService.VerifyNhsNumbersCountAsync("PARTICIPANT_MANAGEMENT", _smokeTestsContext.NhsNumbers.FirstOrDefault(), count);
66+
await _fileUploadService.VerifyNhsNumbersCountAsync("PARTICIPANT_MANAGEMENT", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), count);
6767
}
6868

6969
[Then(@"the NHS Number should have exactly (.*) record in Participant_Demographic")]
7070
public async Task ThenTheNHSNumberShouldHaveExactlyRecordInParticipant_Demographic(int count)
7171
{
72-
await _fileUploadService.VerifyNhsNumbersCountAsync("PARTICIPANT_DEMOGRAPHIC", _smokeTestsContext.NhsNumbers.FirstOrDefault(), count);
72+
await _fileUploadService.VerifyNhsNumbersCountAsync("PARTICIPANT_DEMOGRAPHIC", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), count);
7373
}
7474

7575
[Then(@"the NHS Number should have exactly (.*) record in Cohort_Distribution table")]
7676
public async Task thereshouldntbenoentryofNHSnumberincohortdistributiontable(int count)
7777
{
78-
await _fileUploadService.VerifyNhsNumbersCountAsync("BS_COHORT_DISTRIBUTION", _smokeTestsContext.NhsNumbers.FirstOrDefault(), count);
78+
await _fileUploadService.VerifyNhsNumbersCountAsync("BS_COHORT_DISTRIBUTION", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), count);
7979

8080
}
8181

@@ -100,37 +100,37 @@ public void GivenFileExistsAtConfiguredPath(string fileName, string? recordType,
100100
var folderPath = typeof(FilePaths).GetProperty(recordType!)?.GetValue(_appSettings.FilePaths)?.ToString();
101101
var filePath = Path.Combine(folderPath!, fileName);
102102

103-
_smokeTestsContext.FilePath = filePath;
104-
_smokeTestsContext.RecordType = (RecordTypesEnum)Enum.Parse(typeof(RecordTypesEnum), recordType, ignoreCase: true);
103+
_endtoendTestsContext.FilePath = filePath;
104+
_endtoendTestsContext.RecordType = (RecordTypesEnum)Enum.Parse(typeof(RecordTypesEnum), recordType, ignoreCase: true);
105105

106-
_smokeTestsContext.NhsNumbers = nhsNumbersData.Split(',', StringSplitOptions.TrimEntries).ToList();
106+
_endtoendTestsContext.NhsNumbers = nhsNumbersData.Split(',', StringSplitOptions.TrimEntries).ToList();
107107
}
108108

109109
[Given(@"the file is uploaded to the Blob Storage container")]
110110
[When(@"the file is uploaded to the Blob Storage container")]
111111
public async Task WhenFileIsUploaded()
112112
{
113-
var filePath = _smokeTestsContext.FilePath;
113+
var filePath = _endtoendTestsContext.FilePath;
114114
await _fileUploadService.UploadFileAsync(filePath);
115115
}
116116

117117
[Given(@"the NHS numbers in the database should match the file data")]
118118
[Then(@"the NHS numbers in the database should match the file data")]
119119
public async Task ThenVerifyNhsNumbersInDatabase()
120120
{
121-
await _fileUploadService.VerifyNhsNumbersAsync("BS_COHORT_DISTRIBUTION", _smokeTestsContext.NhsNumbers!);
121+
await _fileUploadService.VerifyNhsNumbersAsync("BS_COHORT_DISTRIBUTION", _endtoendTestsContext.NhsNumbers!);
122122
}
123123

124124
[Then(@"there should be (.*) records for the NHS Number in the database")]
125125
public async Task ThenThereShouldBeRecordsForThe(int count)
126126
{
127-
await _fileUploadService.VerifyNhsNumbersCountAsync("BS_COHORT_DISTRIBUTION", _smokeTestsContext.NhsNumbers.FirstOrDefault(), count);
127+
await _fileUploadService.VerifyNhsNumbersCountAsync("BS_COHORT_DISTRIBUTION", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), count);
128128
}
129129

130130
[Then(@"the database should match the amended (.*) for the NHS Number")]
131131
public async Task ThenTheDatabaseShouldMatchTheAmendedForTheNHSNumber(string expectedGivenName)
132132
{
133-
await _fileUploadService.VerifyFieldUpdateAsync("BS_COHORT_DISTRIBUTION", _smokeTestsContext.NhsNumbers.FirstOrDefault(), "GIVEN_NAME", expectedGivenName);
133+
await _fileUploadService.VerifyFieldUpdateAsync("BS_COHORT_DISTRIBUTION", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), "GIVEN_NAME", expectedGivenName);
134134
}
135135

136136
[Then(@"the Exception table should contain the below details for the NHS Number")]
@@ -144,7 +144,7 @@ public async Task ThenTheExceptionTableShouldContainTheBelowDetails(Table table)
144144

145145
foreach (var field in fields)
146146
{
147-
await _fileUploadService.VerifyFieldUpdateAsync("EXCEPTION_MANAGEMENT", _smokeTestsContext.NhsNumbers.FirstOrDefault(), field.FieldName, field.FieldValue);
147+
await _fileUploadService.VerifyFieldUpdateAsync("EXCEPTION_MANAGEMENT", _endtoendTestsContext.NhsNumbers.FirstOrDefault(), field.FieldName, field.FieldValue);
148148
}
149149
}
150150

0 commit comments

Comments
 (0)