Skip to content

Commit

Permalink
FAI-954 - Add traineeship client
Browse files Browse the repository at this point in the history
  • Loading branch information
dashton82 committed Oct 9, 2023
1 parent 8080b8c commit 61f949c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ public void Then_The_Domain_Is_Resolved_For_Test_Environments(string environment

actual.Should().Be($"{environment}-pas.apprenticeships.education.gov.uk");
}
[TestCase("test")]
[TestCase("pp")]
[TestCase("something")]
public void Then_The_Domain_Is_Resolved_For_Test_Environments_Traineeships(string environment)
{
var actual = RedirectExtension.GetEnvironmentAndDomain(environment, ClientName.TraineeshipRoatp);

actual.Should().Be($"{environment}-pas.traineeships.education.gov.uk");
}

[Test]
public void Then_The_Domain_Is_Resolved_For_Prod_Environment()
Expand All @@ -32,6 +41,13 @@ public void Then_The_Domain_Is_Resolved_For_Prod_Environment()
actual.Should().Be("providers.apprenticeships.education.gov.uk");
}

[Test]
public void Then_The_Domain_Is_Resolved_For_Prod_Traineeships_Environment()
{
var actual = RedirectExtension.GetEnvironmentAndDomain("PRD", ClientName.TraineeshipRoatp);

actual.Should().Be("providers.traineeships.education.gov.uk");
}

[Test]
public void Then_The_Logged_Out_Url_Is_Returned_When_Specified()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public enum ClientName
[Description("admin")]
ServiceAdmin = 5,
[Description("console")]
SupportConsole = 6
SupportConsole = 6,
[Description("providers|pas")]
TraineeshipRoatp = 7
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ public static string GetEnvironmentAndDomain(string environment, ClientName clie
}

var apprenticeshipsEducationGovUk = ".apprenticeships.education.gov.uk";
if (clientName == ClientName.ProviderRoatp)
if (clientName == ClientName.ProviderRoatp || clientName == ClientName.TraineeshipRoatp)
{
if (clientName == ClientName.TraineeshipRoatp)
{
apprenticeshipsEducationGovUk = ".traineeships.education.gov.uk";
}
return environment.ToLower() == "prd"
? $"{ClientName.ProviderRoatp.GetDescription().Split('|')[0]}{apprenticeshipsEducationGovUk}"
: $"{environment.ToLower()}-{ClientName.ProviderRoatp.GetDescription().Split('|')[1]}{apprenticeshipsEducationGovUk}";
Expand Down

0 comments on commit 61f949c

Please sign in to comment.