From bf9c5c6cc4ca4393af827f38dae661824127e318 Mon Sep 17 00:00:00 2001 From: Daniel Ashton Date: Thu, 24 Dec 2020 10:28:55 +0000 Subject: [PATCH] FAT2-295 - Add request for getting provider by id --- .../WhenBuildingTheGetProviderByIdRequest.cs | 20 +++++++++++++++++++ .../OuterApiRequests/GetProviderRequest.cs | 15 ++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/SFA.DAS.EmployerFinance.UnitTests/Infrastructure/OuterApiRequests/WhenBuildingTheGetProviderByIdRequest.cs create mode 100644 src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetProviderRequest.cs diff --git a/src/SFA.DAS.EmployerFinance.UnitTests/Infrastructure/OuterApiRequests/WhenBuildingTheGetProviderByIdRequest.cs b/src/SFA.DAS.EmployerFinance.UnitTests/Infrastructure/OuterApiRequests/WhenBuildingTheGetProviderByIdRequest.cs new file mode 100644 index 0000000000..22c638c38a --- /dev/null +++ b/src/SFA.DAS.EmployerFinance.UnitTests/Infrastructure/OuterApiRequests/WhenBuildingTheGetProviderByIdRequest.cs @@ -0,0 +1,20 @@ +using AutoFixture.NUnit3; +using FluentAssertions; +using NUnit.Framework; +using SFA.DAS.EmployerFinance.Infrastructure.OuterApiRequests; + +namespace SFA.DAS.EmployerFinance.UnitTests.Infrastructure.OuterApiRequests +{ + public class WhenBuildingTheGetProviderByIdRequest + { + [Test, AutoData] + public void Then_The_Url_Is_Correctly_Constructed(int id) + { + //Arrange + var actual = new GetProviderRequest(id); + + //Act + actual.GetUrl.Should().Be($"providers/{id}"); + } + } +} \ No newline at end of file diff --git a/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetProviderRequest.cs b/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetProviderRequest.cs new file mode 100644 index 0000000000..953d540368 --- /dev/null +++ b/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetProviderRequest.cs @@ -0,0 +1,15 @@ +using SFA.DAS.EmployerFinance.Interfaces.OuterApi; + +namespace SFA.DAS.EmployerFinance.Infrastructure.OuterApiRequests +{ + public class GetProviderRequest : IGetApiRequest + { + private readonly int _id; + + public GetProviderRequest (int id) + { + _id = id; + } + public string GetUrl => $"providers/{_id}"; + } +} \ No newline at end of file