From 342c995718bc3cfe743a2b6b9abc572ad41fbf23 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Fri, 17 Nov 2023 10:03:05 +0000 Subject: [PATCH] Fix issue with voucher redemption test due to db schema updates --- ...actionProcessor.BusinessLogic.Tests.csproj | 2 +- .../Services/VoucherDomainService.cs | 2 +- .../TransactionProcessor.BusinessLogic.csproj | 12 +- .../TransactionProcessor.Client.csproj | 2 +- ...sactionProcessor.Float.DomainEvents.csproj | 2 +- ...ctionProcessor.FloatAggregate.Tests.csproj | 2 +- ...TransactionProcessor.FloatAggregate.csproj | 2 +- .../Features/LogonTransaction.feature.cs | 544 +++++++++++- .../Features/ReconciliationFeature.feature.cs | 128 +-- .../Features/RedeemVoucher.feature.cs | 84 +- .../SaleTransactionFeature.feature.cs | 814 +++++++++--------- .../Features/Settlement.feature.cs | 238 ++--- ...ansactionProcessor.IntegrationTests.csproj | 10 +- ...Processor.ProjectionEngine.Database.csproj | 4 +- .../DomainEventHelperTests.cs | 127 --- ...ionProcessor.ProjectionEngine.Tests.csproj | 2 +- .../Common/DomainEventHelper.cs | 50 -- .../MerchantBalanceStateRepository.cs | 8 +- ...ansactionProcessor.ProjectionEngine.csproj | 12 +- ...ocessor.Reconciliation.DomainEvents.csproj | 2 +- ...essor.ReconciliationAggregate.Tests.csproj | 2 +- ...onProcessor.ReconciliationAggregate.csproj | 2 +- ...onProcessor.Settlement.DomainEvents.csproj | 2 +- ...rocessor.SettlementAggregates.Tests.csproj | 2 +- ...ctionProcessor.SettlementAggregates.csproj | 2 +- .../TransactionProcessor.Tests.csproj | 2 +- ...nProcessor.Transaction.DomainEvents.csproj | 2 +- ...rocessor.TransactionAggregate.Tests.csproj | 2 +- ...ctionProcessor.TransactionAggregate.csproj | 2 +- ...ctionProcessor.Voucher.DomainEvents.csproj | 2 +- ...ionProcessor.VoucherAggregate.Tests.csproj | 2 +- ...ansactionProcessor.VoucherAggregate.csproj | 2 +- .../Bootstrapper/RepositoryRegistry.cs | 7 +- TransactionProcessor/Extensions.cs | 4 + .../TransactionProcessor.csproj | 4 +- 35 files changed, 1232 insertions(+), 854 deletions(-) delete mode 100644 TransactionProcessor.ProjectionEngine.Tests/DomainEventHelperTests.cs delete mode 100644 TransactionProcessor.ProjectionEngine/Common/DomainEventHelper.cs diff --git a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj index 54fc638f..88c5659f 100644 --- a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj +++ b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs b/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs index c0ffd9f1..500c49a5 100644 --- a/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs @@ -146,7 +146,7 @@ public async Task RedeemVoucher(Guid estateId, await this.VoucherAggregateRepository.SaveChanges(voucherAggregate, cancellationToken); Voucher voucherModel = voucherAggregate.GetVoucher(); - + return new RedeemVoucherResponse { RemainingBalance = voucherModel.Balance, diff --git a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj index 5ba13f15..ab9353fd 100644 --- a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj +++ b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj @@ -5,13 +5,13 @@ - - + + - - - - + + + + diff --git a/TransactionProcessor.Client/TransactionProcessor.Client.csproj b/TransactionProcessor.Client/TransactionProcessor.Client.csproj index 1b661745..27bab8e0 100644 --- a/TransactionProcessor.Client/TransactionProcessor.Client.csproj +++ b/TransactionProcessor.Client/TransactionProcessor.Client.csproj @@ -6,7 +6,7 @@ - + diff --git a/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj b/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj index b772a095..d1c711e3 100644 --- a/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj +++ b/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj @@ -7,7 +7,7 @@ - + diff --git a/TransactionProcessor.FloatAggregate.Tests/TransactionProcessor.FloatAggregate.Tests.csproj b/TransactionProcessor.FloatAggregate.Tests/TransactionProcessor.FloatAggregate.Tests.csproj index 948030ba..dde9ac98 100644 --- a/TransactionProcessor.FloatAggregate.Tests/TransactionProcessor.FloatAggregate.Tests.csproj +++ b/TransactionProcessor.FloatAggregate.Tests/TransactionProcessor.FloatAggregate.Tests.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/TransactionProcessor.FloatAggregate/TransactionProcessor.FloatAggregate.csproj b/TransactionProcessor.FloatAggregate/TransactionProcessor.FloatAggregate.csproj index c9dae825..7c04c777 100644 --- a/TransactionProcessor.FloatAggregate/TransactionProcessor.FloatAggregate.csproj +++ b/TransactionProcessor.FloatAggregate/TransactionProcessor.FloatAggregate.csproj @@ -7,7 +7,7 @@ - + diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index b34d8696..0e290821 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -1 +1,543 @@ -#error Unable to use SpecFlow tools folder 'C:\Users\stuar\.nuget\packages\specflow\3.9.74\tools': Folder does not exist +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (https://www.specflow.org/). +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace TransactionProcessor.IntegrationTests.Features +{ + using TechTalk.SpecFlow; + using System; + using System.Linq; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [Xunit.TraitAttribute("Category", "base")] + [Xunit.TraitAttribute("Category", "shared")] + public partial class LogonTransactionFeature : object, Xunit.IClassFixture, System.IDisposable + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + + private static string[] featureTags = new string[] { + "base", + "shared"}; + + private Xunit.Abstractions.ITestOutputHelper _testOutputHelper; + +#line 1 "LogonTransaction.feature" +#line hidden + + public LogonTransactionFeature(LogonTransactionFeature.FixtureData fixtureData, TransactionProcessor_IntegrationTests_XUnitAssemblyFixture assemblyFixture, Xunit.Abstractions.ITestOutputHelper testOutputHelper) + { + this._testOutputHelper = testOutputHelper; + this.TestInitialize(); + } + + public static void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "LogonTransaction", null, ProgrammingLanguage.CSharp, featureTags); + testRunner.OnFeatureStart(featureInfo); + } + + public static void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + public void TestInitialize() + { + } + + public void TestTearDown() + { + testRunner.OnScenarioEnd(); + } + + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioInitialize(scenarioInfo); + testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(_testOutputHelper); + } + + public void ScenarioStart() + { + testRunner.OnScenarioStart(); + } + + public void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + public virtual void FeatureBackground() + { +#line 4 +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "Name", + "DisplayName", + "Description"}); + table1.AddRow(new string[] { + "estateManagement", + "Estate Managememt REST Scope", + "A scope for Estate Managememt REST"}); + table1.AddRow(new string[] { + "transactionProcessor", + "Transaction Processor REST Scope", + "A scope for Transaction Processor REST"}); +#line 6 + testRunner.Given("I create the following api scopes", ((string)(null)), table1, "Given "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "ResourceName", + "DisplayName", + "Secret", + "Scopes", + "UserClaims"}); + table2.AddRow(new string[] { + "estateManagement", + "Estate Managememt REST", + "Secret1", + "estateManagement", + "MerchantId, EstateId, role"}); + table2.AddRow(new string[] { + "transactionProcessor", + "Transaction Processor REST", + "Secret1", + "transactionProcessor", + ""}); +#line 11 + testRunner.Given("the following api resources exist", ((string)(null)), table2, "Given "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "ClientId", + "ClientName", + "Secret", + "AllowedScopes", + "AllowedGrantTypes"}); + table3.AddRow(new string[] { + "serviceClient", + "Service Client", + "Secret1", + "estateManagement,transactionProcessor", + "client_credentials"}); +#line 16 + testRunner.Given("the following clients exist", ((string)(null)), table3, "Given "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "ClientId"}); + table4.AddRow(new string[] { + "serviceClient"}); +#line 20 + testRunner.Given("I have a token to access the estate management and transaction processor resource" + + "s", ((string)(null)), table4, "Given "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName"}); + table5.AddRow(new string[] { + "Test Estate 1"}); +#line 24 + testRunner.Given("I have created the following estates", ((string)(null)), table5, "Given "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "OperatorName", + "RequireCustomMerchantNumber", + "RequireCustomTerminalNumber"}); + table6.AddRow(new string[] { + "Test Estate 1", + "Test Operator 1", + "True", + "True"}); +#line 28 + testRunner.Given("I have created the following operators", ((string)(null)), table6, "Given "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "MerchantName", + "AddressLine1", + "Town", + "Region", + "Country", + "ContactName", + "EmailAddress", + "EstateName"}); + table7.AddRow(new string[] { + "Test Merchant 1", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 1", + "testcontact1@merchant1.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 2", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 2", + "testcontact2@merchant2.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 3", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 3", + "testcontact3@merchant2.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 4", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 4", + "testcontact4@merchant2.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 5", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 5", + "testcontact5@merchant2.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 6", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 6", + "testcontact6@merchant2.co.uk", + "Test Estate 1"}); + table7.AddRow(new string[] { + "Test Merchant 7", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 7", + "testcontact7@merchant2.co.uk", + "Test Estate 1"}); +#line 32 + testRunner.Given("I create the following merchants", ((string)(null)), table7, "Given "); +#line hidden + TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { + "OperatorName", + "MerchantName", + "MerchantNumber", + "TerminalNumber", + "EstateName"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 1", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 2", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 3", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 4", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 5", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 6", + "00000001", + "10000001", + "Test Estate 1"}); + table8.AddRow(new string[] { + "Test Operator 1", + "Test Merchant 7", + "00000001", + "10000001", + "Test Estate 1"}); +#line 42 + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table8, "Given "); +#line hidden + } + + void System.IDisposable.Dispose() + { + this.TestTearDown(); + } + + [Xunit.SkippableFactAttribute(DisplayName="Logon Transactions")] + [Xunit.TraitAttribute("FeatureTitle", "LogonTransaction")] + [Xunit.TraitAttribute("Description", "Logon Transactions")] + [Xunit.TraitAttribute("Category", "PRTest")] + public void LogonTransactions() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Logon Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 60 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 4 +this.FeatureBackground(); +#line hidden + TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table9.AddRow(new string[] { + "Today", + "1", + "Logon", + "Test Merchant 1", + "123456780", + "Test Estate 1"}); + table9.AddRow(new string[] { + "Today", + "2", + "Logon", + "Test Merchant 2", + "123456781", + "Test Estate 1"}); + table9.AddRow(new string[] { + "Today", + "3", + "Logon", + "Test Merchant 3", + "123456782", + "Test Estate 1"}); +#line 62 + testRunner.When("I perform the following transactions", ((string)(null)), table9, "When "); +#line hidden + TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table10.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "1", + "0001", + "SUCCESS"}); + table10.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 2", + "2", + "0001", + "SUCCESS"}); + table10.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 3", + "3", + "0001", + "SUCCESS"}); +#line 68 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table10, "Then "); +#line hidden + TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { + "DeviceIdentifier", + "MerchantName", + "MerchantNumber", + "EstateName"}); + table11.AddRow(new string[] { + "123456783", + "Test Merchant 4", + "00000001", + "Test Estate 1"}); +#line 74 + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table11, "Given "); +#line hidden + TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table12.AddRow(new string[] { + "Today", + "4", + "Logon", + "Test Merchant 4", + "123456783", + "Test Estate 1"}); +#line 78 + testRunner.When("I perform the following transactions", ((string)(null)), table12, "When "); +#line hidden + TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table13.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 4", + "4", + "0000", + "SUCCESS"}); +#line 82 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table13, "Then "); +#line hidden + TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table14.AddRow(new string[] { + "Today", + "5", + "Logon", + "Test Merchant 1", + "13579135", + "Test Estate 1"}); +#line 86 + testRunner.When("I perform the following transactions", ((string)(null)), table14, "When "); +#line hidden + TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table15.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "5", + "1000", + "Device Identifier 13579135 not valid for Merchant Test Merchant 1"}); +#line 90 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table15, "Then "); +#line hidden + TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table16.AddRow(new string[] { + "Today", + "6", + "Logon", + "Test Merchant 1", + "123456785", + "InvalidEstate"}); +#line 94 + testRunner.When("I perform the following transactions", ((string)(null)), table16, "When "); +#line hidden + TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table17.AddRow(new string[] { + "InvalidEstate", + "Test Merchant 1", + "6", + "1001", + "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); +#line 98 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table17, "Then "); +#line hidden + TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table18.AddRow(new string[] { + "Today", + "7", + "Logon", + "InvalidMerchant", + "123456786", + "Test Estate 1"}); +#line 102 + testRunner.When("I perform the following transactions", ((string)(null)), table18, "When "); +#line hidden + TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table19.AddRow(new string[] { + "Test Estate 1", + "InvalidMerchant", + "7", + "1002", + "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + + "tate [Test Estate 1]"}); +#line 106 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table19, "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class FixtureData : System.IDisposable + { + + public FixtureData() + { + LogonTransactionFeature.FeatureSetup(); + } + + void System.IDisposable.Dispose() + { + LogonTransactionFeature.FeatureTearDown(); + } + } + } +} +#pragma warning restore +#endregion diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index 8339a2ec..48bef935 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -83,108 +83,108 @@ public virtual void FeatureBackground() { #line 4 #line hidden - TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table21.AddRow(new string[] { + table20.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table21.AddRow(new string[] { + table20.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); #line 6 - testRunner.Given("I create the following api scopes", ((string)(null)), table21, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table20, "Given "); #line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table22.AddRow(new string[] { + table21.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table22.AddRow(new string[] { + table21.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); #line 11 - testRunner.Given("the following api resources exist", ((string)(null)), table22, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table21, "Given "); #line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table23.AddRow(new string[] { + table22.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor", "client_credentials"}); #line 16 - testRunner.Given("the following clients exist", ((string)(null)), table23, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table22, "Given "); #line hidden - TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table24.AddRow(new string[] { + table23.AddRow(new string[] { "serviceClient"}); #line 20 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table24, "Given "); + "s", ((string)(null)), table23, "Given "); #line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table25.AddRow(new string[] { + table24.AddRow(new string[] { "Test Estate 1"}); - table25.AddRow(new string[] { + table24.AddRow(new string[] { "Test Estate 2"}); #line 24 - testRunner.Given("I have created the following estates", ((string)(null)), table25, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table24, "Given "); #line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table26.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table26.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); #line 29 - testRunner.Given("I have created the following operators", ((string)(null)), table26, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table25, "Given "); #line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table27.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table27.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); #line 34 - testRunner.Given("I create a contract with the following values", ((string)(null)), table27, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table26, "Given "); #line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -192,7 +192,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table28.AddRow(new string[] { + table27.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -200,7 +200,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table28.AddRow(new string[] { + table27.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -209,9 +209,9 @@ public virtual void FeatureBackground() "", "MobileTopup"}); #line 39 - testRunner.When("I create the following Products", ((string)(null)), table28, "When "); + testRunner.When("I create the following Products", ((string)(null)), table27, "When "); #line hidden - TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -219,7 +219,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table29.AddRow(new string[] { + table28.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "Fixed", "Merchant Commission", "2.50"}); - table29.AddRow(new string[] { + table28.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -236,9 +236,9 @@ public virtual void FeatureBackground() "Merchant Commission", "0.85"}); #line 44 - testRunner.When("I add the following Transaction Fees", ((string)(null)), table29, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table28, "When "); #line hidden - TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -247,7 +247,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table30.AddRow(new string[] { + table29.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -256,7 +256,7 @@ public virtual void FeatureBackground() "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table30.AddRow(new string[] { + table29.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -265,7 +265,7 @@ public virtual void FeatureBackground() "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table30.AddRow(new string[] { + table29.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -275,80 +275,80 @@ public virtual void FeatureBackground() "testcontact3@merchant2.co.uk", "Test Estate 2"}); #line 49 - testRunner.Given("I create the following merchants", ((string)(null)), table30, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table29, "Given "); #line hidden - TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table31.AddRow(new string[] { + table30.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table31.AddRow(new string[] { + table30.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table31.AddRow(new string[] { + table30.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 55 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table31, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table30, "Given "); #line hidden - TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table32.AddRow(new string[] { + table31.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table32.AddRow(new string[] { + table31.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table32.AddRow(new string[] { + table31.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 61 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table32, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table31, "Given "); #line hidden - TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table33.AddRow(new string[] { + table32.AddRow(new string[] { "Deposit1", "200.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table33.AddRow(new string[] { + table32.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table33.AddRow(new string[] { + table32.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 67 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table33, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table32, "Given "); #line hidden } @@ -380,28 +380,28 @@ public void ReconciliationTransactions() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "MerchantName", "DeviceIdentifier", "EstateName", "TransactionCount", "TransactionValue"}); - table34.AddRow(new string[] { + table33.AddRow(new string[] { "Today", "Test Merchant 1", "123456780", "Test Estate 1", "1", "100.00"}); - table34.AddRow(new string[] { + table33.AddRow(new string[] { "Today", "Test Merchant 2", "123456781", "Test Estate 1", "2", "200.00"}); - table34.AddRow(new string[] { + table33.AddRow(new string[] { "Today", "Test Merchant 3", "123456782", @@ -409,30 +409,30 @@ public void ReconciliationTransactions() "3", "300.00"}); #line 76 - testRunner.When("I perform the following reconciliations", ((string)(null)), table34, "When "); + testRunner.When("I perform the following reconciliations", ((string)(null)), table33, "When "); #line hidden - TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "ResponseCode", "ResponseMessage"}); - table35.AddRow(new string[] { + table34.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "0000", "SUCCESS"}); - table35.AddRow(new string[] { + table34.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "0000", "SUCCESS"}); - table35.AddRow(new string[] { + table34.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "0000", "SUCCESS"}); #line 82 - testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table35, "Then "); + testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table34, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index 7978cac1..fc44284d 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs @@ -83,99 +83,99 @@ public virtual void FeatureBackground() { #line 5 #line hidden - TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table36.AddRow(new string[] { + table35.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table36.AddRow(new string[] { + table35.AddRow(new string[] { "voucherManagement", "Voucher Management REST Scope", "A scope for Voucher Management REST"}); #line 7 - testRunner.Given("I create the following api scopes", ((string)(null)), table36, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table35, "Given "); #line hidden - TechTalk.SpecFlow.Table table37 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table37.AddRow(new string[] { + table36.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table37.AddRow(new string[] { + table36.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); #line 12 - testRunner.Given("the following api resources exist", ((string)(null)), table37, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table36, "Given "); #line hidden - TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table37 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table38.AddRow(new string[] { + table37.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,voucherManagement", "client_credentials"}); #line 17 - testRunner.Given("the following clients exist", ((string)(null)), table38, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table37, "Given "); #line hidden - TechTalk.SpecFlow.Table table39 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table39.AddRow(new string[] { + table38.AddRow(new string[] { "serviceClient"}); #line 21 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table39, "Given "); + "s", ((string)(null)), table38, "Given "); #line hidden - TechTalk.SpecFlow.Table table40 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table39 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table40.AddRow(new string[] { + table39.AddRow(new string[] { "Test Estate 1"}); - table40.AddRow(new string[] { + table39.AddRow(new string[] { "Test Estate 2"}); #line 25 - testRunner.Given("I have created the following estates", ((string)(null)), table40, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table39, "Given "); #line hidden - TechTalk.SpecFlow.Table table41 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table40 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table41.AddRow(new string[] { + table40.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); #line 30 - testRunner.Given("I have created the following operators", ((string)(null)), table41, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table40, "Given "); #line hidden - TechTalk.SpecFlow.Table table42 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table41 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table42.AddRow(new string[] { + table41.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 34 - testRunner.Given("I create a contract with the following values", ((string)(null)), table42, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table41, "Given "); #line hidden - TechTalk.SpecFlow.Table table43 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table42 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -183,7 +183,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table43.AddRow(new string[] { + table42.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -192,9 +192,9 @@ public virtual void FeatureBackground() "", "Voucher"}); #line 38 - testRunner.When("I create the following Products", ((string)(null)), table43, "When "); + testRunner.When("I create the following Products", ((string)(null)), table42, "When "); #line hidden - TechTalk.SpecFlow.Table table44 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table43 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -203,7 +203,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table44.AddRow(new string[] { + table43.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -213,50 +213,50 @@ public virtual void FeatureBackground() "testcontact1@merchant1.co.uk", "Test Estate 1"}); #line 42 - testRunner.Given("I create the following merchants", ((string)(null)), table44, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table43, "Given "); #line hidden - TechTalk.SpecFlow.Table table45 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table44 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table45.AddRow(new string[] { + table44.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); #line 46 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table45, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table44, "Given "); #line hidden - TechTalk.SpecFlow.Table table46 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table45 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table46.AddRow(new string[] { + table45.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); #line 50 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table46, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table45, "Given "); #line hidden - TechTalk.SpecFlow.Table table47 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table46 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table47.AddRow(new string[] { + table46.AddRow(new string[] { "Deposit1", "20.00", "Today", "Test Merchant 1", "Test Estate 1"}); #line 54 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table47, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table46, "Given "); #line hidden - TechTalk.SpecFlow.Table table48 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table47 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -275,7 +275,7 @@ public virtual void FeatureBackground() "MessageType", "AccountNumber", "CustomerName"}); - table48.AddRow(new string[] { + table47.AddRow(new string[] { "Today", "1", "Sale", @@ -295,7 +295,7 @@ public virtual void FeatureBackground() "", ""}); #line 58 - testRunner.When("I perform the following transactions", ((string)(null)), table48, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table47, "When "); #line hidden } diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 9c1b4f57..6b2062ae 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -83,135 +83,135 @@ public virtual void FeatureBackground() { #line 4 #line hidden - TechTalk.SpecFlow.Table table49 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table48 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table49.AddRow(new string[] { + table48.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table49.AddRow(new string[] { + table48.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table49.AddRow(new string[] { + table48.AddRow(new string[] { "voucherManagement", "Voucher Management REST Scope", "A scope for Voucher Management REST"}); - table49.AddRow(new string[] { + table48.AddRow(new string[] { "messagingService", "Scope for Messaging REST", "Scope for Messaging REST"}); #line 6 - testRunner.Given("I create the following api scopes", ((string)(null)), table49, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table48, "Given "); #line hidden - TechTalk.SpecFlow.Table table50 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table49 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table50.AddRow(new string[] { + table49.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table50.AddRow(new string[] { + table49.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); - table50.AddRow(new string[] { + table49.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); - table50.AddRow(new string[] { + table49.AddRow(new string[] { "messagingService", "Messaging REST", "Secret", "messagingService", ""}); #line 13 - testRunner.Given("the following api resources exist", ((string)(null)), table50, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table49, "Given "); #line hidden - TechTalk.SpecFlow.Table table51 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table50 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table51.AddRow(new string[] { + table50.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor,voucherManagement,messagingService", "client_credentials"}); #line 20 - testRunner.Given("the following clients exist", ((string)(null)), table51, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table50, "Given "); #line hidden - TechTalk.SpecFlow.Table table52 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table51 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table52.AddRow(new string[] { + table51.AddRow(new string[] { "serviceClient"}); #line 24 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table52, "Given "); + "s", ((string)(null)), table51, "Given "); #line hidden - TechTalk.SpecFlow.Table table53 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table52 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table53.AddRow(new string[] { + table52.AddRow(new string[] { "Test Estate 1"}); #line 28 - testRunner.Given("I have created the following estates", ((string)(null)), table53, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table52, "Given "); #line hidden - TechTalk.SpecFlow.Table table54 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table53 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table54.AddRow(new string[] { + table53.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table54.AddRow(new string[] { + table53.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table54.AddRow(new string[] { + table53.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "True", "True"}); #line 32 - testRunner.Given("I have created the following operators", ((string)(null)), table54, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table53, "Given "); #line hidden - TechTalk.SpecFlow.Table table55 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table54 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table55.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table55.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table55.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract"}); #line 38 - testRunner.Given("I create a contract with the following values", ((string)(null)), table55, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table54, "Given "); #line hidden - TechTalk.SpecFlow.Table table56 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table55 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -219,7 +219,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table56.AddRow(new string[] { + table55.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table56.AddRow(new string[] { + table55.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -235,7 +235,7 @@ public virtual void FeatureBackground() "10 KES", "", "Voucher"}); - table56.AddRow(new string[] { + table55.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -244,9 +244,9 @@ public virtual void FeatureBackground() "", "BillPayment"}); #line 44 - testRunner.When("I create the following Products", ((string)(null)), table56, "When "); + testRunner.When("I create the following Products", ((string)(null)), table55, "When "); #line hidden - TechTalk.SpecFlow.Table table57 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table56 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -254,7 +254,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table57.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -262,7 +262,7 @@ public virtual void FeatureBackground() "Percentage", "Merchant Commission", "0.50"}); - table57.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -271,9 +271,9 @@ public virtual void FeatureBackground() "Merchant Commission", "0.50"}); #line 50 - testRunner.When("I add the following Transaction Fees", ((string)(null)), table57, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table56, "When "); #line hidden - TechTalk.SpecFlow.Table table58 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table57 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -282,7 +282,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table58.AddRow(new string[] { + table57.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -291,7 +291,7 @@ public virtual void FeatureBackground() "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table58.AddRow(new string[] { + table57.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -300,7 +300,7 @@ public virtual void FeatureBackground() "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table58.AddRow(new string[] { + table57.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -309,7 +309,7 @@ public virtual void FeatureBackground() "Test Contact 3", "testcontact3@merchant3.co.uk", "Test Estate 1"}); - table58.AddRow(new string[] { + table57.AddRow(new string[] { "Test Merchant 4", "Address Line 1", "TestTown", @@ -319,157 +319,157 @@ public virtual void FeatureBackground() "testcontact4@merchant4.co.uk", "Test Estate 1"}); #line 55 - testRunner.Given("I create the following merchants", ((string)(null)), table58, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table57, "Given "); #line hidden - TechTalk.SpecFlow.Table table59 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table58 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Safaricom", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "Voucher", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table59.AddRow(new string[] { + table58.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); #line 62 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table59, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table58, "Given "); #line hidden - TechTalk.SpecFlow.Table table60 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table59 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table60.AddRow(new string[] { + table59.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table60.AddRow(new string[] { + table59.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table60.AddRow(new string[] { + table59.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 1"}); - table60.AddRow(new string[] { + table59.AddRow(new string[] { "123456783", "Test Merchant 4", "Test Estate 1"}); #line 77 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table60, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table59, "Given "); #line hidden - TechTalk.SpecFlow.Table table61 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table60 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table61.AddRow(new string[] { + table60.AddRow(new string[] { "Deposit1", "240.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table61.AddRow(new string[] { + table60.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table61.AddRow(new string[] { + table60.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 1"}); - table61.AddRow(new string[] { + table60.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 4", "Test Estate 1"}); #line 84 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table61, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table60, "Given "); #line hidden - TechTalk.SpecFlow.Table table62 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table61 = new TechTalk.SpecFlow.Table(new string[] { "AccountNumber", "AccountName", "DueDate", "Amount"}); - table62.AddRow(new string[] { + table61.AddRow(new string[] { "12345678", "Test Account 1", "Today", "100.00"}); #line 91 - testRunner.Given("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table62, "Given "); + testRunner.Given("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table61, "Given "); #line hidden } @@ -501,7 +501,7 @@ public void SaleTransactions() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table63 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table62 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -520,7 +520,7 @@ public void SaleTransactions() "MessageType", "AccountNumber", "CustomerName"}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "1", "Sale", @@ -539,7 +539,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "2", "Sale", @@ -558,7 +558,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "3", "Sale", @@ -577,7 +577,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "4", "Sale", @@ -596,7 +596,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "5", "Sale", @@ -615,7 +615,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "6", "Sale", @@ -634,7 +634,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "7", "Sale", @@ -653,7 +653,7 @@ public void SaleTransactions() "", "", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "8", "Sale", @@ -672,7 +672,7 @@ public void SaleTransactions() "VerifyAccount", "12345678", ""}); - table63.AddRow(new string[] { + table62.AddRow(new string[] { "Today", "9", "Sale", @@ -692,331 +692,143 @@ public void SaleTransactions() "12345678", "Mr Test Customer"}); #line 98 - testRunner.When("I perform the following transactions", ((string)(null)), table63, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table62, "When "); #line hidden - TechTalk.SpecFlow.Table table64 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table63 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "8", "0000", "SUCCESS"}); - table64.AddRow(new string[] { + table63.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "9", "0000", "SUCCESS"}); #line 110 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table64, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table63, "Then "); +#line hidden + TechTalk.SpecFlow.Table table64 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber"}); + table64.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "1"}); +#line 122 + testRunner.When("I request the receipt is resent", ((string)(null)), table64, "When "); #line hidden TechTalk.SpecFlow.Table table65 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", - "Reference", - "EntryType", - "In", - "Out", - "ChangeAmount", - "Balance"}); - table65.AddRow(new string[] { - "Today", - "Merchant Deposit", - "C", - "240.00", - "0.00", - "240.00", - "230.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "110.00", - "110.00", - "130.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "90.00", - "90.00", - "30.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "10.00", - "10.00", - "20.00"}); + "TransactionNumber", + "TransactionType", + "TransactionSource", + "MerchantName", + "DeviceIdentifier", + "EstateName", + "OperatorName", + "TransactionAmount", + "CustomerAccountNumber", + "CustomerEmailAddress", + "ContractDescription", + "ProductName"}); table65.AddRow(new string[] { "Today", - "Transaction Completed", - "D", - "0.00", - "20.00", - "20.00", - "20.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Fee Processed", - "C", - "0.00", - "0.55", - "0.55", - "20.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Fee Processed", - "C", - "0.00", - "0.45", - "0.45", - "20.00"}); - table65.AddRow(new string[] { - "Today", - "Transaction Fee Processed", - "C", - "0.00", - "0.01", - "0.10", - "20.00"}); - table65.AddRow(new string[] { - "Today", - "Opening Balance", - "C", - "0.00", - "0.00", - "0.00", - "20.00"}); -#line 122 - testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table65, "Then "); -#line hidden - TechTalk.SpecFlow.Table table66 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "Reference", - "EntryType", - "In", - "Out", - "ChangeAmount", - "Balance"}); - table66.AddRow(new string[] { - "Today", - "Merchant Deposit", - "C", - "110.00", - "0.00", - "110.00", - "230.00"}); - table66.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "100.00", - "100.00", - "130.00"}); - table66.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "10.00", - "10.00", - "30.00"}); - table66.AddRow(new string[] { - "Today", - "Transaction Fee Processed", - "C", - "0.00", - "0.50", - "0.50", - "20.00"}); - table66.AddRow(new string[] { - "Today", - "Opening Balance", - "C", - "0.00", - "0.00", - "0.00", - "20.00"}); -#line 135 - testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table66, "Then "); -#line hidden - TechTalk.SpecFlow.Table table67 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "Reference", - "EntryType", - "In", - "Out", - "ChangeAmount", - "Balance"}); - table67.AddRow(new string[] { - "Today", - "Merchant Deposit", - "C", - "110.00", - "0.00", - "110.00", - "230.00"}); - table67.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "100.00", - "100.00", - "130.00"}); - table67.AddRow(new string[] { - "Today", - "Transaction Completed", - "D", - "0.00", - "10.00", - "10.00", - "30.00"}); - table67.AddRow(new string[] { - "Today", - "Transaction Fee Processed", - "C", - "0.00", - "0.85", - "0.50", - "20.00"}); - table67.AddRow(new string[] { - "Today", - "Opening Balance", - "C", - "0.00", - "0.00", - "0.00", - "20.00"}); -#line 143 - testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table67, "Then "); -#line hidden - TechTalk.SpecFlow.Table table68 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber"}); - table68.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1"}); -#line 151 - testRunner.When("I request the receipt is resent", ((string)(null)), table68, "When "); -#line hidden - TechTalk.SpecFlow.Table table69 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "TransactionSource", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table69.AddRow(new string[] { - "Today", - "10", - "Sale", - "1", - "Test Merchant 1", - "123456781", - "Test Estate 1", - "Safaricom", - "100.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 155 - testRunner.When("I perform the following transactions", ((string)(null)), table69, "When "); -#line hidden - TechTalk.SpecFlow.Table table70 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table70.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "10", - "1000", - "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); -#line 159 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table70, "Then "); -#line hidden - TechTalk.SpecFlow.Table table71 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "TransactionSource", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table71.AddRow(new string[] { + "10", + "Sale", + "1", + "Test Merchant 1", + "123456781", + "Test Estate 1", + "Safaricom", + "100.00", + "123456789", + "testcustomer@customer.co.uk", + "Safaricom Contract", + "Variable Topup"}); +#line 126 + testRunner.When("I perform the following transactions", ((string)(null)), table65, "When "); +#line hidden + TechTalk.SpecFlow.Table table66 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table66.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "10", + "1000", + "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); +#line 130 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table66, "Then "); +#line hidden + TechTalk.SpecFlow.Table table67 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "TransactionSource", + "MerchantName", + "DeviceIdentifier", + "EstateName", + "OperatorName", + "TransactionAmount", + "CustomerAccountNumber", + "CustomerEmailAddress", + "ContractDescription", + "ProductName"}); + table67.AddRow(new string[] { "Today", "11", "Sale", @@ -1030,25 +842,25 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 163 - testRunner.When("I perform the following transactions", ((string)(null)), table71, "When "); +#line 134 + testRunner.When("I perform the following transactions", ((string)(null)), table67, "When "); #line hidden - TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table68 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table72.AddRow(new string[] { + table68.AddRow(new string[] { "InvalidEstate", "Test Merchant 1", "11", "1001", "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); -#line 167 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table72, "Then "); +#line 138 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table68, "Then "); #line hidden - TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table69 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1062,7 +874,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table73.AddRow(new string[] { + table69.AddRow(new string[] { "Today", "12", "Sale", @@ -1076,26 +888,26 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 171 - testRunner.When("I perform the following transactions", ((string)(null)), table73, "When "); +#line 142 + testRunner.When("I perform the following transactions", ((string)(null)), table69, "When "); #line hidden - TechTalk.SpecFlow.Table table74 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table70 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table74.AddRow(new string[] { + table70.AddRow(new string[] { "Test Estate 1", "InvalidMerchant", "12", "1002", "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + "tate [Test Estate 1]"}); -#line 175 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table74, "Then "); +#line 146 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table70, "Then "); #line hidden - TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table71 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1109,7 +921,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table75.AddRow(new string[] { + table71.AddRow(new string[] { "Today", "13", "Sale", @@ -1123,26 +935,26 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "EmptyContract", "Variable Topup"}); -#line 179 - testRunner.When("I perform the following transactions", ((string)(null)), table75, "When "); +#line 150 + testRunner.When("I perform the following transactions", ((string)(null)), table71, "When "); #line hidden - TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table76.AddRow(new string[] { + table72.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "13", "1012", "Contract Id [00000000-0000-0000-0000-000000000000] must be set for a sale transac" + "tion"}); -#line 183 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table76, "Then "); +#line 154 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table72, "Then "); #line hidden - TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1156,7 +968,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table77.AddRow(new string[] { + table73.AddRow(new string[] { "Today", "14", "Sale", @@ -1170,26 +982,26 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "InvalidContract", "Variable Topup"}); -#line 187 - testRunner.When("I perform the following transactions", ((string)(null)), table77, "When "); +#line 158 + testRunner.When("I perform the following transactions", ((string)(null)), table73, "When "); #line hidden - TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table74 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table78.AddRow(new string[] { + table74.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "14", "1015", "Contract Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test M" + "erchant 1]"}); -#line 191 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table78, "Then "); +#line 162 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table74, "Then "); #line hidden - TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1203,7 +1015,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table79.AddRow(new string[] { + table75.AddRow(new string[] { "Today", "15", "Sale", @@ -1217,26 +1029,26 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "Safaricom Contract", "EmptyProduct"}); -#line 195 - testRunner.When("I perform the following transactions", ((string)(null)), table79, "When "); +#line 166 + testRunner.When("I perform the following transactions", ((string)(null)), table75, "When "); #line hidden - TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table80.AddRow(new string[] { + table76.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "15", "1013", "Product Id [00000000-0000-0000-0000-000000000000] must be set for a sale transact" + "ion"}); -#line 199 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table80, "Then "); +#line 170 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table76, "Then "); #line hidden - TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1250,7 +1062,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table81.AddRow(new string[] { + table77.AddRow(new string[] { "Today", "16", "Sale", @@ -1264,26 +1076,26 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "Safaricom Contract", "InvalidProduct"}); -#line 203 - testRunner.When("I perform the following transactions", ((string)(null)), table81, "When "); +#line 174 + testRunner.When("I perform the following transactions", ((string)(null)), table77, "When "); #line hidden - TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table82.AddRow(new string[] { + table78.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "16", "1016", "Product Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Me" + "rchant 1]"}); -#line 207 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table82, "Then "); +#line 178 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table78, "Then "); #line hidden - TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1297,7 +1109,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table83.AddRow(new string[] { + table79.AddRow(new string[] { "Today", "17", "Sale", @@ -1311,24 +1123,212 @@ public void SaleTransactions() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 211 - testRunner.When("I perform the following transactions", ((string)(null)), table83, "When "); +#line 182 + testRunner.When("I perform the following transactions", ((string)(null)), table79, "When "); #line hidden - TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table84.AddRow(new string[] { + table80.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "17", "1009", "Merchant [Test Merchant 4] does not have enough credit available [100.00] to perf" + "orm transaction amount [300.00]"}); -#line 215 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table84, "Then "); +#line 186 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table80, "Then "); +#line hidden + TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "Reference", + "EntryType", + "In", + "Out", + "ChangeAmount", + "Balance"}); + table81.AddRow(new string[] { + "Today", + "Merchant Deposit", + "C", + "240.00", + "0.00", + "240.00", + "230.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "110.00", + "110.00", + "130.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "90.00", + "90.00", + "30.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "10.00", + "10.00", + "20.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "20.00", + "20.00", + "20.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Fee Processed", + "C", + "0.00", + "0.55", + "0.55", + "20.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Fee Processed", + "C", + "0.00", + "0.45", + "0.45", + "20.00"}); + table81.AddRow(new string[] { + "Today", + "Transaction Fee Processed", + "C", + "0.00", + "0.01", + "0.10", + "20.00"}); + table81.AddRow(new string[] { + "Today", + "Opening Balance", + "C", + "0.00", + "0.00", + "0.00", + "20.00"}); +#line 190 + testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + + "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table81, "Then "); +#line hidden + TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "Reference", + "EntryType", + "In", + "Out", + "ChangeAmount", + "Balance"}); + table82.AddRow(new string[] { + "Today", + "Merchant Deposit", + "C", + "110.00", + "0.00", + "110.00", + "230.00"}); + table82.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "100.00", + "100.00", + "130.00"}); + table82.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "10.00", + "10.00", + "30.00"}); + table82.AddRow(new string[] { + "Today", + "Transaction Fee Processed", + "C", + "0.00", + "0.50", + "0.50", + "20.00"}); + table82.AddRow(new string[] { + "Today", + "Opening Balance", + "C", + "0.00", + "0.00", + "0.00", + "20.00"}); +#line 202 + testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + + "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table82, "Then "); +#line hidden + TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "Reference", + "EntryType", + "In", + "Out", + "ChangeAmount", + "Balance"}); + table83.AddRow(new string[] { + "Today", + "Merchant Deposit", + "C", + "110.00", + "0.00", + "110.00", + "230.00"}); + table83.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "100.00", + "100.00", + "130.00"}); + table83.AddRow(new string[] { + "Today", + "Transaction Completed", + "D", + "0.00", + "10.00", + "10.00", + "30.00"}); + table83.AddRow(new string[] { + "Today", + "Transaction Fee Processed", + "C", + "0.00", + "0.85", + "0.50", + "20.00"}); + table83.AddRow(new string[] { + "Today", + "Opening Balance", + "C", + "0.00", + "0.00", + "0.00", + "20.00"}); +#line 210 + testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + + "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table83, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 0fb695f7..58bf28a1 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs @@ -83,116 +83,116 @@ public virtual void FeatureBackground() { #line 4 #line hidden - TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table85.AddRow(new string[] { + table84.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table85.AddRow(new string[] { + table84.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table85.AddRow(new string[] { + table84.AddRow(new string[] { "voucherManagement", "Voucher Management REST Scope", "A scope for Voucher Management REST"}); #line 6 - testRunner.Given("I create the following api scopes", ((string)(null)), table85, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table84, "Given "); #line hidden - TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table86.AddRow(new string[] { + table85.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table86.AddRow(new string[] { + table85.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); - table86.AddRow(new string[] { + table85.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); #line 12 - testRunner.Given("the following api resources exist", ((string)(null)), table86, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table85, "Given "); #line hidden - TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table87.AddRow(new string[] { + table86.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor,voucherManagement", "client_credentials"}); #line 18 - testRunner.Given("the following clients exist", ((string)(null)), table87, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table86, "Given "); #line hidden - TechTalk.SpecFlow.Table table88 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table88.AddRow(new string[] { + table87.AddRow(new string[] { "serviceClient"}); #line 22 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table88, "Given "); + "s", ((string)(null)), table87, "Given "); #line hidden - TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table88 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table89.AddRow(new string[] { + table88.AddRow(new string[] { "Test Estate 1"}); #line 26 - testRunner.Given("I have created the following estates", ((string)(null)), table89, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table88, "Given "); #line hidden - TechTalk.SpecFlow.Table table90 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table90.AddRow(new string[] { + table89.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table90.AddRow(new string[] { + table89.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); #line 30 - testRunner.Given("I have created the following operators", ((string)(null)), table90, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table89, "Given "); #line hidden - TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table90 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table91.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table91.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 35 - testRunner.Given("I create a contract with the following values", ((string)(null)), table91, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table90, "Given "); #line hidden - TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -200,7 +200,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table92.AddRow(new string[] { + table91.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -208,7 +208,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table92.AddRow(new string[] { + table91.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -217,9 +217,9 @@ public virtual void FeatureBackground() "", "Voucher"}); #line 40 - testRunner.When("I create the following Products", ((string)(null)), table92, "When "); + testRunner.When("I create the following Products", ((string)(null)), table91, "When "); #line hidden - TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table93.AddRow(new string[] { + table92.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -236,7 +236,7 @@ public virtual void FeatureBackground() "Merchant Commission", "2.50"}); #line 45 - testRunner.When("I add the following Transaction Fees", ((string)(null)), table93, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table92, "When "); #line hidden } @@ -266,7 +266,7 @@ public void GetPendingSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -276,7 +276,7 @@ public void GetPendingSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table94.AddRow(new string[] { + table93.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -286,7 +286,7 @@ public void GetPendingSettlement() "testcontact1@merchant1.co.uk", "Test Estate 1", "Immediate"}); - table94.AddRow(new string[] { + table93.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -296,7 +296,7 @@ public void GetPendingSettlement() "testcontact2@merchant2.co.uk", "Test Estate 1", "Weekly"}); - table94.AddRow(new string[] { + table93.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -307,100 +307,100 @@ public void GetPendingSettlement() "Test Estate 1", "Monthly"}); #line 50 - testRunner.Given("I create the following merchants", ((string)(null)), table94, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table93, "Given "); #line hidden - TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table95.AddRow(new string[] { + table94.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); #line 56 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table95, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table94, "Given "); #line hidden - TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table96.AddRow(new string[] { + table95.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table96.AddRow(new string[] { + table95.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table96.AddRow(new string[] { + table95.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 1"}); #line 65 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table96, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table95, "Given "); #line hidden - TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table97.AddRow(new string[] { + table96.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table97.AddRow(new string[] { + table96.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table97.AddRow(new string[] { + table96.AddRow(new string[] { "Deposit1", "120.00", "Today", "Test Merchant 3", "Test Estate 1"}); #line 71 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table97, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table96, "Given "); #line hidden - TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -416,7 +416,7 @@ public void GetPendingSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -432,7 +432,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -448,7 +448,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -464,7 +464,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -480,7 +480,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -496,7 +496,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -512,7 +512,7 @@ public void GetPendingSettlement() "10 KES", "", "123456789"}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "7", "Sale", @@ -528,7 +528,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table98.AddRow(new string[] { + table97.AddRow(new string[] { "2022-01-06", "8", "Sale", @@ -545,95 +545,95 @@ public void GetPendingSettlement() "test@recipient.co.uk", ""}); #line 77 - testRunner.When("I perform the following transactions", ((string)(null)), table98, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table97, "When "); #line hidden - TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table99.AddRow(new string[] { + table98.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "8", "0000", "SUCCESS"}); #line 88 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table99, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table98, "Then "); #line hidden - TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table100.AddRow(new string[] { + table99.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); - table100.AddRow(new string[] { + table99.AddRow(new string[] { "2022-02-06", "Test Estate 1", "Test Merchant 3", "1"}); #line 99 - testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table100, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table99, "When "); #line hidden - TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table101.AddRow(new string[] { + table100.AddRow(new string[] { "2022-01-06", "Test Estate 1", "Test Merchant 1", "2"}); #line 104 - testRunner.When("I get the completed settlements the following information should be returned", ((string)(null)), table101, "When "); + testRunner.When("I get the completed settlements the following information should be returned", ((string)(null)), table100, "When "); #line hidden } this.ScenarioCleanup(); @@ -662,7 +662,7 @@ public void ProcessSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -672,7 +672,7 @@ public void ProcessSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table102.AddRow(new string[] { + table101.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -682,7 +682,7 @@ public void ProcessSettlement() "testcontact1@merchant1.co.uk", "Test Estate 1", "Immediate"}); - table102.AddRow(new string[] { + table101.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -693,78 +693,78 @@ public void ProcessSettlement() "Test Estate 1", "Weekly"}); #line 110 - testRunner.Given("I create the following merchants", ((string)(null)), table102, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table101, "Given "); #line hidden - TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table103.AddRow(new string[] { + table102.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table103.AddRow(new string[] { + table102.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table103.AddRow(new string[] { + table102.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table103.AddRow(new string[] { + table102.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); #line 115 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table103, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table102, "Given "); #line hidden - TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table104.AddRow(new string[] { + table103.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table104.AddRow(new string[] { + table103.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); #line 122 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table104, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table103, "Given "); #line hidden - TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table105.AddRow(new string[] { + table104.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table105.AddRow(new string[] { + table104.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); #line 127 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table105, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table104, "Given "); #line hidden - TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -780,7 +780,7 @@ public void ProcessSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table106.AddRow(new string[] { + table105.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -796,7 +796,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table106.AddRow(new string[] { + table105.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -812,7 +812,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table106.AddRow(new string[] { + table105.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -828,7 +828,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table106.AddRow(new string[] { + table105.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -844,7 +844,7 @@ public void ProcessSettlement() "10 KES", "test@recipient.co.uk", ""}); - table106.AddRow(new string[] { + table105.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -861,59 +861,59 @@ public void ProcessSettlement() "", "123456789"}); #line 132 - testRunner.When("I perform the following transactions", ((string)(null)), table106, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table105, "When "); #line hidden - TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table107.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table107.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table107.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table107.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table107.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); #line 140 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table107, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table106, "Then "); #line hidden - TechTalk.SpecFlow.Table table108 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table108.AddRow(new string[] { + table107.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); #line 148 - testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table108, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table107, "When "); #line hidden #line 152 testRunner.When("I process the settlement for \'2022-01-13\' on Estate \'Test Estate 1\' for Merchant " + diff --git a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj index b7317ccc..cb6b114a 100644 --- a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj +++ b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj @@ -7,15 +7,15 @@ - + - + - - - + + + diff --git a/TransactionProcessor.ProjectionEngine.Database/TransactionProcessor.ProjectionEngine.Database.csproj b/TransactionProcessor.ProjectionEngine.Database/TransactionProcessor.ProjectionEngine.Database.csproj index 335cf4f6..e98fb318 100644 --- a/TransactionProcessor.ProjectionEngine.Database/TransactionProcessor.ProjectionEngine.Database.csproj +++ b/TransactionProcessor.ProjectionEngine.Database/TransactionProcessor.ProjectionEngine.Database.csproj @@ -10,9 +10,9 @@ - + - + all diff --git a/TransactionProcessor.ProjectionEngine.Tests/DomainEventHelperTests.cs b/TransactionProcessor.ProjectionEngine.Tests/DomainEventHelperTests.cs deleted file mode 100644 index 8200c465..00000000 --- a/TransactionProcessor.ProjectionEngine.Tests/DomainEventHelperTests.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TransactionProcessor.ProjectionEngine.Tests -{ - using Common; - using EstateManagement.Merchant.DomainEvents; - using Microsoft.Identity.Client; - using Moq; - using NLog; - using Repository; - using Shared.DomainDrivenDesign.EventSourcing; - using Shouldly; - using State; - using TransactionProcessor.ProjectionEngine.Dispatchers; - using TransactionProcessor.Transaction.DomainEvents; - - public class DomainEventHelperTests - { - [Theory] - [InlineData("MerchantId",true)] - [InlineData("MissingMerchantId", false)] - public void DomainEventHelper_HasProperty_ResultAsExpected(String propertyName, Boolean expectedResult){ - Boolean result = DomainEventHelper.HasProperty(TestData.MerchantCreatedEvent, propertyName); - result.ShouldBe(expectedResult); - } - - [Theory] - [InlineData("EstateId", true, "C81CD4E6-1F3B-431F-AA63-0ACAB7BC0CD3")] - [InlineData("estateid", true, "C81CD4E6-1F3B-431F-AA63-0ACAB7BC0CD3")] - [InlineData("EstateId", false,"C81CD4E6-1F3B-431F-AA63-0ACAB7BC0CD3")] - [InlineData("estateid", false,"00000000-0000-0000-0000-000000000000")] - public void DomainEventHelper_GetProperty_ResultAsExpected(String property, Boolean ignoreCase, String expectedValue) - { - Guid estateId = DomainEventHelper.GetProperty(TestData.MerchantCreatedEvent, property, ignoreCase); - estateId.ShouldBe(Guid.Parse(expectedValue)); - } - - [Fact] - public void DomainEventHelper_GetEstateId_ResultAsExpected(){ - Guid estateId = DomainEventHelper.GetEstateId(TestData.MerchantCreatedEvent); - estateId.ShouldBe(TestData.MerchantCreatedEvent.EstateId); - } - - [Fact] - public void DomainEventHelper_GetMerchantId_ResultAsExpected() - { - Guid merchantId = DomainEventHelper.GetMerchantId(TestData.MerchantCreatedEvent); - merchantId.ShouldBe(TestData.MerchantCreatedEvent.MerchantId); - } - } - - public class MerchantBalanceStateDispatcherTests{ - - [Theory] - [InlineData(typeof(MerchantCreatedEvent))] - [InlineData(typeof(ManualDepositMadeEvent))] - [InlineData(typeof(AutomaticDepositMadeEvent))] - [InlineData(typeof(WithdrawalMadeEvent))] - [InlineData(typeof(TransactionHasStartedEvent))] - [InlineData(typeof(TransactionHasBeenCompletedEvent))] - [InlineData(typeof(SettledMerchantFeeAddedToTransactionEvent))] - [InlineData(typeof(AddressAddedEvent))] - public async Task MerchantBalanceStateDispatcher_Dispatch_EventHandled(Type eventType) - { - Mock repo = new Mock(); - MerchantBalanceStateDispatcher dispatcher = new MerchantBalanceStateDispatcher(repo.Object); - - MerchantBalanceState state = new MerchantBalanceState(); - - IDomainEvent domainEvent = eventType switch{ - _ when eventType == typeof(MerchantCreatedEvent) => TestData.MerchantCreatedEvent, - _ when eventType == typeof(ManualDepositMadeEvent) => TestData.ManualDepositMadeEvent, - _ when eventType == typeof(WithdrawalMadeEvent) => TestData.WithdrawalMadeEvent, - _ when eventType == typeof(AutomaticDepositMadeEvent) => TestData.AutomaticDepositMadeEvent, - _ when eventType == typeof(TransactionHasStartedEvent) => TestData.GetTransactionHasStartedEvent(), - _ when eventType == typeof(TransactionHasBeenCompletedEvent) => TestData.GetTransactionHasBeenCompletedEvent(), - _ when eventType == typeof(SettledMerchantFeeAddedToTransactionEvent) => TestData.GetSettledMerchantFeeAddedToTransactionEvent(), - _ => TestData.AddressAddedEvent - }; - - await dispatcher.Dispatch(state, domainEvent, CancellationToken.None); - } - - [Fact] - public async Task MerchantBalanceStateDispatcher_Dispatch_TransactionHasBeenCompletedEvent_NotAuthorised_EventHandled() - { - Mock repo = new Mock(); - MerchantBalanceStateDispatcher dispatcher = new MerchantBalanceStateDispatcher(repo.Object); - - MerchantBalanceState state = new MerchantBalanceState(); - - TransactionHasBeenCompletedEvent domainEvent = TestData.GetTransactionHasBeenCompletedEvent(false); - - await dispatcher.Dispatch(state, domainEvent, CancellationToken.None); - } - - [Fact] - public async Task MerchantBalanceStateDispatcher_Dispatch_TransactionHasBeenCompletedEvent_NoAmount_EventHandled() - { - Mock repo = new Mock(); - MerchantBalanceStateDispatcher dispatcher = new MerchantBalanceStateDispatcher(repo.Object); - - MerchantBalanceState state = new MerchantBalanceState(); - - TransactionHasBeenCompletedEvent domainEvent = TestData.GetTransactionHasBeenCompletedEvent(true, 0); - - await dispatcher.Dispatch(state, domainEvent, CancellationToken.None); - } - - [Fact] - public async Task MerchantBalanceStateDispatcher_Dispatch_TransactionHasBeenCompletedEvent_NegativeAmount_EventHandled() - { - Mock repo = new Mock(); - MerchantBalanceStateDispatcher dispatcher = new MerchantBalanceStateDispatcher(repo.Object); - - MerchantBalanceState state = new MerchantBalanceState(); - - TransactionHasBeenCompletedEvent domainEvent = TestData.GetTransactionHasBeenCompletedEvent(true, -1); - - await dispatcher.Dispatch(state, domainEvent, CancellationToken.None); - } - } -} diff --git a/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj b/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj index e66c41ba..3ac3eac3 100644 --- a/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj +++ b/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/TransactionProcessor.ProjectionEngine/Common/DomainEventHelper.cs b/TransactionProcessor.ProjectionEngine/Common/DomainEventHelper.cs deleted file mode 100644 index cd1c8747..00000000 --- a/TransactionProcessor.ProjectionEngine/Common/DomainEventHelper.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace TransactionProcessor.ProjectionEngine.Common; - -using System.Reflection; -using Shared.DomainDrivenDesign.EventSourcing; - -public static class DomainEventHelper -{ - public static Boolean HasProperty(IDomainEvent domainEvent, - String propertyName) - { - PropertyInfo propertyInfo = domainEvent.GetType() - .GetProperties() - .SingleOrDefault(p => p.Name == propertyName); - - return propertyInfo != null; - } - - public static T GetProperty(IDomainEvent domainEvent, String propertyName, Boolean ignoreCase=false) - { - try{ - PropertyInfo propertyInfo = null; - PropertyInfo[] properties = domainEvent.GetType() - .GetProperties(); - if (ignoreCase) - { - propertyInfo = properties.SingleOrDefault(p => String.Compare(p.Name, propertyName, StringComparison.CurrentCultureIgnoreCase) == 0); - } - else{ - propertyInfo = properties.SingleOrDefault(p => p.Name == propertyName); - } - - if (propertyInfo != null) - { - return (T)propertyInfo.GetValue(domainEvent); - } - } - catch - { - // ignored - } - - return default(T); - } - - public static Guid GetEstateId(IDomainEvent domainEvent) => DomainEventHelper.GetProperty(domainEvent, "EstateId"); - - - public static Guid GetMerchantId(IDomainEvent domainEvent) => DomainEventHelper.GetProperty(domainEvent, "MerchantId"); - -} \ No newline at end of file diff --git a/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs b/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs index 3ef086f2..6d5fd772 100644 --- a/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs +++ b/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs @@ -36,10 +36,14 @@ public static Event Create(String type, }; } + public static Guid GetEstateId(IDomainEvent domainEvent) => DomainEventHelper.GetProperty(domainEvent, "EstateId"); + + public static Guid GetMerchantId(IDomainEvent domainEvent) => DomainEventHelper.GetProperty(domainEvent, "MerchantId"); + public async Task Load(IDomainEvent @event, CancellationToken cancellationToken) { - Guid estateId = DomainEventHelper.GetEstateId(@event); - Guid merchantId = DomainEventHelper.GetMerchantId(@event); + Guid estateId = GetEstateId(@event); + Guid merchantId = GetMerchantId(@event); return await this.LoadHelper(estateId, merchantId, cancellationToken); } diff --git a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj index b82a24c6..0f1ea475 100644 --- a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj +++ b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj @@ -7,13 +7,13 @@ - - - - + + + + - - + + diff --git a/TransactionProcessor.Reconciliation.DomainEvents/TransactionProcessor.Reconciliation.DomainEvents.csproj b/TransactionProcessor.Reconciliation.DomainEvents/TransactionProcessor.Reconciliation.DomainEvents.csproj index 6feea9e2..41d313fd 100644 --- a/TransactionProcessor.Reconciliation.DomainEvents/TransactionProcessor.Reconciliation.DomainEvents.csproj +++ b/TransactionProcessor.Reconciliation.DomainEvents/TransactionProcessor.Reconciliation.DomainEvents.csproj @@ -5,6 +5,6 @@ - + diff --git a/TransactionProcessor.ReconciliationAggregate.Tests/TransactionProcessor.ReconciliationAggregate.Tests.csproj b/TransactionProcessor.ReconciliationAggregate.Tests/TransactionProcessor.ReconciliationAggregate.Tests.csproj index eb87e148..c5e2c5dc 100644 --- a/TransactionProcessor.ReconciliationAggregate.Tests/TransactionProcessor.ReconciliationAggregate.Tests.csproj +++ b/TransactionProcessor.ReconciliationAggregate.Tests/TransactionProcessor.ReconciliationAggregate.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/TransactionProcessor.ReconciliationAggregate/TransactionProcessor.ReconciliationAggregate.csproj b/TransactionProcessor.ReconciliationAggregate/TransactionProcessor.ReconciliationAggregate.csproj index 9c69a92b..781b7e2d 100644 --- a/TransactionProcessor.ReconciliationAggregate/TransactionProcessor.ReconciliationAggregate.csproj +++ b/TransactionProcessor.ReconciliationAggregate/TransactionProcessor.ReconciliationAggregate.csproj @@ -6,7 +6,7 @@ - + diff --git a/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj b/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj index bd44cc77..b405a3c1 100644 --- a/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj +++ b/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj @@ -5,7 +5,7 @@ - + diff --git a/TransactionProcessor.SettlementAggregates.Tests/TransactionProcessor.SettlementAggregates.Tests.csproj b/TransactionProcessor.SettlementAggregates.Tests/TransactionProcessor.SettlementAggregates.Tests.csproj index 61262386..659a9f15 100644 --- a/TransactionProcessor.SettlementAggregates.Tests/TransactionProcessor.SettlementAggregates.Tests.csproj +++ b/TransactionProcessor.SettlementAggregates.Tests/TransactionProcessor.SettlementAggregates.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/TransactionProcessor.SettlementAggregates/TransactionProcessor.SettlementAggregates.csproj b/TransactionProcessor.SettlementAggregates/TransactionProcessor.SettlementAggregates.csproj index b921d5e6..463276b3 100644 --- a/TransactionProcessor.SettlementAggregates/TransactionProcessor.SettlementAggregates.csproj +++ b/TransactionProcessor.SettlementAggregates/TransactionProcessor.SettlementAggregates.csproj @@ -6,7 +6,7 @@ - + diff --git a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj index 6f5864b3..31b52633 100644 --- a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj +++ b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj b/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj index a6895512..5cd96feb 100644 --- a/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj +++ b/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj @@ -5,7 +5,7 @@ - + diff --git a/TransactionProcessor.TransactionAggregate.Tests/TransactionProcessor.TransactionAggregate.Tests.csproj b/TransactionProcessor.TransactionAggregate.Tests/TransactionProcessor.TransactionAggregate.Tests.csproj index f647f333..c2855487 100644 --- a/TransactionProcessor.TransactionAggregate.Tests/TransactionProcessor.TransactionAggregate.Tests.csproj +++ b/TransactionProcessor.TransactionAggregate.Tests/TransactionProcessor.TransactionAggregate.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/TransactionProcessor.TransactionAgrgegate/TransactionProcessor.TransactionAggregate.csproj b/TransactionProcessor.TransactionAgrgegate/TransactionProcessor.TransactionAggregate.csproj index 9317bf18..9aa86860 100644 --- a/TransactionProcessor.TransactionAgrgegate/TransactionProcessor.TransactionAggregate.csproj +++ b/TransactionProcessor.TransactionAgrgegate/TransactionProcessor.TransactionAggregate.csproj @@ -6,7 +6,7 @@ - + diff --git a/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj b/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj index 9ddde812..5636eb69 100644 --- a/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj +++ b/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj @@ -7,6 +7,6 @@ - + diff --git a/TransactionProcessor.VoucherAggregate.Tests/TransactionProcessor.VoucherAggregate.Tests.csproj b/TransactionProcessor.VoucherAggregate.Tests/TransactionProcessor.VoucherAggregate.Tests.csproj index 3df94791..c866048d 100644 --- a/TransactionProcessor.VoucherAggregate.Tests/TransactionProcessor.VoucherAggregate.Tests.csproj +++ b/TransactionProcessor.VoucherAggregate.Tests/TransactionProcessor.VoucherAggregate.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/TransactionProcessor.VoucherAggregate/TransactionProcessor.VoucherAggregate.csproj b/TransactionProcessor.VoucherAggregate/TransactionProcessor.VoucherAggregate.csproj index b7c1c833..c5e5dac7 100644 --- a/TransactionProcessor.VoucherAggregate/TransactionProcessor.VoucherAggregate.csproj +++ b/TransactionProcessor.VoucherAggregate/TransactionProcessor.VoucherAggregate.csproj @@ -8,7 +8,7 @@ - + diff --git a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs index 75efb075..4437d184 100644 --- a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs +++ b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs @@ -33,6 +33,7 @@ using ProjectionEngine.Database.Database; using ProjectionEngine.Repository; using ProjectionEngine.State; + using Shared.EventStore.SubscriptionWorker; /// /// @@ -75,7 +76,7 @@ public RepositoryRegistry() } }; - this.AddEventStoreProjectionManagerClient(Startup.ConfigureEventStoreSettings); + this.AddEventStoreProjectionManagementClient(Startup.ConfigureEventStoreSettings); this.AddEventStorePersistentSubscriptionsClient(Startup.ConfigureEventStoreSettings); if (insecureES) @@ -135,6 +136,10 @@ public RepositoryRegistry() NotSupportedException($"Unsupported Database Engine {databaseEngine}") }; }); + + this.AddSingleton>(cont => (esConnString, cacheDuration) => { + return SubscriptionRepository.Create(esConnString, cacheDuration); + }); } #endregion diff --git a/TransactionProcessor/Extensions.cs b/TransactionProcessor/Extensions.cs index cf706dc6..4a26d729 100644 --- a/TransactionProcessor/Extensions.cs +++ b/TransactionProcessor/Extensions.cs @@ -78,11 +78,15 @@ public static void PreWarm(this IApplicationBuilder applicationBuilder) { {"Ordered", orderedEventHandlerResolver} }; + + Func subscriptionRepositoryResolver = Startup.Container.GetInstance>(); + applicationBuilder.ConfigureSubscriptionService(subscriptionWorkersRoot, eventStoreConnectionString, Startup.EventStoreClientSettings, eventHandlerResolvers, Extensions.log, + subscriptionRepositoryResolver, CancellationToken.None).Wait(CancellationToken.None); if (Startup.AutoApiLogonOperators.Any()) { diff --git a/TransactionProcessor/TransactionProcessor.csproj b/TransactionProcessor/TransactionProcessor.csproj index 366f248c..c976bb75 100644 --- a/TransactionProcessor/TransactionProcessor.csproj +++ b/TransactionProcessor/TransactionProcessor.csproj @@ -35,8 +35,8 @@ - - + +