Skip to content

Commit

Permalink
Rename TestData.WithInduction to WithDqtInduction (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Nov 11, 2024
1 parent 5e73a1b commit 8dd219b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task Get_ValidRequestWithMatchesOnLastName_ReturnsExpectedResponse(
.WithLastName(lastName)
.WithDateOfBirth(dateOfBirth)
.WithSanction("A21B")
.WithInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithDqtInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithQts(qtsDate: new(2021, 7, 1))
.WithEyts(eytsDate: new(2021, 8, 1), eytsStatusValue: "222"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task Get_IncorrectDateOfBirth_DoesNotReturnRecord()
.WithTrn()
.WithDateOfBirth(dateOfBirth)
.WithSanction("G1")
.WithInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithDqtInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithQts(qtsDate: new(2021, 7, 1))
.WithEyts(eytsDate: new(2021, 8, 1), eytsStatusValue: "222"));

Expand Down Expand Up @@ -126,7 +126,7 @@ public async Task Get_ValidRequest_ReturnsMatchedRecord()
.WithTrn()
.WithDateOfBirth(dateOfBirth)
.WithSanction("A21B")
.WithInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithDqtInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1))
.WithQts(qtsDate: new(2021, 7, 1))
.WithEyts(eytsDate: new(2021, 8, 1), eytsStatusValue: "222"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public async Task Put_ClearQtlsWhenInductionStatusIsRequiredToComplete_SetsInduc
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));


Expand Down Expand Up @@ -183,7 +183,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsRequiredToComplete_SetsInducti
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -211,7 +211,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsInProgress_ReturnsStatusAccept
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)); ;
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)); ;

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -245,7 +245,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsNotYetCompleted_SetsInductionS
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -275,7 +275,7 @@ public async Task Put_ClearQtlsWithActiveAlert_ClearsQtlsAndCreatesReviewTask()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate)
.WithSanction("G1"));

Expand Down Expand Up @@ -310,7 +310,7 @@ public async Task Put_SetQtlsSWithSameQtlsDate_ReturnsAcceptedAndCreatesReviewTa
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingqtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -343,7 +343,7 @@ public async Task Put_SetQtlsWithActiveAlert_SetsQtlsAndCreatesReviewTask()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithSanction("G1"));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -377,7 +377,7 @@ public async Task Put_ClearQtlsWhenInductionStatusIsNotYetCompleted_SetsInductio
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -409,7 +409,7 @@ public async Task Put_InductionExtendedWithoutActiveInductionPeriod_SetsInductio
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -440,7 +440,7 @@ public async Task Put_InductionExtendedForAppropriateBodyWithoutActiveInductionP
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, Clock.Today.AddMonths(-1), Clock.Today.AddDays(-1), account.AccountId));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, Clock.Today.AddMonths(-1), Clock.Today.AddDays(-1), account.AccountId));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -472,7 +472,7 @@ public async Task Put_ClearQtlsWhenInductionStatusIsInductionExtendedWithAppropr
.WithTrn()
.WithQts(existingQtsDate)
.WithQtlsDate(existingQtlsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, account.AccountId));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, account.AccountId));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -502,7 +502,7 @@ public async Task Put_ClearQtlsWhenInductionStatusIsInductionExtendedWithAB_Sets
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, account.AccountId));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, account.AccountId));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -532,7 +532,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsExempt_SetsInductionStatusExem
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -564,7 +564,7 @@ public async Task Put_ClearQtlsWhenInductionStatusIsExempt_SetsInductionStatusEx
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -596,7 +596,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsPass_SetsInductionStatusPass()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -628,7 +628,7 @@ public async Task Put_ClearQtlsWhenInductionStatusPass_SetsInductionStatusPass()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -660,7 +660,7 @@ public async Task Put_SetQtlsWhenInductionStatusFail_ReturnsAccepted()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -695,7 +695,7 @@ public async Task Put_ClearQtlsWhenInductionStatusFail_ReturnsAccepted()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -730,7 +730,7 @@ public async Task Put_SetQtlsWhenInductionStatusIsPassedInWales_SetsInductionSta
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -762,7 +762,7 @@ public async Task Put_ClearQtlsWhenInductionStatusPassedInWales_SetsInductionSta
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: dfeta_InductionExemptionReason.Exempt, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -794,7 +794,7 @@ public async Task Put_SetQtlsWhenInductionStatusFailedInWales_ReturnsAccepted()
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down Expand Up @@ -829,7 +829,7 @@ public async Task Put_ClearQtlsWhenInductionStatusFailedInWales_ReturnsAccepted(
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithQts(existingQtsDate)
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: null, null, null, null, null, null)
.WithQtlsDate(existingQtlsDate));

var requestBody = CreateJsonContent(new { qtsDate = incomingqtlsDate });
Expand Down Expand Up @@ -1019,7 +1019,7 @@ public async Task Put_ValidQtlsDateWithNoQts_SetsInductionStatus(dfeta_Induction
var qtlsDate = !string.IsNullOrEmpty(incomingQtls) ? DateOnly.Parse(incomingQtls) : default(DateOnly?);
var person = await TestData.CreatePerson(p => p
.WithTrn()
.WithInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: existingInductionExemptionReason, null, null, null, null, null));
.WithDqtInduction(inductionStatus: existingInductionStatus, inductionExemptionReason: existingInductionExemptionReason, null, null, null, null, null));

var requestBody = CreateJsonContent(new { qtsDate = qtlsDate });
var request = new HttpRequestMessage(HttpMethod.Put, $"v3/persons/{person.Trn}/qtls")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task WhenCalled_WithTRAInductionStatusAndQTLSDate_ReturnsExpectedRe
{
x.WithQts(new DateOnly(2021, 01, 1));
x.WithQtlsDate(qtlsDate);
x.WithInduction(inductionStatus: inductionStatus, inductionExemptionReason: exemptionReason, inductionStartDate: new DateOnly(2021, 01, 01), completedDate: new DateOnly(2022, 01, 01), inductionPeriodStartDate: new DateOnly(2021, 01, 01), inductionPeriodEndDate: new DateOnly(2022, 01, 01), appropriateBodyOrgId: establishment1.AccountId);
x.WithDqtInduction(inductionStatus: inductionStatus, inductionExemptionReason: exemptionReason, inductionStartDate: new DateOnly(2021, 01, 01), completedDate: new DateOnly(2022, 01, 01), inductionPeriodStartDate: new DateOnly(2021, 01, 01), inductionPeriodEndDate: new DateOnly(2022, 01, 01), appropriateBodyOrgId: establishment1.AccountId);
});

// Act
Expand Down Expand Up @@ -107,7 +107,7 @@ public async Task WhenCalled_WithoutTRAQTLSDate_ReturnsExpectedResults(dfeta_Ind
var createPersonResult = await _dataScope.TestData.CreatePerson(x =>
{
x.WithQts(qtlsDate);
x.WithInduction(inductionStatus, exemptionReason, null, null, null, null, null);
x.WithDqtInduction(inductionStatus, exemptionReason, null, null, null, null, null);
});

// Act
Expand Down
Loading

0 comments on commit 8dd219b

Please sign in to comment.