-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAT2-295 - Add request for getting provider by id
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...inance.UnitTests/Infrastructure/OuterApiRequests/WhenBuildingTheGetProviderByIdRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}"); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetProviderRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}"; | ||
} | ||
} |