From 5ff4eb9053974db802b0565f016be44c7896b443 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 13 Oct 2026 11:34:46 +0100 Subject: [PATCH] Fix contract transaction fee table parsing --- .../SpecflowExtensions.cs | 1 + .../Common/SpecflowExtensionsTests.cs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs b/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs index 1389e4e3..98c58acc 100644 --- a/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs +++ b/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs @@ -1121,6 +1121,7 @@ public static List ToCreateEstateRequests(this DataTableRow FeeType feeType = ReqnrollTableHelper.GetEnumValue(tableRow, "FeeType"); String feeDescription = ReqnrollTableHelper.GetStringRowValue(tableRow, "FeeDescription"); Decimal feeValue = ReqnrollTableHelper.GetDecimalValue(tableRow, "Value"); + transactionFees.Add((calculationType, feeDescription, feeValue, feeType)); } return transactionFees; diff --git a/TransactionProcessor.IntegrationTests/Common/SpecflowExtensionsTests.cs b/TransactionProcessor.IntegrationTests/Common/SpecflowExtensionsTests.cs index d34f6489..52c06896 100644 --- a/TransactionProcessor.IntegrationTests/Common/SpecflowExtensionsTests.cs +++ b/TransactionProcessor.IntegrationTests/Common/SpecflowExtensionsTests.cs @@ -40,6 +40,24 @@ public void ToSettlementFeeDetails_ReturnsEveryFeeRow() result[1].CalculatedValue.ShouldBe(0.25m); } + [Test] + public void ToContractTransactionFeeDetails_ReturnsEveryFeeRow() + { + Reqnroll.Table table = new(new[] { "CalculationType", "FeeDescription", "Value", "FeeType" }); + table.AddRow(new[] { "Fixed", "Merchant Commission", "1.00", "Merchant" }); + table.AddRow(new[] { "Percentage", "Merchant Commission", "0.015", "Merchant" }); + + List<(CalculationType, String, Decimal?, FeeType)> result = table.Rows.ToContractTransactionFeeDetails(); + + result.Count.ShouldBe(2); + result[0].Item1.ShouldBe(CalculationType.Fixed); + result[0].Item2.ShouldBe("Merchant Commission"); + result[0].Item3.ShouldBe(1.00m); + result[0].Item4.ShouldBe(FeeType.Merchant); + result[1].Item1.ShouldBe(CalculationType.Percentage); + result[1].Item3.ShouldBe(0.015m); + } + [Test] public void ToSettlementDetails_RejectsMultipleRows() {