diff --git a/HousingSearchApi.Tests/HousingSearchApi.Tests.csproj b/HousingSearchApi.Tests/HousingSearchApi.Tests.csproj index 18cca1cf..12c574e8 100644 --- a/HousingSearchApi.Tests/HousingSearchApi.Tests.csproj +++ b/HousingSearchApi.Tests/HousingSearchApi.Tests.csproj @@ -45,7 +45,7 @@ - + diff --git a/HousingSearchApi.Tests/V1/E2ETests/Fixtures/TransactionsFixture.cs b/HousingSearchApi.Tests/V1/E2ETests/Fixtures/TransactionsFixture.cs index 9397f29d..bbf04646 100644 --- a/HousingSearchApi.Tests/V1/E2ETests/Fixtures/TransactionsFixture.cs +++ b/HousingSearchApi.Tests/V1/E2ETests/Fixtures/TransactionsFixture.cs @@ -14,20 +14,20 @@ namespace HousingSearchApi.Tests.V1.E2ETests.Fixtures public class TransactionsFixture : BaseFixture { private const string IndexName = "transactions"; - private const int PersonsCount = 5; + private const int SendersCount = 5; private static readonly Fixture _fixture = new Fixture(); - public static List Persons { get; } = CreatePersonsData(PersonsCount); + public static List Senders { get; } = CreateSendersData(SendersCount); public TransactionsFixture(IElasticClient elasticClient, HttpClient httpHttpClient) : base(elasticClient, httpHttpClient) { WaitForESInstance(); } - private static List CreatePersonsData(int personsCount) + private static List CreateSendersData(int personsCount) { - return _fixture.CreateMany(personsCount).ToList(); + return _fixture.CreateMany(personsCount).ToList(); } public void GivenAnAssetIndexExists() @@ -59,10 +59,10 @@ private List CreateTransactionsData(int transactionsCount) for (var i = 0; i < transactionsCount; i++) { - var personIndex = random.Next(PersonsCount); + var personIndex = random.Next(SendersCount); var transaction = _fixture.Create(); - transaction.Sender = Persons[personIndex]; + transaction.Sender = Senders[personIndex]; listOfTransactions.Add(transaction); } diff --git a/HousingSearchApi.Tests/V1/E2ETests/Steps/GetTransactionsSteps.cs b/HousingSearchApi.Tests/V1/E2ETests/Steps/GetTransactionsSteps.cs index e22e5b07..7a4a349c 100644 --- a/HousingSearchApi.Tests/V1/E2ETests/Steps/GetTransactionsSteps.cs +++ b/HousingSearchApi.Tests/V1/E2ETests/Steps/GetTransactionsSteps.cs @@ -32,7 +32,7 @@ public async Task WhenRequestContainsSearchText(string searchText = null) public async Task WhenAPageSizeIsProvided(int pageSize) { - var route = new Uri($"{BaseTransactionsRoute}?searchText={TransactionsFixture.Persons.First().FullName}&pageSize={pageSize}", + var route = new Uri($"{BaseTransactionsRoute}?searchText={TransactionsFixture.Senders.First().FullName}&pageSize={pageSize}", UriKind.Relative); _lastResponse = await _httpClient.GetAsync(route).ConfigureAwait(false); diff --git a/HousingSearchApi.Tests/V1/E2ETests/Stories/GetTransactionsStories.cs b/HousingSearchApi.Tests/V1/E2ETests/Stories/GetTransactionsStories.cs index de23eb36..756069f6 100644 --- a/HousingSearchApi.Tests/V1/E2ETests/Stories/GetTransactionsStories.cs +++ b/HousingSearchApi.Tests/V1/E2ETests/Stories/GetTransactionsStories.cs @@ -57,8 +57,8 @@ public void ServiceReturnsOkWithExactPageSize() public void ServiceReturnsOkWithMatchesByFullName() { this.Given(_ => _transactionsFixture.GivenAnAssetIndexExists()) - .When(_ => _transactionsSteps.WhenRequestContainsSearchText(TransactionsFixture.Persons.First().FullName)) - .Then(_ => _transactionsSteps.ThenThatTextShouldBeInTheResult(TransactionsFixture.Persons.First().FullName)) + .When(_ => _transactionsSteps.WhenRequestContainsSearchText(TransactionsFixture.Senders.First().FullName)) + .Then(_ => _transactionsSteps.ThenThatTextShouldBeInTheResult(TransactionsFixture.Senders.First().FullName)) .BDDfy(); } } diff --git a/HousingSearchApi.Tests/V1/Factories/DomainFactoryTests.cs b/HousingSearchApi.Tests/V1/Factories/DomainFactoryTests.cs index 02e2cf19..53b54f13 100644 --- a/HousingSearchApi.Tests/V1/Factories/DomainFactoryTests.cs +++ b/HousingSearchApi.Tests/V1/Factories/DomainFactoryTests.cs @@ -21,7 +21,7 @@ public void CanMapASharedDomainSuspenseResolutionInfoObjectToADomainObject() [Fact] public void CanMapASharedDomainPersonTypeObjectToADomainObject() { - var sharedDomain = _fixture.Create(); + var sharedDomain = _fixture.Create(); var domain = sharedDomain.ToDomain(); sharedDomain.Should().BeEquivalentTo(domain); } diff --git a/HousingSearchApi/HousingSearchApi.csproj b/HousingSearchApi/HousingSearchApi.csproj index cdd82d1f..05a4f4ab 100644 --- a/HousingSearchApi/HousingSearchApi.csproj +++ b/HousingSearchApi/HousingSearchApi.csproj @@ -25,7 +25,7 @@ - + diff --git a/HousingSearchApi/V1/Boundary/Responses/Transactions/Person.cs b/HousingSearchApi/V1/Boundary/Responses/Transactions/Sender.cs similarity index 59% rename from HousingSearchApi/V1/Boundary/Responses/Transactions/Person.cs rename to HousingSearchApi/V1/Boundary/Responses/Transactions/Sender.cs index 5be81db1..d54fc47f 100644 --- a/HousingSearchApi/V1/Boundary/Responses/Transactions/Person.cs +++ b/HousingSearchApi/V1/Boundary/Responses/Transactions/Sender.cs @@ -2,21 +2,21 @@ namespace HousingSearchApi.V1.Boundary.Responses.Transactions { - public class Person + public class Sender { public Guid Id { get; } public string FullName { get; } - private Person(Guid id, string fullName) + private Sender(Guid id, string fullName) { Id = id; FullName = fullName; } - public static Person Create(Guid id, string fullName) + public static Sender Create(Guid id, string fullName) { - return new Person(id, fullName); + return new Sender(id, fullName); } } } diff --git a/HousingSearchApi/V1/Boundary/Responses/Transactions/TransactionResponse.cs b/HousingSearchApi/V1/Boundary/Responses/Transactions/TransactionResponse.cs index 34984a0d..048686ca 100644 --- a/HousingSearchApi/V1/Boundary/Responses/Transactions/TransactionResponse.cs +++ b/HousingSearchApi/V1/Boundary/Responses/Transactions/TransactionResponse.cs @@ -169,7 +169,7 @@ public class TransactionResponse /// "FullName": "Kian Hayward" /// } /// - public Person Sender { get; } + public Sender Sender { get; } /// /// ToDO: No information about this field @@ -181,7 +181,7 @@ public class TransactionResponse private TransactionResponse(Guid id, Guid targetId, TargetType targetType, short periodNo, short financialYear, short financialMonth, string transactionSource, TransactionType transactionType, DateTime transactionDate, decimal transactionAmount, string paymentReference, string bankAccountNumber, bool isSuspense, SuspenseResolutionInfo suspenseResolutionInfo, - decimal paidAmount, decimal chargedAmount, decimal balanceAmount, decimal housingBenefitAmount, string address, Person sender, string fund) + decimal paidAmount, decimal chargedAmount, decimal balanceAmount, decimal housingBenefitAmount, string address, Sender sender, string fund) { Id = id; TargetId = targetId; @@ -208,7 +208,7 @@ private TransactionResponse(Guid id, Guid targetId, TargetType targetType, short public static TransactionResponse Create(Guid id, Guid targetId, TargetType targetType, short periodNo, short financialYear, short financialMonth, string transactionSource, TransactionType transactionType, DateTime transactionDate, decimal transactionAmount, string paymentReference, string bankAccountNumber, bool isSuspense, SuspenseResolutionInfo suspenseResolutionInfo, - decimal paidAmount, decimal chargedAmount, decimal balanceAmount, decimal housingBenefitAmount, string address, Person person, string fund) + decimal paidAmount, decimal chargedAmount, decimal balanceAmount, decimal housingBenefitAmount, string address, Sender person, string fund) { return new TransactionResponse(id, targetId, targetType, periodNo, financialYear, financialMonth, transactionSource, transactionType, transactionDate, transactionAmount, paymentReference, bankAccountNumber, isSuspense, suspenseResolutionInfo, paidAmount, chargedAmount, balanceAmount, diff --git a/HousingSearchApi/V1/Factories/DomainFactory.cs b/HousingSearchApi/V1/Factories/DomainFactory.cs index fd8f2a89..763dbf1a 100644 --- a/HousingSearchApi/V1/Factories/DomainFactory.cs +++ b/HousingSearchApi/V1/Factories/DomainFactory.cs @@ -1,8 +1,8 @@ using SuspenseResolutionInfoResponse = HousingSearchApi.V1.Boundary.Responses.Transactions.SuspenseResolutionInfo; using SuspenseResolutionInfoDomain = Hackney.Shared.HousingSearch.Domain.Transactions.SuspenseResolutionInfo; -using PersonResponse = HousingSearchApi.V1.Boundary.Responses.Transactions.Person; -using PersonDomain = Hackney.Shared.HousingSearch.Domain.Transactions.Person; +using SenderResponse = HousingSearchApi.V1.Boundary.Responses.Transactions.Sender; +using SenderDomain = Hackney.Shared.HousingSearch.Domain.Transactions.Sender; namespace HousingSearchApi.V1.Factories { @@ -13,9 +13,9 @@ public static SuspenseResolutionInfoResponse ToDomain(this SuspenseResolutionInf return SuspenseResolutionInfoResponse.Create(sharedDomain.ResolutionDate, sharedDomain.IsConfirmed, sharedDomain.IsApproved, sharedDomain.Note); } - public static PersonResponse ToDomain(this PersonDomain sharedDomain) + public static SenderResponse ToDomain(this SenderDomain sharedDomain) { - return PersonResponse.Create(sharedDomain.Id, sharedDomain.FullName); + return SenderResponse.Create(sharedDomain.Id, sharedDomain.FullName); } } }