diff --git a/TransactionProcessor.BusinessLogic.Tests/OperatorInterfaces/AgencyBankingProxyTests.cs b/TransactionProcessor.BusinessLogic.Tests/OperatorInterfaces/AgencyBankingProxyTests.cs index d60efced..66b45259 100644 --- a/TransactionProcessor.BusinessLogic.Tests/OperatorInterfaces/AgencyBankingProxyTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/OperatorInterfaces/AgencyBankingProxyTests.cs @@ -339,6 +339,198 @@ public async Task AgencyBankingProxy_ProcessSaleMessage_DepositSuccess_ReturnsMa requestJson.RootElement.GetProperty("transactionId").GetString().ShouldBe(TestData.TransactionId.ToString()); } + [Fact] + public async Task AgencyBankingProxy_ProcessSaleMessage_WithdrawalFailure_ReturnsInvalidResult() + { + HttpResponseMessage responseMessage = new HttpResponseMessage(HttpStatusCode.BadRequest) + { + Content = new StringContent("withdrawal rejected") + }; + + HttpRequestMessage capturedRequest = null; + HttpClient httpClient = SetupMockHttpClient(responseMessage, request => capturedRequest = request); + AgencyBankingConfiguration configuration = CreateConfiguration(); + IOperatorProxy proxy = new AgencyBankingProxy(httpClient, configuration); + + Dictionary metadata = new Dictionary + { + { "AgencyBankingMessageType", "withdrawal" }, + { "AgencyBankingAccountNumber", "123456789" }, + { "Amount", "250.75" } + }; + + var result = await proxy.ProcessSaleMessage(TestData.TransactionId, + TestData.OperatorId, + TestData.Merchant, + TestData.TransactionDateTime, + TestData.TransactionReference, + metadata, + CancellationToken.None); + + result.IsFailed.ShouldBeTrue(); + result.Status.ShouldBe(ResultStatus.Invalid); + result.Message.ShouldBe("Failed to process withdrawal withdrawal rejected"); + + capturedRequest.ShouldNotBeNull(); + capturedRequest.Method.ShouldBe(HttpMethod.Post); + capturedRequest.RequestUri.ShouldBe(new Uri("http://localhost/transactions/withdrawal")); + + String requestBody = await capturedRequest.Content.ReadAsStringAsync(); + using JsonDocument requestJson = JsonDocument.Parse(requestBody); + requestJson.RootElement.GetProperty("agentId").GetString().ShouldBe(TestData.Merchant.MerchantId.ToString()); + requestJson.RootElement.GetProperty("accountNumber").GetString().ShouldBe("123456789"); + requestJson.RootElement.GetProperty("amount").GetDecimal().ShouldBe(250.75m); + requestJson.RootElement.GetProperty("transactionId").GetString().ShouldBe(TestData.TransactionId.ToString()); + } + + [Fact] + public async Task AgencyBankingProxy_ProcessSaleMessage_WithdrawalMissingAmount_ReturnsInvalidResult() + { + HttpClient httpClient = SetupMockHttpClient(new HttpResponseMessage(HttpStatusCode.OK)); + AgencyBankingConfiguration configuration = CreateConfiguration(); + IOperatorProxy proxy = new AgencyBankingProxy(httpClient, configuration); + + Dictionary metadata = new Dictionary + { + { "AgencyBankingMessageType", "withdrawal" }, + { "AgencyBankingAccountNumber", "123456789" } + }; + + var result = await proxy.ProcessSaleMessage(TestData.TransactionId, + TestData.OperatorId, + TestData.Merchant, + TestData.TransactionDateTime, + TestData.TransactionReference, + metadata, + CancellationToken.None); + + result.IsFailed.ShouldBeTrue(); + result.Status.ShouldBe(ResultStatus.Invalid); + result.Message.ShouldBe("Amount - Amount is a required field for this transaction type"); + } + + [Fact] + public async Task AgencyBankingProxy_ProcessSaleMessage_WithdrawalInvalidAmount_ReturnsInvalidResult() + { + Mock handlerMock = new Mock(MockBehavior.Strict); + HttpClient httpClient = new HttpClient(handlerMock.Object); + AgencyBankingConfiguration configuration = CreateConfiguration(); + IOperatorProxy proxy = new AgencyBankingProxy(httpClient, configuration); + + Dictionary metadata = new Dictionary + { + { "AgencyBankingMessageType", "withdrawal" }, + { "AgencyBankingAccountNumber", "123456789" }, + { "Amount", "not-a-number" } + }; + + var result = await proxy.ProcessSaleMessage(TestData.TransactionId, + TestData.OperatorId, + TestData.Merchant, + TestData.TransactionDateTime, + TestData.TransactionReference, + metadata, + CancellationToken.None); + + result.IsFailed.ShouldBeTrue(); + result.Status.ShouldBe(ResultStatus.Invalid); + result.Message.ShouldBe("Amount - Amount is not a valid decimal value"); + } + + [Fact] + public async Task AgencyBankingProxy_ProcessSaleMessage_WithdrawalSuccess_ReturnsMappedOperatorResponse() + { + HttpResponseMessage responseMessage = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"ResponseCode\":\"0000\",\"TransactionId\":\"abc123\"}") + }; + + HttpRequestMessage capturedRequest = null; + HttpClient httpClient = SetupMockHttpClient(responseMessage, request => capturedRequest = request); + AgencyBankingConfiguration configuration = CreateConfiguration(); + IOperatorProxy proxy = new AgencyBankingProxy(httpClient, configuration); + + Dictionary metadata = new Dictionary + { + { "AgencyBankingMessageType", "withdrawal" }, + { "AgencyBankingAccountNumber", "123456789" }, + { "Amount", "250.75" } + }; + + var result = await proxy.ProcessSaleMessage(TestData.TransactionId, + TestData.OperatorId, + TestData.Merchant, + TestData.TransactionDateTime, + TestData.TransactionReference, + metadata, + CancellationToken.None); + + result.IsSuccess.ShouldBeTrue(); + result.Data.ShouldNotBeNull(); + result.Data.IsSuccessful.ShouldBeTrue(); + result.Data.ResponseCode.ShouldBe("0000"); + result.Data.ResponseMessage.ShouldBe("SUCCESS"); + result.Data.AdditionalTransactionResponseMetadata.ShouldBeEmpty(); + + capturedRequest.ShouldNotBeNull(); + capturedRequest.Method.ShouldBe(HttpMethod.Post); + capturedRequest.RequestUri.ShouldBe(new Uri("http://localhost/transactions/withdrawal")); + + String requestBody = await capturedRequest.Content.ReadAsStringAsync(); + using JsonDocument requestJson = JsonDocument.Parse(requestBody); + requestJson.RootElement.GetProperty("agentId").GetString().ShouldBe(TestData.Merchant.MerchantId.ToString()); + requestJson.RootElement.GetProperty("accountNumber").GetString().ShouldBe("123456789"); + requestJson.RootElement.GetProperty("amount").GetDecimal().ShouldBe(250.75m); + requestJson.RootElement.GetProperty("transactionId").GetString().ShouldBe(TestData.TransactionId.ToString()); + } + + [Fact] + public async Task AgencyBankingProxy_ProcessSaleMessage_WithdrawalSuccess_WithMixedCaseMetadata_ReturnsMappedOperatorResponse() + { + HttpResponseMessage responseMessage = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"ResponseCode\":\"0000\",\"TransactionId\":\"abc123\"}") + }; + + HttpRequestMessage capturedRequest = null; + HttpClient httpClient = SetupMockHttpClient(responseMessage, request => capturedRequest = request); + AgencyBankingConfiguration configuration = CreateConfiguration(); + IOperatorProxy proxy = new AgencyBankingProxy(httpClient, configuration); + + Dictionary metadata = new Dictionary + { + { "agencybankingmessagetype", "withdrawal" }, + { "agencybankingaccountnumber", "123456789" }, + { "aMoUnT", "250.75" } + }; + + var result = await proxy.ProcessSaleMessage(TestData.TransactionId, + TestData.OperatorId, + TestData.Merchant, + TestData.TransactionDateTime, + TestData.TransactionReference, + metadata, + CancellationToken.None); + + result.IsSuccess.ShouldBeTrue(); + result.Data.ShouldNotBeNull(); + result.Data.IsSuccessful.ShouldBeTrue(); + result.Data.ResponseCode.ShouldBe("0000"); + result.Data.ResponseMessage.ShouldBe("SUCCESS"); + result.Data.AdditionalTransactionResponseMetadata.ShouldBeEmpty(); + + capturedRequest.ShouldNotBeNull(); + capturedRequest.Method.ShouldBe(HttpMethod.Post); + capturedRequest.RequestUri.ShouldBe(new Uri("http://localhost/transactions/withdrawal")); + + String requestBody = await capturedRequest.Content.ReadAsStringAsync(); + using JsonDocument requestJson = JsonDocument.Parse(requestBody); + requestJson.RootElement.GetProperty("agentId").GetString().ShouldBe(TestData.Merchant.MerchantId.ToString()); + requestJson.RootElement.GetProperty("accountNumber").GetString().ShouldBe("123456789"); + requestJson.RootElement.GetProperty("amount").GetDecimal().ShouldBe(250.75m); + requestJson.RootElement.GetProperty("transactionId").GetString().ShouldBe(TestData.TransactionId.ToString()); + } + private static AgencyBankingConfiguration CreateConfiguration() { return new AgencyBankingConfiguration diff --git a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj index e5f6fbd9..bf0ff847 100644 --- a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj +++ b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj @@ -2,7 +2,7 @@ net10.0 - Full + None false diff --git a/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/AgencyBankingProxy.cs b/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/AgencyBankingProxy.cs index cfac4f48..73d4591e 100644 --- a/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/AgencyBankingProxy.cs +++ b/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/AgencyBankingProxy.cs @@ -65,6 +65,7 @@ public async Task> ProcessSaleMessage(Guid transactionI Result result = messageType switch { "balanceenquiry" => await ProcessBalanceEnquiry(transactionId, merchant.MerchantId.ToString(), accountNumber, cancellationToken), "deposit" => await ProcessDeposit(transactionId, merchant.MerchantId.ToString(), accountNumber, additionalTransactionMetadata, cancellationToken), + "withdrawal" => await ProcessWithdrawal(transactionId, merchant.MerchantId.ToString(), accountNumber, additionalTransactionMetadata, cancellationToken), _ => Result.Invalid($"AgencyBankingMessageType - Message Type {messageType} is not supported for this transaction type") }; @@ -76,6 +77,59 @@ public async Task> ProcessSaleMessage(Guid transactionI return result; } + private async Task> ProcessWithdrawal(Guid transactionId, + String agentId, + String accountNumber, + Dictionary additionalTransactionMetadata, + CancellationToken cancellationToken) { + HttpRequestMessage request = new(HttpMethod.Post, $"{this.Configuration.Url}/transactions/withdrawal"); + // Extract required data from metadata + String amountValue = additionalTransactionMetadata.ExtractFieldFromMetadata("Amount"); + + if (String.IsNullOrWhiteSpace(amountValue)) + { + Logger.LogWarning($"AgencyBanking withdrawal request rejected. TransactionId=[{transactionId}] missing Amount"); + return Result.Invalid("Amount - Amount is a required field for this transaction type"); + } + + if (Decimal.TryParse(amountValue, out Decimal amount) == false) + { + Logger.LogWarning($"AgencyBanking withdrawal request rejected. TransactionId=[{transactionId}] invalid Amount [{amountValue}]"); + return Result.Invalid("Amount - Amount is not a valid decimal value"); + } + + WithdrawalRequest body = new() { AgentId = agentId, AccountNumber = accountNumber, Amount = amount, TransactionId = transactionId.ToString() }; + + String requestBody = StringSerialiser.Serialise(body, SerialiserOptions); + request.Content = new StringContent(requestBody, Encoding.UTF8, "application/json"); + + Logger.LogWarning($"AgencyBanking withdrawal request starting. TransactionId=[{transactionId}], AgentId=[{agentId}], AccountNumber=[{accountNumber}], RequestUri=[{request.RequestUri}], RequestBody=[{requestBody}]"); + + HttpResponseMessage response = await this.HttpClient.SendAsync(request, cancellationToken); + String responseContent = await response.Content.ReadAsStringAsync(cancellationToken); + + Logger.LogWarning($"AgencyBanking withdrawal response received. TransactionId=[{transactionId}], StatusCode=[{response.StatusCode}], ContentLength=[{responseContent?.Length ?? 0}]"); + + if (response.IsSuccessStatusCode == false) + { + Logger.LogWarning($"AgencyBanking withdrawal failed. TransactionId=[{transactionId}], StatusCode=[{response.StatusCode}], ResponseBody=[{responseContent}]"); + return Result.Invalid($"Failed to process withdrawal {responseContent}"); + } + + TransactionResult balanceEnquiryResponse = StringSerialiser.Deserialise(responseContent, SerialiserOptions); + Logger.LogWarning($"AgencyBanking withdrawal completed. TransactionId=[{transactionId}], ResponseCode=[{balanceEnquiryResponse.ResponseCode}]"); + + OperatorResponse operatorResponse = new() + { + IsSuccessful = true, + ResponseCode = "0000", + ResponseMessage = "SUCCESS", + AdditionalTransactionResponseMetadata = new Dictionary() + }; + + return Result.Success(operatorResponse); + } + private async Task> ProcessDeposit(Guid transactionId, String agentId, String accountNumber, diff --git a/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/BalanceEnquiryResponse.cs b/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/BalanceEnquiryResponse.cs index 712cc974..17bce0aa 100644 --- a/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/BalanceEnquiryResponse.cs +++ b/TransactionProcessor.BusinessLogic/OperatorInterfaces/AgencyBanking/BalanceEnquiryResponse.cs @@ -23,6 +23,7 @@ public class BalanceEnquiryResponse public decimal AvailableBalance { get; set; } } + [ExcludeFromCodeCoverage] public class DepositRequest { public string TransactionId { get; set; } @@ -39,6 +40,23 @@ public class DepositRequest public String ReferenceNumber { get; set; } } + public class WithdrawalRequest + { + public string TransactionId { get; set; } + + public string CustomerId { get; set; } + + public string AgentId { get; set; } + + public string AccountNumber { get; set; } + + public decimal Amount { get; set; } + public string Currency { get; set; } + public String Channel { get; set; } + public String Narration { get; set; } + public String ReferenceNumber { get; set; } + } + public class TransactionResult { public string ResponseCode { get; set; } = ""; diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index 5aa330bc..f4047aad 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -89,6 +89,7 @@ Background: | Test Estate 1 | PataPawa PrePay | PataPawa PrePay Contract | Pre Pay Bill Pay | Bill Pay (Pre) | | BillPayment | | Test Estate 1 | AgencyBanking | AgencyBanking Contract | Balance Enquiry | Balance Enquiry | | MobileTopup | | Test Estate 1 | AgencyBanking | AgencyBanking Contract | Deposit | Deposit | | MobileTopup | + | Test Estate 1 | AgencyBanking | AgencyBanking Contract | Withdrawal | Withdrawal | | MobileTopup | When I add the following Transaction Fees | EstateName | OperatorName | ContractDescription | ProductName | CalculationType | FeeDescription | Value | @@ -179,6 +180,7 @@ Scenario: Sale Transactions | Today | 11 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PrePay | 25.00 | | | PataPawa PrePay Contract | Pre Pay Bill Pay | test@recipient.co.uk | | vend | 00000001 | Customer 1 | 00000001 | | Today | 12 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | AgencyBanking | 0.00 | | | AgencyBanking Contract | Balance Enquiry | | 12345678 | balanceenquiry | 12345678 | | | | Today | 13 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | AgencyBanking | 100.00 | | | AgencyBanking Contract | Deposit | | 12345678 | deposit | 12345678 | | | + | Today | 14 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | AgencyBanking | 9.00 | | | AgencyBanking Contract | Withdrawal | | 12345678 | withdrawal | 12345678 | | | | Today | 100 | Sale | 1 | Test Merchant 1 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | | Today | 101 | Sale | 1 | Test Merchant 1 | 123456780 | InvalidEstate | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | | Today | 102 | Sale | 1 | InvalidMerchant | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | @@ -203,6 +205,7 @@ Scenario: Sale Transactions | Test Estate 1 | Test Merchant 1 | 11 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 12 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 13 | 0000 | SUCCESS | + | Test Estate 1 | Test Merchant 1 | 14 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 100 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 1 | | InvalidEstate | Test Merchant 1 | 101 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | | Test Estate 1 | InvalidMerchant | 102 | 1002 | Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for estate [Test Estate 1] | @@ -220,7 +223,8 @@ Scenario: Sale Transactions | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 155.00 | | Today | Transaction Completed | D | 0.00 | 20.00 | 20.00 | 135.00 | | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 35.00 | - | Today | Transaction Completed | D | 0.00 | 25.00 | 25.00 | 35.00 | + | Today | Transaction Completed | D | 0.00 | 25.00 | 25.00 | 35.00 | + | Today | Transaction Completed | D | 0.00 | 10.00 | 9.00 | 35.00 | | Today | Transaction Fee Processed | C | 0.00 | 0.55 | 0.55 | 35.55 | | Today | Transaction Fee Processed | C | 0.00 | 0.45 | 0.45 | 36.00 | | Today | Transaction Fee Processed | C | 0.00 | 0.01 | 0.10 | 36.10 | diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 2db44efa..ea4cd942 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -405,6 +405,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Deposit", "", "MobileTopup"}); + table15.AddRow(new string[] { + "Test Estate 1", + "AgencyBanking", + "AgencyBanking Contract", + "Withdrawal", + "Withdrawal", + "", + "MobileTopup"}); #line 84 await testRunner.WhenAsync("I create the following Products", ((string)(null)), table15, "When "); #line hidden @@ -440,7 +448,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); -#line 93 +#line 94 await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table16, "When "); #line hidden global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { @@ -498,7 +506,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact4@merchant4.co.uk", "Test Estate 1", "true"}); -#line 99 +#line 100 await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table17, "Given "); #line hidden global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { @@ -627,7 +635,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "00000004", "10000004", "Test Estate 1"}); -#line 106 +#line 107 await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table18, "Given "); #line hidden global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { @@ -650,7 +658,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "123456783", "Test Merchant 4", "Test Estate 1"}); -#line 129 +#line 130 await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table19, "Given "); #line hidden global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { @@ -683,7 +691,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Today", "Test Merchant 4", "Test Estate 1"}); -#line 136 +#line 137 await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table20, "Given "); #line hidden global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { @@ -758,7 +766,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 1", "Test Merchant 4", "PataPawa PrePay Contract"}); -#line 143 +#line 144 await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table21, "When "); #line hidden } @@ -782,7 +790,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Sale Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 165 +#line 166 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -1075,6 +1083,26 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); + table22.AddRow(new string[] { + "Today", + "14", + "Sale", + "1", + "Test Merchant 1", + "123456780", + "Test Estate 1", + "AgencyBanking", + "9.00", + "", + "", + "AgencyBanking Contract", + "Withdrawal", + "", + "12345678", + "withdrawal", + "12345678", + "", + ""}); table22.AddRow(new string[] { "Today", "100", @@ -1235,7 +1263,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); -#line 167 +#line 168 await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table22, "When "); #line hidden global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { @@ -1322,6 +1350,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and "13", "0000", "SUCCESS"}); + table23.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "14", + "0000", + "SUCCESS"}); table23.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", @@ -1376,7 +1410,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "1009", "Merchant [Test Merchant 4] does not have enough credit available [100.00] to perf" + "orm transaction amount [300.00]"}); -#line 191 +#line 193 await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table23, "Then "); #line hidden global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { @@ -1443,6 +1477,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "25.00", "25.00", "35.00"}); + table24.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "10.00", + "9.00", + "35.00"}); table24.AddRow(new string[] { "Today", "Transaction Fee Processed", @@ -1483,7 +1525,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "0.00", "36.10"}); -#line 215 +#line 218 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table24, "Then "); #line hidden @@ -1535,7 +1577,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "0.00", "20.00"}); -#line 230 +#line 234 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table25, "Then "); #line hidden @@ -1587,7 +1629,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "0.00", "20.00"}); -#line 238 +#line 242 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table26, "Then "); #line hidden diff --git a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj index f28f9419..8240e1a4 100644 --- a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj +++ b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj @@ -2,7 +2,7 @@ net10.0 - Full + None false