Skip to content

Commit

Permalink
Amended to run tests for both change of name and change of date of bi…
Browse files Browse the repository at this point in the history
…rth scenarios
  • Loading branch information
hortha committed Sep 18, 2023
1 parent dbc58d1 commit 1617ea7
Showing 1 changed file with 45 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ public CaseTests(HostFixture hostFixture)
{
}

[Fact]
public async Task SelectCaseAndApprove()
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task SelectCaseAndApprove(bool isNameChange)
{
var createPersonResult = await TestData.CreatePerson();
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
var caseReference = createIncidentResult.TicketNumber;
string caseReference;
if (isNameChange)
{
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}
else
{
var createIncidentResult = await TestData.CreateDateOfBirthChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}

await using var context = await HostFixture.CreateBrowserContext();
var page = await context.NewPageAsync();
Expand All @@ -40,12 +51,23 @@ public async Task SelectCaseAndApprove()
await page.AssertFlashMessage("The request has been accepted");
}

[Fact]
public async Task SelectCaseAndReject()
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task SelectCaseAndReject(bool isNameChange)
{
var createPersonResult = await TestData.CreatePerson();
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
var caseReference = createIncidentResult.TicketNumber;
string caseReference;
if (isNameChange)
{
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}
else
{
var createIncidentResult = await TestData.CreateDateOfBirthChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}

await using var context = await HostFixture.CreateBrowserContext();
var page = await context.NewPageAsync();
Expand Down Expand Up @@ -73,12 +95,23 @@ public async Task SelectCaseAndReject()
await page.AssertFlashMessage("The request has been rejected");
}

[Fact]
public async Task SelectCaseAndCancel()
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task SelectCaseAndCancel(bool isNameChange)
{
var createPersonResult = await TestData.CreatePerson();
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
var caseReference = createIncidentResult.TicketNumber;
string caseReference;
if (isNameChange)
{
var createIncidentResult = await TestData.CreateNameChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}
else
{
var createIncidentResult = await TestData.CreateDateOfBirthChangeIncident(b => b.WithCustomerId(createPersonResult.ContactId));
caseReference = createIncidentResult.TicketNumber;
}

await using var context = await HostFixture.CreateBrowserContext();
var page = await context.NewPageAsync();
Expand Down

0 comments on commit 1617ea7

Please sign in to comment.