From a8fba5edf2cd734e548bb8aefa24dbd35b1c62d5 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sun, 5 Nov 2023 15:11:03 +0000 Subject: [PATCH 1/8] wip --- .../Features/LogonTransaction.feature | 50 +- .../Features/LogonTransaction.feature.cs | 640 +----------------- .../Features/ReconciliationFeature.feature | 2 +- .../Features/ReconciliationFeature.feature.cs | 460 +------------ .../Features/SaleTransactionFeature.feature | 105 +-- 5 files changed, 62 insertions(+), 1195 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature index 15ad1141..c4307e73 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature @@ -24,7 +24,6 @@ Background: Given I have created the following estates | EstateName | | Test Estate 1 | - | Test Estate 2 | Given I have created the following operators | EstateName | OperatorName | RequireCustomMerchantNumber | RequireCustomTerminalNumber | @@ -34,17 +33,23 @@ Background: | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | | Test Operator 1 | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 2 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 3 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 4 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 5 | 00000001 | 10000001 | Test Estate 1 | Given I make the following manual merchant deposits | Reference | Amount | DateTime | MerchantName | EstateName | | Deposit1 | 2000.00 | Today | Test Merchant 1 | Test Estate 1 | | Deposit1 | 1000.00 | Today | Test Merchant 2 | Test Estate 1 | - | Deposit1 | 1000.00 | Today | Test Merchant 3 | Test Estate 2 | + | Deposit1 | 1000.00 | Today | Test Merchant 3 | Test Estate 1 | + | Deposit1 | 1000.00 | Today | Test Merchant 4 | Test Estate 1 | @PRTest Scenario: Logon Transactions @@ -53,67 +58,58 @@ Scenario: Logon Transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | | Today | 1 | Logon | Test Merchant 1 | 123456780 | Test Estate 1 | | Today | 2 | Logon | Test Merchant 2 | 123456781 | Test Estate 1 | - | Today | 3 | Logon | Test Merchant 3 | 123456782 | Test Estate 2 | + | Today | 3 | Logon | Test Merchant 3 | 123456782 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | | Test Estate 1 | Test Merchant 1 | 1 | 0001 | SUCCESS | | Test Estate 1 | Test Merchant 2 | 2 | 0001 | SUCCESS | - | Test Estate 2 | Test Merchant 3 | 3 | 0001 | SUCCESS | - -Scenario: Logon Transaction with Existing Device + | Test Estate 1 | Test Merchant 3 | 3 | 0001 | SUCCESS | Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 1 | 00000001 | Test Estate 1 | + | 123456780 | Test Merchant 4 | 00000001 | Test Estate 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 1 | Logon | Test Merchant 1 | 123456780 | Test Estate 1 | + | Today | 4 | Logon | Test Merchant 4 | 123456780 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 0000 | SUCCESS | - -Scenario: Logon Transaction with Invalid Device + | Test Estate 1 | Test Merchant 4 | 4 | 0000 | SUCCESS | Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 1 | 00000001 | Test Estate 1 | + | 123456780 | Test Merchant 5 | 00000001 | Test Estate 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 1 | Logon | Test Merchant 1 | 123456781 | Test Estate 1 | - + | Today | 5 | Logon | Test Merchant 5 | 123456781 | Test Estate 1 | + Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 1 | - -Scenario: Logon Transaction with Invalid Estate + | Test Estate 1 | Test Merchant 5 | 5 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 5 | Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 1 | 00000001 | Test Estate 1 | + | 123456780 | Test Merchant 6 | 00000001 | Test Estate 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 1 | Logon | Test Merchant 1 | 123456781 | InvalidEstate | + | Today | 6 | Logon | Test Merchant 6 | 123456781 | InvalidEstate | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | InvalidEstate | Test Merchant 1 | 1 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | - -Scenario: Logon Transaction with Invalid Merchant + | InvalidEstate | Test Merchant 1 | 6 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 1 | 00000001 | Test Estate 1 | + | 123456780 | Test Merchant 7 | 00000001 | Test Estate 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 1 | Logon | InvalidMerchant | 123456781 | Test Estate 1 | + | Today | 7 | Logon | InvalidMerchant | 123456781 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | InvalidMerchant | 1 | 1002 | Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for estate [Test Estate 1] | - + | Test Estate 1 | InvalidMerchant | 7 | 1002 | Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for estate [Test Estate 1] | \ No newline at end of file diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index c97110b0..b34d8696 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -1,639 +1 @@ -// ------------------------------------------------------------------------------ -// -// 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"}); - table5.AddRow(new string[] { - "Test Estate 2"}); -#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 29 - 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 2"}); -#line 33 - 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"}); -#line 39 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table8, "Given "); -#line hidden - TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { - "Reference", - "Amount", - "DateTime", - "MerchantName", - "EstateName"}); - table9.AddRow(new string[] { - "Deposit1", - "2000.00", - "Today", - "Test Merchant 1", - "Test Estate 1"}); - table9.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 2", - "Test Estate 1"}); - table9.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 3", - "Test Estate 2"}); -#line 43 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table9, "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 50 -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 table10 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table10.AddRow(new string[] { - "Today", - "1", - "Logon", - "Test Merchant 1", - "123456780", - "Test Estate 1"}); - table10.AddRow(new string[] { - "Today", - "2", - "Logon", - "Test Merchant 2", - "123456781", - "Test Estate 1"}); - table10.AddRow(new string[] { - "Today", - "3", - "Logon", - "Test Merchant 3", - "123456782", - "Test Estate 2"}); -#line 52 - testRunner.When("I perform the following transactions", ((string)(null)), table10, "When "); -#line hidden - TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table11.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "0001", - "SUCCESS"}); - table11.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 2", - "2", - "0001", - "SUCCESS"}); - table11.AddRow(new string[] { - "Test Estate 2", - "Test Merchant 3", - "3", - "0001", - "SUCCESS"}); -#line 58 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table11, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Logon Transaction with Existing Device")] - [Xunit.TraitAttribute("FeatureTitle", "LogonTransaction")] - [Xunit.TraitAttribute("Description", "Logon Transaction with Existing Device")] - public void LogonTransactionWithExistingDevice() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Logon Transaction with Existing Device", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 64 -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 table12 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table12.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "00000001", - "Test Estate 1"}); -#line 66 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table12, "Given "); -#line hidden - TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table13.AddRow(new string[] { - "Today", - "1", - "Logon", - "Test Merchant 1", - "123456780", - "Test Estate 1"}); -#line 70 - testRunner.When("I perform the following transactions", ((string)(null)), table13, "When "); -#line hidden - TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table14.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "0000", - "SUCCESS"}); -#line 74 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table14, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Logon Transaction with Invalid Device")] - [Xunit.TraitAttribute("FeatureTitle", "LogonTransaction")] - [Xunit.TraitAttribute("Description", "Logon Transaction with Invalid Device")] - public void LogonTransactionWithInvalidDevice() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Logon Transaction with Invalid Device", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 78 -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 table15 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table15.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "00000001", - "Test Estate 1"}); -#line 80 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table15, "Given "); -#line hidden - TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table16.AddRow(new string[] { - "Today", - "1", - "Logon", - "Test Merchant 1", - "123456781", - "Test Estate 1"}); -#line 84 - 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[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "1000", - "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); -#line 88 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table17, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Logon Transaction with Invalid Estate")] - [Xunit.TraitAttribute("FeatureTitle", "LogonTransaction")] - [Xunit.TraitAttribute("Description", "Logon Transaction with Invalid Estate")] - public void LogonTransactionWithInvalidEstate() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Logon Transaction with Invalid Estate", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 92 -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 table18 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table18.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "00000001", - "Test Estate 1"}); -#line 94 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table18, "Given "); -#line hidden - TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table19.AddRow(new string[] { - "Today", - "1", - "Logon", - "Test Merchant 1", - "123456781", - "InvalidEstate"}); -#line 98 - testRunner.When("I perform the following transactions", ((string)(null)), table19, "When "); -#line hidden - TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table20.AddRow(new string[] { - "InvalidEstate", - "Test Merchant 1", - "1", - "1001", - "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); -#line 102 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table20, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Logon Transaction with Invalid Merchant")] - [Xunit.TraitAttribute("FeatureTitle", "LogonTransaction")] - [Xunit.TraitAttribute("Description", "Logon Transaction with Invalid Merchant")] - public void LogonTransactionWithInvalidMerchant() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Logon Transaction with Invalid Merchant", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 106 -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 table21 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table21.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "00000001", - "Test Estate 1"}); -#line 108 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table21, "Given "); -#line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table22.AddRow(new string[] { - "Today", - "1", - "Logon", - "InvalidMerchant", - "123456781", - "Test Estate 1"}); -#line 112 - testRunner.When("I perform the following transactions", ((string)(null)), table22, "When "); -#line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table23.AddRow(new string[] { - "Test Estate 1", - "InvalidMerchant", - "1", - "1002", - "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + - "tate [Test Estate 1]"}); -#line 116 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table23, "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 +#error Unable to use SpecFlow tools folder 'C:\Users\stuar\.nuget\packages\specflow\3.9.74\tools': Folder does not exist diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature index cdb4f90d..8c139ef1 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature @@ -71,7 +71,7 @@ Background: | Deposit1 | 100.00 | Today | Test Merchant 3 | Test Estate 2 | @PRTest -Scenario: Sale Transactions +Scenario: Reconciliation Transactions When I perform the following reconciliations | DateTime | MerchantName | DeviceIdentifier | EstateName | TransactionCount | TransactionValue | diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index 11571579..b34d8696 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -1,459 +1 @@ -// ------------------------------------------------------------------------------ -// -// 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 ReconciliationFeature : 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 "ReconciliationFeature.feature" -#line hidden - - public ReconciliationFeature(ReconciliationFeature.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", "Reconciliation", 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 table24 = new TechTalk.SpecFlow.Table(new string[] { - "Name", - "DisplayName", - "Description"}); - table24.AddRow(new string[] { - "estateManagement", - "Estate Managememt REST Scope", - "A scope for Estate Managememt REST"}); - table24.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)), table24, "Given "); -#line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { - "ResourceName", - "DisplayName", - "Secret", - "Scopes", - "UserClaims"}); - table25.AddRow(new string[] { - "estateManagement", - "Estate Managememt REST", - "Secret1", - "estateManagement", - "MerchantId, EstateId, role"}); - table25.AddRow(new string[] { - "transactionProcessor", - "Transaction Processor REST", - "Secret1", - "transactionProcessor", - ""}); -#line 11 - testRunner.Given("the following api resources exist", ((string)(null)), table25, "Given "); -#line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { - "ClientId", - "ClientName", - "Secret", - "AllowedScopes", - "AllowedGrantTypes"}); - table26.AddRow(new string[] { - "serviceClient", - "Service Client", - "Secret1", - "estateManagement,transactionProcessor", - "client_credentials"}); -#line 16 - testRunner.Given("the following clients exist", ((string)(null)), table26, "Given "); -#line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { - "ClientId"}); - table27.AddRow(new string[] { - "serviceClient"}); -#line 20 - testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table27, "Given "); -#line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName"}); - table28.AddRow(new string[] { - "Test Estate 1"}); - table28.AddRow(new string[] { - "Test Estate 2"}); -#line 24 - testRunner.Given("I have created the following estates", ((string)(null)), table28, "Given "); -#line hidden - TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "RequireCustomMerchantNumber", - "RequireCustomTerminalNumber"}); - table29.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "True", - "True"}); - table29.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "True", - "True"}); -#line 29 - testRunner.Given("I have created the following operators", ((string)(null)), table29, "Given "); -#line hidden - TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription"}); - table30.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract"}); - table30.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract"}); -#line 34 - testRunner.Given("I create a contract with the following values", ((string)(null)), table30, "Given "); -#line hidden - TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription", - "ProductName", - "DisplayText", - "Value", - "ProductType"}); - table31.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Custom", - "", - "MobileTopup"}); - table31.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Custom", - "", - "MobileTopup"}); -#line 39 - testRunner.When("I create the following Products", ((string)(null)), table31, "When "); -#line hidden - TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription", - "ProductName", - "CalculationType", - "FeeDescription", - "Value"}); - table32.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Fixed", - "Merchant Commission", - "2.50"}); - table32.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Percentage", - "Merchant Commission", - "0.85"}); -#line 44 - testRunner.When("I add the following Transaction Fees", ((string)(null)), table32, "When "); -#line hidden - TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { - "MerchantName", - "AddressLine1", - "Town", - "Region", - "Country", - "ContactName", - "EmailAddress", - "EstateName"}); - table33.AddRow(new string[] { - "Test Merchant 1", - "Address Line 1", - "TestTown", - "Test Region", - "United Kingdom", - "Test Contact 1", - "testcontact1@merchant1.co.uk", - "Test Estate 1"}); - table33.AddRow(new string[] { - "Test Merchant 2", - "Address Line 1", - "TestTown", - "Test Region", - "United Kingdom", - "Test Contact 2", - "testcontact2@merchant2.co.uk", - "Test Estate 1"}); - table33.AddRow(new string[] { - "Test Merchant 3", - "Address Line 1", - "TestTown", - "Test Region", - "United Kingdom", - "Test Contact 3", - "testcontact3@merchant2.co.uk", - "Test Estate 2"}); -#line 49 - testRunner.Given("I create the following merchants", ((string)(null)), table33, "Given "); -#line hidden - TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { - "OperatorName", - "MerchantName", - "MerchantNumber", - "TerminalNumber", - "EstateName"}); - table34.AddRow(new string[] { - "Safaricom", - "Test Merchant 1", - "00000001", - "10000001", - "Test Estate 1"}); - table34.AddRow(new string[] { - "Safaricom", - "Test Merchant 2", - "00000002", - "10000002", - "Test Estate 1"}); - table34.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)), table34, "Given "); -#line hidden - TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "EstateName"}); - table35.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "Test Estate 1"}); - table35.AddRow(new string[] { - "123456781", - "Test Merchant 2", - "Test Estate 1"}); - table35.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)), table35, "Given "); -#line hidden - TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { - "Reference", - "Amount", - "DateTime", - "MerchantName", - "EstateName"}); - table36.AddRow(new string[] { - "Deposit1", - "200.00", - "Today", - "Test Merchant 1", - "Test Estate 1"}); - table36.AddRow(new string[] { - "Deposit1", - "100.00", - "Today", - "Test Merchant 2", - "Test Estate 1"}); - table36.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)), table36, "Given "); -#line hidden - } - - void System.IDisposable.Dispose() - { - this.TestTearDown(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transactions")] - [Xunit.TraitAttribute("FeatureTitle", "Reconciliation")] - [Xunit.TraitAttribute("Description", "Sale Transactions")] - [Xunit.TraitAttribute("Category", "PRTest")] - public void SaleTransactions() - { - string[] tagsOfScenario = new string[] { - "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 74 -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 table37 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "TransactionCount", - "TransactionValue"}); - table37.AddRow(new string[] { - "Today", - "Test Merchant 1", - "123456780", - "Test Estate 1", - "1", - "100.00"}); - table37.AddRow(new string[] { - "Today", - "Test Merchant 2", - "123456781", - "Test Estate 1", - "2", - "200.00"}); - table37.AddRow(new string[] { - "Today", - "Test Merchant 3", - "123456782", - "Test Estate 2", - "3", - "300.00"}); -#line 76 - testRunner.When("I perform the following reconciliations", ((string)(null)), table37, "When "); -#line hidden - TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "ResponseCode", - "ResponseMessage"}); - table38.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "0000", - "SUCCESS"}); - table38.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 2", - "0000", - "SUCCESS"}); - table38.AddRow(new string[] { - "Test Estate 2", - "Test Merchant 3", - "0000", - "SUCCESS"}); -#line 82 - testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table38, "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() - { - ReconciliationFeature.FeatureSetup(); - } - - void System.IDisposable.Dispose() - { - ReconciliationFeature.FeatureTearDown(); - } - } - } -} -#pragma warning restore -#endregion +#error Unable to use SpecFlow tools folder 'C:\Users\stuar\.nuget\packages\specflow\3.9.74\tools': Folder does not exist diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index 48d0334f..0c617241 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -28,47 +28,36 @@ Background: Given I have created the following estates | EstateName | | Test Estate 1 | - | Test Estate 2 | Given I have created the following operators | EstateName | OperatorName | RequireCustomMerchantNumber | RequireCustomTerminalNumber | | Test Estate 1 | Safaricom | True | True | | Test Estate 1 | Voucher | True | True | | Test Estate 1 | PataPawa PostPay | True | True | - | Test Estate 2 | Safaricom | True | True | - | Test Estate 2 | Voucher | True | True | - | Test Estate 2 | PataPawa PostPay | True | True | - + Given I create a contract with the following values | EstateName | OperatorName | ContractDescription | | Test Estate 1 | Safaricom | Safaricom Contract | | Test Estate 1 | Voucher | Hospital 1 Contract | - | Test Estate 1 | PataPawa PostPay | PataPawa PostPay Contract | - | Test Estate 2 | Safaricom | Safaricom Contract | - | Test Estate 2 | Voucher | Hospital 1 Contract | - | Test Estate 2 | PataPawa PostPay | PataPawa PostPay Contract | - + | Test Estate 1 | PataPawa PostPay | PataPawa PostPay Contract | + When I create the following Products | EstateName | OperatorName | ContractDescription | ProductName | DisplayText | Value | ProductType | | Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Custom | | MobileTopup | | Test Estate 1 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher | | Test Estate 1 | PataPawa PostPay | PataPawa PostPay Contract | Post Pay Bill Pay | Bill Pay (Post) | | BillPayment | - | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Custom | | MobileTopup | - | Test Estate 2 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher | - | Test Estate 2 | PataPawa PostPay | PataPawa PostPay Contract | Post Pay Bill Pay | Bill Pay (Post) | | BillPayment | - + When I add the following Transaction Fees | EstateName | OperatorName | ContractDescription | ProductName | CalculationType | FeeDescription | Value | | Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Percentage | Merchant Commission | 0.50 | | Test Estate 1 | PataPawa PostPay | PataPawa PostPay Contract | Post Pay Bill Pay | Percentage | Merchant Commission | 0.50 | - | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Percentage | Merchant Commission | 0.85 | - | Test Estate 2 | PataPawa PostPay | PataPawa PostPay Contract | Post Pay Bill Pay | Percentage | Merchant Commission | 0.95 | - + Given I create the following merchants | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant3.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 4 | testcontact4@merchant4.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | @@ -78,21 +67,26 @@ Background: | Safaricom | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 | | Voucher | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 | | PataPawa PostPay | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 | - | Safaricom | Test Merchant 3 | 00000003 | 10000003 | Test Estate 2 | - | Voucher | Test Merchant 3 | 00000003 | 10000003 | Test Estate 2 | - | PataPawa PostPay | Test Merchant 3 | 00000003 | 10000003 | Test Estate 2 | + | Safaricom | Test Merchant 3 | 00000003 | 10000003 | Test Estate 1 | + | Voucher | Test Merchant 3 | 00000003 | 10000003 | Test Estate 1 | + | PataPawa PostPay | Test Merchant 3 | 00000003 | 10000003 | Test Estate 1 | + | Safaricom | Test Merchant 4 | 00000004 | 10000004 | Test Estate 1 | + | Voucher | Test Merchant 4 | 00000004 | 10000004 | Test Estate 1 | + | PataPawa PostPay | Test Merchant 4 | 00000004 | 10000004 | Test Estate 1 | Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | EstateName | | 123456780 | Test Merchant 1 | Test Estate 1 | | 123456781 | Test Merchant 2 | Test Estate 1 | - | 123456782 | Test Merchant 3 | Test Estate 2 | + | 123456782 | Test Merchant 3 | Test Estate 1 | + | 123456783 | Test Merchant 4 | Test Estate 1 | Given I make the following manual merchant deposits | Reference | Amount | DateTime | MerchantName | EstateName | | Deposit1 | 240.00 | Today | Test Merchant 1 | Test Estate 1 | | Deposit1 | 110.00 | Today | Test Merchant 2 | Test Estate 1 | - | Deposit1 | 110.00 | Today | Test Merchant 3 | Test Estate 2 | + | Deposit1 | 110.00 | Today | Test Merchant 3 | Test Estate 1 | + | Deposit1 | 100.00 | Today | Test Merchant 4 | Test Estate 1 | Given the following bills are available at the PataPawa PostPaid Host | AccountNumber | AccountName | DueDate | Amount | @@ -112,8 +106,7 @@ Scenario: Sale Transactions | Today | 7 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 2 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | | Today | 8 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 0.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | | VerifyAccount | 12345678 | | | Today | 9 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 20.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | 123456789 | ProcessBill | 12345678 | Mr Test Customer | - - + Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | | Test Estate 1 | Test Merchant 1 | 1 | 0000 | SUCCESS | @@ -155,97 +148,71 @@ Scenario: Sale Transactions | Today | Transaction Fee Processed | C | 0.00 | 0.85 | 0.85 | 20.00 | | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | -@PRTest -Scenario: Resend Transaction Receipt - - When I perform the following transactions - | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | RecipientEmail | RecipientMobile | MessageType | AccountNumber | CustomerName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | - - Then transaction response should contain the following information - | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 0000 | SUCCESS | - When I request the receipt is resent | EstateName | MerchantName | TransactionNumber | | Test Estate 1 | Test Merchant 1 | 1 | -Scenario: Sale Transaction with Invalid Device - When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 10 | Sale | 1 | Test Merchant 1 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 1 | - -Scenario: Sale Transaction with Invalid Estate + | Test Estate 1 | Test Merchant 1 | 10 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | InvalidEstate | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 11 | Sale | 1 | Test Merchant 1 | 123456780 | InvalidEstate | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | InvalidEstate | Test Merchant 1 | 1 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | - -Scenario: Sale Transaction with Invalid Merchant + | InvalidEstate | Test Merchant 1 | 11 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | InvalidMerchant | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 12 | Sale | 1 | InvalidMerchant | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | InvalidMerchant | 1 | 1002 | Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for estate [Test Estate 1] | - -Scenario: Sale Transaction with Empty Contract Id + | Test Estate 1 | InvalidMerchant | 12 | 1002 | Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for estate [Test Estate 1] | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | EmptyContract | Variable Topup | + | Today | 13 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | EmptyContract | Variable Topup | Then transaction response should contain the following information - | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1012 | Contract Id [00000000-0000-0000-0000-000000000000] must be set for a sale transaction | - -Scenario: Sale Transaction with Invalid Contract Id + | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | + | Test Estate 1 | Test Merchant 1 | 13 | 1012 | Contract Id [00000000-0000-0000-0000-000000000000] must be set for a sale transaction | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | InvalidContract | Variable Topup | + | Today | 14 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | InvalidContract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1015 | Contract Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Merchant 1] | - -Scenario: Sale Transaction with Empty Product Id + | Test Estate 1 | Test Merchant 1 | 14 | 1015 | Contract Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Merchant 1] | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | EmptyProduct | + | Today | 15 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | EmptyProduct | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1013 | Product Id [00000000-0000-0000-0000-000000000000] must be set for a sale transaction | - -Scenario: Sale Transaction with Invalid Product Id + | Test Estate 1 | Test Merchant 1 | 15 | 1013 | Product Id [00000000-0000-0000-0000-000000000000] must be set for a sale transaction | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | InvalidProduct | + | Today | 16 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | InvalidProduct | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1016 | Product Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Merchant 1] | - -Scenario: Sale Transaction with Not Enough Credit Available + | Test Estate 1 | Test Merchant 1 | 16 | 1016 | Product Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Merchant 1] | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 300.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 17 | Sale | 1 | Test Merchant 4 | 123456780 | Test Estate 1 | Safaricom | 300.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 1 | 1 | 1009 | Merchant [Test Merchant 1] does not have enough credit available [240.00] to perform transaction amount [300.00] | + | Test Estate 1 | Test Merchant 4 | 17 | 1009 | Merchant [Test Merchant 4] does not have enough credit available [100.00] to perform transaction amount [300.00] | + From 069b59065a58b87d7627f5e2299def7ac315afa0 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sun, 5 Nov 2023 15:32:24 +0000 Subject: [PATCH 2/8] Compress down integration tests --- .../Features/SaleTransactionFeature.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index 0c617241..d068499e 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -214,5 +214,4 @@ Scenario: Sale Transactions Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 4 | 17 | 1009 | Merchant [Test Merchant 4] does not have enough credit available [100.00] to perform transaction amount [300.00] | - + | Test Estate 1 | Test Merchant 4 | 17 | 1009 | Merchant [Test Merchant 4] does not have enough credit available [100.00] to perform transaction amount [300.00] | \ No newline at end of file From a4235bab1ad0ee97240a048bd9d2f38cb5e8a342 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sun, 5 Nov 2023 16:22:03 +0000 Subject: [PATCH 3/8] Test fixes --- .../Common/DockerHelper.cs | 6 +- .../Common/GenericSteps.cs | 8 +- .../Features/LogonTransaction.feature | 3 +- .../Features/LogonTransaction.feature.cs | 586 ++++++++++++++++- .../Features/ReconciliationFeature.feature.cs | 460 ++++++++++++- .../Features/SaleTransactionFeature.feature | 8 +- .../SaleTransactionFeature.feature.cs | 613 +++++------------- .../Features/Settlement.feature.cs | 238 +++---- ...ansactionProcessor.IntegrationTests.csproj | 4 +- 9 files changed, 1331 insertions(+), 595 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs index 47923774..ec960068 100644 --- a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs @@ -8,7 +8,9 @@ using Client; using EstateManagement.Client; using EstateManagement.Database.Contexts; + using global::Shared.IntegrationTesting; using SecurityService.Client; + using Retry = IntegrationTests.Retry; /// /// @@ -59,9 +61,9 @@ public DockerHelper() { /// Starts the containers for scenario run. /// /// Name of the scenario. - public override async Task StartContainersForScenarioRun(String scenarioName) + public override async Task StartContainersForScenarioRun(String scenarioName, DockerServices dockerServices) { - await base.StartContainersForScenarioRun(scenarioName); + await base.StartContainersForScenarioRun(scenarioName, dockerServices); // Setup the base address resolvers String EstateManagementBaseAddressResolver(String api) => $"http://127.0.0.1:{this.EstateManagementPort}"; diff --git a/TransactionProcessor.IntegrationTests/Common/GenericSteps.cs b/TransactionProcessor.IntegrationTests/Common/GenericSteps.cs index c7cbf303..7497de27 100644 --- a/TransactionProcessor.IntegrationTests/Common/GenericSteps.cs +++ b/TransactionProcessor.IntegrationTests/Common/GenericSteps.cs @@ -52,7 +52,13 @@ public async Task StartSystem() this.TestingContext.Logger = logger; this.TestingContext.Logger.LogInformation("About to Start Containers for Scenario Run"); - await this.TestingContext.DockerHelper.StartContainersForScenarioRun(scenarioName).ConfigureAwait(false); + + DockerServices dockerServices = DockerServices.CallbackHandler | DockerServices.EstateManagement | DockerServices.EventStore | + DockerServices.FileProcessor | DockerServices.MessagingService | DockerServices.SecurityService | + DockerServices.SqlServer | DockerServices.TestHost | DockerServices.TransactionProcessor | + DockerServices.TransactionProcessorAcl; + + await this.TestingContext.DockerHelper.StartContainersForScenarioRun(scenarioName, dockerServices).ConfigureAwait(false); this.TestingContext.Logger.LogInformation("Containers for Scenario Run Started"); } diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature index c4307e73..3df65cad 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature @@ -34,7 +34,8 @@ Background: | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | - | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 4 | testcontact4@merchant2.co.uk | Test Estate 1 | + | Test Merchant 5 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 5 | testcontact5@merchant2.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index b34d8696..768adedf 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -1 +1,585 @@ -#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"}); +#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"}); +#line 40 + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table8, "Given "); +#line hidden + TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { + "Reference", + "Amount", + "DateTime", + "MerchantName", + "EstateName"}); + table9.AddRow(new string[] { + "Deposit1", + "2000.00", + "Today", + "Test Merchant 1", + "Test Estate 1"}); + table9.AddRow(new string[] { + "Deposit1", + "1000.00", + "Today", + "Test Merchant 2", + "Test Estate 1"}); + table9.AddRow(new string[] { + "Deposit1", + "1000.00", + "Today", + "Test Merchant 3", + "Test Estate 1"}); + table9.AddRow(new string[] { + "Deposit1", + "1000.00", + "Today", + "Test Merchant 4", + "Test Estate 1"}); +#line 48 + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table9, "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 56 +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 table10 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table10.AddRow(new string[] { + "Today", + "1", + "Logon", + "Test Merchant 1", + "123456780", + "Test Estate 1"}); + table10.AddRow(new string[] { + "Today", + "2", + "Logon", + "Test Merchant 2", + "123456781", + "Test Estate 1"}); + table10.AddRow(new string[] { + "Today", + "3", + "Logon", + "Test Merchant 3", + "123456782", + "Test Estate 1"}); +#line 58 + testRunner.When("I perform the following transactions", ((string)(null)), table10, "When "); +#line hidden + TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table11.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "1", + "0001", + "SUCCESS"}); + table11.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 2", + "2", + "0001", + "SUCCESS"}); + table11.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 3", + "3", + "0001", + "SUCCESS"}); +#line 64 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table11, "Then "); +#line hidden + TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { + "DeviceIdentifier", + "MerchantName", + "MerchantNumber", + "EstateName"}); + table12.AddRow(new string[] { + "123456780", + "Test Merchant 4", + "00000001", + "Test Estate 1"}); +#line 70 + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table12, "Given "); +#line hidden + TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table13.AddRow(new string[] { + "Today", + "4", + "Logon", + "Test Merchant 4", + "123456780", + "Test Estate 1"}); +#line 74 + testRunner.When("I perform the following transactions", ((string)(null)), table13, "When "); +#line hidden + TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table14.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 4", + "4", + "0000", + "SUCCESS"}); +#line 78 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table14, "Then "); +#line hidden + TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { + "DeviceIdentifier", + "MerchantName", + "MerchantNumber", + "EstateName"}); + table15.AddRow(new string[] { + "123456780", + "Test Merchant 5", + "00000001", + "Test Estate 1"}); +#line 82 + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table15, "Given "); +#line hidden + TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table16.AddRow(new string[] { + "Today", + "5", + "Logon", + "Test Merchant 5", + "123456781", + "Test Estate 1"}); +#line 86 + 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[] { + "Test Estate 1", + "Test Merchant 5", + "5", + "1000", + "Device Identifier 123456781 not valid for Merchant Test Merchant 5"}); +#line 90 + 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[] { + "DeviceIdentifier", + "MerchantName", + "MerchantNumber", + "EstateName"}); + table18.AddRow(new string[] { + "123456780", + "Test Merchant 6", + "00000001", + "Test Estate 1"}); +#line 94 + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table18, "Given "); +#line hidden + TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table19.AddRow(new string[] { + "Today", + "6", + "Logon", + "Test Merchant 6", + "123456781", + "InvalidEstate"}); +#line 98 + testRunner.When("I perform the following transactions", ((string)(null)), table19, "When "); +#line hidden + TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table20.AddRow(new string[] { + "InvalidEstate", + "Test Merchant 1", + "6", + "1001", + "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); +#line 102 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table20, "Then "); +#line hidden + TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { + "DeviceIdentifier", + "MerchantName", + "MerchantNumber", + "EstateName"}); + table21.AddRow(new string[] { + "123456780", + "Test Merchant 7", + "00000001", + "Test Estate 1"}); +#line 106 + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table21, "Given "); +#line hidden + TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "TransactionNumber", + "TransactionType", + "MerchantName", + "DeviceIdentifier", + "EstateName"}); + table22.AddRow(new string[] { + "Today", + "7", + "Logon", + "InvalidMerchant", + "123456781", + "Test Estate 1"}); +#line 110 + testRunner.When("I perform the following transactions", ((string)(null)), table22, "When "); +#line hidden + TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "TransactionNumber", + "ResponseCode", + "ResponseMessage"}); + table23.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 114 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table23, "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 b34d8696..633fa24c 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -1 +1,459 @@ -#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 ReconciliationFeature : 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 "ReconciliationFeature.feature" +#line hidden + + public ReconciliationFeature(ReconciliationFeature.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", "Reconciliation", 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 table24 = new TechTalk.SpecFlow.Table(new string[] { + "Name", + "DisplayName", + "Description"}); + table24.AddRow(new string[] { + "estateManagement", + "Estate Managememt REST Scope", + "A scope for Estate Managememt REST"}); + table24.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)), table24, "Given "); +#line hidden + TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { + "ResourceName", + "DisplayName", + "Secret", + "Scopes", + "UserClaims"}); + table25.AddRow(new string[] { + "estateManagement", + "Estate Managememt REST", + "Secret1", + "estateManagement", + "MerchantId, EstateId, role"}); + table25.AddRow(new string[] { + "transactionProcessor", + "Transaction Processor REST", + "Secret1", + "transactionProcessor", + ""}); +#line 11 + testRunner.Given("the following api resources exist", ((string)(null)), table25, "Given "); +#line hidden + TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { + "ClientId", + "ClientName", + "Secret", + "AllowedScopes", + "AllowedGrantTypes"}); + table26.AddRow(new string[] { + "serviceClient", + "Service Client", + "Secret1", + "estateManagement,transactionProcessor", + "client_credentials"}); +#line 16 + testRunner.Given("the following clients exist", ((string)(null)), table26, "Given "); +#line hidden + TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { + "ClientId"}); + table27.AddRow(new string[] { + "serviceClient"}); +#line 20 + testRunner.Given("I have a token to access the estate management and transaction processor resource" + + "s", ((string)(null)), table27, "Given "); +#line hidden + TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName"}); + table28.AddRow(new string[] { + "Test Estate 1"}); + table28.AddRow(new string[] { + "Test Estate 2"}); +#line 24 + testRunner.Given("I have created the following estates", ((string)(null)), table28, "Given "); +#line hidden + TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "OperatorName", + "RequireCustomMerchantNumber", + "RequireCustomTerminalNumber"}); + table29.AddRow(new string[] { + "Test Estate 1", + "Safaricom", + "True", + "True"}); + table29.AddRow(new string[] { + "Test Estate 2", + "Safaricom", + "True", + "True"}); +#line 29 + testRunner.Given("I have created the following operators", ((string)(null)), table29, "Given "); +#line hidden + TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "OperatorName", + "ContractDescription"}); + table30.AddRow(new string[] { + "Test Estate 1", + "Safaricom", + "Safaricom Contract"}); + table30.AddRow(new string[] { + "Test Estate 2", + "Safaricom", + "Safaricom Contract"}); +#line 34 + testRunner.Given("I create a contract with the following values", ((string)(null)), table30, "Given "); +#line hidden + TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "OperatorName", + "ContractDescription", + "ProductName", + "DisplayText", + "Value", + "ProductType"}); + table31.AddRow(new string[] { + "Test Estate 1", + "Safaricom", + "Safaricom Contract", + "Variable Topup", + "Custom", + "", + "MobileTopup"}); + table31.AddRow(new string[] { + "Test Estate 2", + "Safaricom", + "Safaricom Contract", + "Variable Topup", + "Custom", + "", + "MobileTopup"}); +#line 39 + testRunner.When("I create the following Products", ((string)(null)), table31, "When "); +#line hidden + TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "OperatorName", + "ContractDescription", + "ProductName", + "CalculationType", + "FeeDescription", + "Value"}); + table32.AddRow(new string[] { + "Test Estate 1", + "Safaricom", + "Safaricom Contract", + "Variable Topup", + "Fixed", + "Merchant Commission", + "2.50"}); + table32.AddRow(new string[] { + "Test Estate 2", + "Safaricom", + "Safaricom Contract", + "Variable Topup", + "Percentage", + "Merchant Commission", + "0.85"}); +#line 44 + testRunner.When("I add the following Transaction Fees", ((string)(null)), table32, "When "); +#line hidden + TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { + "MerchantName", + "AddressLine1", + "Town", + "Region", + "Country", + "ContactName", + "EmailAddress", + "EstateName"}); + table33.AddRow(new string[] { + "Test Merchant 1", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 1", + "testcontact1@merchant1.co.uk", + "Test Estate 1"}); + table33.AddRow(new string[] { + "Test Merchant 2", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 2", + "testcontact2@merchant2.co.uk", + "Test Estate 1"}); + table33.AddRow(new string[] { + "Test Merchant 3", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 3", + "testcontact3@merchant2.co.uk", + "Test Estate 2"}); +#line 49 + testRunner.Given("I create the following merchants", ((string)(null)), table33, "Given "); +#line hidden + TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { + "OperatorName", + "MerchantName", + "MerchantNumber", + "TerminalNumber", + "EstateName"}); + table34.AddRow(new string[] { + "Safaricom", + "Test Merchant 1", + "00000001", + "10000001", + "Test Estate 1"}); + table34.AddRow(new string[] { + "Safaricom", + "Test Merchant 2", + "00000002", + "10000002", + "Test Estate 1"}); + table34.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)), table34, "Given "); +#line hidden + TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { + "DeviceIdentifier", + "MerchantName", + "EstateName"}); + table35.AddRow(new string[] { + "123456780", + "Test Merchant 1", + "Test Estate 1"}); + table35.AddRow(new string[] { + "123456781", + "Test Merchant 2", + "Test Estate 1"}); + table35.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)), table35, "Given "); +#line hidden + TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { + "Reference", + "Amount", + "DateTime", + "MerchantName", + "EstateName"}); + table36.AddRow(new string[] { + "Deposit1", + "200.00", + "Today", + "Test Merchant 1", + "Test Estate 1"}); + table36.AddRow(new string[] { + "Deposit1", + "100.00", + "Today", + "Test Merchant 2", + "Test Estate 1"}); + table36.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)), table36, "Given "); +#line hidden + } + + void System.IDisposable.Dispose() + { + this.TestTearDown(); + } + + [Xunit.SkippableFactAttribute(DisplayName="Reconciliation Transactions")] + [Xunit.TraitAttribute("FeatureTitle", "Reconciliation")] + [Xunit.TraitAttribute("Description", "Reconciliation Transactions")] + [Xunit.TraitAttribute("Category", "PRTest")] + public void ReconciliationTransactions() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Reconciliation Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 74 +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 table37 = new TechTalk.SpecFlow.Table(new string[] { + "DateTime", + "MerchantName", + "DeviceIdentifier", + "EstateName", + "TransactionCount", + "TransactionValue"}); + table37.AddRow(new string[] { + "Today", + "Test Merchant 1", + "123456780", + "Test Estate 1", + "1", + "100.00"}); + table37.AddRow(new string[] { + "Today", + "Test Merchant 2", + "123456781", + "Test Estate 1", + "2", + "200.00"}); + table37.AddRow(new string[] { + "Today", + "Test Merchant 3", + "123456782", + "Test Estate 2", + "3", + "300.00"}); +#line 76 + testRunner.When("I perform the following reconciliations", ((string)(null)), table37, "When "); +#line hidden + TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { + "EstateName", + "MerchantName", + "ResponseCode", + "ResponseMessage"}); + table38.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "0000", + "SUCCESS"}); + table38.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 2", + "0000", + "SUCCESS"}); + table38.AddRow(new string[] { + "Test Estate 2", + "Test Merchant 3", + "0000", + "SUCCESS"}); +#line 82 + testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table38, "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() + { + ReconciliationFeature.FeatureSetup(); + } + + void System.IDisposable.Dispose() + { + ReconciliationFeature.FeatureTearDown(); + } + } + } +} +#pragma warning restore +#endregion diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index d068499e..50448099 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -99,11 +99,11 @@ Scenario: Sale Transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | RecipientEmail | RecipientMobile | MessageType | AccountNumber | CustomerName | | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 110.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | | Today | 2 | Sale | 1 | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | - | Today | 3 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 2 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | + | Today | 3 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | | Today | 4 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 90.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | Today | 5 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | | Today | 6 | Sale | 1 | Test Merchant 2 | 123456781 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | | 123456789 | | | | - | Today | 7 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 2 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | + | Today | 7 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | | Today | 8 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 0.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | | VerifyAccount | 12345678 | | | Today | 9 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 20.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | 123456789 | ProcessBill | 12345678 | Mr Test Customer | @@ -111,11 +111,11 @@ Scenario: Sale Transactions | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | | Test Estate 1 | Test Merchant 1 | 1 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 2 | 2 | 0000 | SUCCESS | - | Test Estate 2 | Test Merchant 3 | 3 | 0000 | SUCCESS | + | Test Estate 1 | Test Merchant 3 | 3 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 4 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 5 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 2 | 6 | 0000 | SUCCESS | - | Test Estate 2 | Test Merchant 3 | 7 | 0000 | SUCCESS | + | Test Estate 1 | Test Merchant 3 | 7 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 8 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 9 | 0000 | SUCCESS | diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 1d3fa342..a16f9284 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -166,8 +166,6 @@ public virtual void FeatureBackground() "EstateName"}); table56.AddRow(new string[] { "Test Estate 1"}); - table56.AddRow(new string[] { - "Test Estate 2"}); #line 28 testRunner.Given("I have created the following estates", ((string)(null)), table56, "Given "); #line hidden @@ -191,22 +189,7 @@ public virtual void FeatureBackground() "PataPawa PostPay", "True", "True"}); - table57.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "True", - "True"}); - table57.AddRow(new string[] { - "Test Estate 2", - "Voucher", - "True", - "True"}); - table57.AddRow(new string[] { - "Test Estate 2", - "PataPawa PostPay", - "True", - "True"}); -#line 33 +#line 32 testRunner.Given("I have created the following operators", ((string)(null)), table57, "Given "); #line hidden TechTalk.SpecFlow.Table table58 = new TechTalk.SpecFlow.Table(new string[] { @@ -225,19 +208,7 @@ public virtual void FeatureBackground() "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract"}); - table58.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract"}); - table58.AddRow(new string[] { - "Test Estate 2", - "Voucher", - "Hospital 1 Contract"}); - table58.AddRow(new string[] { - "Test Estate 2", - "PataPawa PostPay", - "PataPawa PostPay Contract"}); -#line 42 +#line 38 testRunner.Given("I create a contract with the following values", ((string)(null)), table58, "Given "); #line hidden TechTalk.SpecFlow.Table table59 = new TechTalk.SpecFlow.Table(new string[] { @@ -272,31 +243,7 @@ public virtual void FeatureBackground() "Bill Pay (Post)", "", "BillPayment"}); - table59.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Custom", - "", - "MobileTopup"}); - table59.AddRow(new string[] { - "Test Estate 2", - "Voucher", - "Hospital 1 Contract", - "10 KES", - "10 KES", - "", - "Voucher"}); - table59.AddRow(new string[] { - "Test Estate 2", - "PataPawa PostPay", - "PataPawa PostPay Contract", - "Post Pay Bill Pay", - "Bill Pay (Post)", - "", - "BillPayment"}); -#line 51 +#line 44 testRunner.When("I create the following Products", ((string)(null)), table59, "When "); #line hidden TechTalk.SpecFlow.Table table60 = new TechTalk.SpecFlow.Table(new string[] { @@ -323,23 +270,7 @@ public virtual void FeatureBackground() "Percentage", "Merchant Commission", "0.50"}); - table60.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Percentage", - "Merchant Commission", - "0.85"}); - table60.AddRow(new string[] { - "Test Estate 2", - "PataPawa PostPay", - "PataPawa PostPay Contract", - "Post Pay Bill Pay", - "Percentage", - "Merchant Commission", - "0.95"}); -#line 60 +#line 50 testRunner.When("I add the following Transaction Fees", ((string)(null)), table60, "When "); #line hidden TechTalk.SpecFlow.Table table61 = new TechTalk.SpecFlow.Table(new string[] { @@ -376,9 +307,18 @@ public virtual void FeatureBackground() "Test Region", "United Kingdom", "Test Contact 3", - "testcontact3@merchant2.co.uk", - "Test Estate 2"}); -#line 67 + "testcontact3@merchant3.co.uk", + "Test Estate 1"}); + table61.AddRow(new string[] { + "Test Merchant 4", + "Address Line 1", + "TestTown", + "Test Region", + "United Kingdom", + "Test Contact 4", + "testcontact4@merchant4.co.uk", + "Test Estate 1"}); +#line 55 testRunner.Given("I create the following merchants", ((string)(null)), table61, "Given "); #line hidden TechTalk.SpecFlow.Table table62 = new TechTalk.SpecFlow.Table(new string[] { @@ -428,20 +368,38 @@ public virtual void FeatureBackground() "Test Merchant 3", "00000003", "10000003", - "Test Estate 2"}); + "Test Estate 1"}); table62.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", - "Test Estate 2"}); + "Test Estate 1"}); table62.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 3", "00000003", "10000003", - "Test Estate 2"}); -#line 73 + "Test Estate 1"}); + table62.AddRow(new string[] { + "Safaricom", + "Test Merchant 4", + "00000004", + "10000004", + "Test Estate 1"}); + table62.AddRow(new string[] { + "Voucher", + "Test Merchant 4", + "00000004", + "10000004", + "Test Estate 1"}); + table62.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)), table62, "Given "); #line hidden TechTalk.SpecFlow.Table table63 = new TechTalk.SpecFlow.Table(new string[] { @@ -459,8 +417,12 @@ public virtual void FeatureBackground() table63.AddRow(new string[] { "123456782", "Test Merchant 3", - "Test Estate 2"}); -#line 85 + "Test Estate 1"}); + table63.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)), table63, "Given "); #line hidden TechTalk.SpecFlow.Table table64 = new TechTalk.SpecFlow.Table(new string[] { @@ -486,8 +448,14 @@ public virtual void FeatureBackground() "110.00", "Today", "Test Merchant 3", - "Test Estate 2"}); -#line 91 + "Test Estate 1"}); + table64.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)), table64, "Given "); #line hidden TechTalk.SpecFlow.Table table65 = new TechTalk.SpecFlow.Table(new string[] { @@ -500,7 +468,7 @@ public virtual void FeatureBackground() "Test Account 1", "Today", "100.00"}); -#line 97 +#line 91 testRunner.Given("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table65, "Given "); #line hidden } @@ -520,7 +488,7 @@ public void SaleTransactions() "PRTest"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 102 +#line 96 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -597,7 +565,7 @@ public void SaleTransactions() "2", "Test Merchant 3", "123456782", - "Test Estate 2", + "Test Estate 1", "Safaricom", "100.00", "123456789", @@ -673,7 +641,7 @@ public void SaleTransactions() "2", "Test Merchant 3", "123456782", - "Test Estate 2", + "Test Estate 1", "Voucher", "10.00", "", @@ -723,7 +691,7 @@ public void SaleTransactions() "ProcessBill", "12345678", "Mr Test Customer"}); -#line 104 +#line 98 testRunner.When("I perform the following transactions", ((string)(null)), table66, "When "); #line hidden TechTalk.SpecFlow.Table table67 = new TechTalk.SpecFlow.Table(new string[] { @@ -745,7 +713,7 @@ public void SaleTransactions() "0000", "SUCCESS"}); table67.AddRow(new string[] { - "Test Estate 2", + "Test Estate 1", "Test Merchant 3", "3", "0000", @@ -769,7 +737,7 @@ public void SaleTransactions() "0000", "SUCCESS"}); table67.AddRow(new string[] { - "Test Estate 2", + "Test Estate 1", "Test Merchant 3", "7", "0000", @@ -786,7 +754,7 @@ public void SaleTransactions() "9", "0000", "SUCCESS"}); -#line 117 +#line 110 testRunner.Then("transaction response should contain the following information", ((string)(null)), table67, "Then "); #line hidden TechTalk.SpecFlow.Table table68 = new TechTalk.SpecFlow.Table(new string[] { @@ -869,7 +837,7 @@ public void SaleTransactions() "0.00", "0.00", "20.00"}); -#line 129 +#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)), table68, "Then "); #line hidden @@ -921,7 +889,7 @@ public void SaleTransactions() "0.00", "0.00", "20.00"}); -#line 142 +#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)), table69, "Then "); #line hidden @@ -973,130 +941,22 @@ public void SaleTransactions() "0.00", "0.00", "20.00"}); -#line 150 +#line 143 testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + "tate 2\' and merchant \'Test Merchant 3\'", ((string)(null)), table70, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Resend Transaction Receipt")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Resend Transaction Receipt")] - [Xunit.TraitAttribute("Category", "PRTest")] - public void ResendTransactionReceipt() - { - string[] tagsOfScenario = new string[] { - "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Resend Transaction Receipt", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 159 -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 table71 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "TransactionSource", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName", - "RecipientEmail", - "RecipientMobile", - "MessageType", - "AccountNumber", - "CustomerName"}); - table71.AddRow(new string[] { - "Today", - "1", - "Sale", - "1", - "Test Merchant 1", - "123456780", - "Test Estate 1", - "Safaricom", - "100.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup", - "", - "", - "", - "", - ""}); -#line 161 - testRunner.When("I perform the following transactions", ((string)(null)), table71, "When "); -#line hidden - TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table72.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "0000", - "SUCCESS"}); -#line 165 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table72, "Then "); -#line hidden - TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber"}); - table73.AddRow(new string[] { + table71.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1"}); -#line 169 - testRunner.When("I request the receipt is resent", ((string)(null)), table73, "When "); +#line 151 + testRunner.When("I request the receipt is resent", ((string)(null)), table71, "When "); #line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Device")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Device")] - public void SaleTransactionWithInvalidDevice() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Invalid Device", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 173 -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 table74 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1110,9 +970,9 @@ public void SaleTransactionWithInvalidDevice() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table74.AddRow(new string[] { + table72.AddRow(new string[] { "Today", - "1", + "10", "Sale", "1", "Test Merchant 1", @@ -1124,50 +984,25 @@ public void SaleTransactionWithInvalidDevice() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 175 - testRunner.When("I perform the following transactions", ((string)(null)), table74, "When "); +#line 155 + testRunner.When("I perform the following transactions", ((string)(null)), table72, "When "); #line hidden - TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table75.AddRow(new string[] { + table73.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", - "1", + "10", "1000", "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); -#line 179 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table75, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Estate")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Estate")] - public void SaleTransactionWithInvalidEstate() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Invalid Estate", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 183 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 159 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table73, "Then "); #line hidden - TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table74 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1181,9 +1016,9 @@ public void SaleTransactionWithInvalidEstate() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table76.AddRow(new string[] { + table74.AddRow(new string[] { "Today", - "1", + "11", "Sale", "1", "Test Merchant 1", @@ -1195,50 +1030,25 @@ public void SaleTransactionWithInvalidEstate() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 185 - testRunner.When("I perform the following transactions", ((string)(null)), table76, "When "); +#line 163 + testRunner.When("I perform the following transactions", ((string)(null)), table74, "When "); #line hidden - TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table77.AddRow(new string[] { + table75.AddRow(new string[] { "InvalidEstate", "Test Merchant 1", - "1", + "11", "1001", "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); -#line 189 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table77, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Merchant")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Merchant")] - public void SaleTransactionWithInvalidMerchant() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Invalid Merchant", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 193 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 167 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table75, "Then "); #line hidden - TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1252,9 +1062,9 @@ public void SaleTransactionWithInvalidMerchant() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table78.AddRow(new string[] { + table76.AddRow(new string[] { "Today", - "1", + "12", "Sale", "1", "InvalidMerchant", @@ -1266,51 +1076,26 @@ public void SaleTransactionWithInvalidMerchant() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 195 - testRunner.When("I perform the following transactions", ((string)(null)), table78, "When "); +#line 171 + testRunner.When("I perform the following transactions", ((string)(null)), table76, "When "); #line hidden - TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table79.AddRow(new string[] { + table77.AddRow(new string[] { "Test Estate 1", "InvalidMerchant", - "1", + "12", "1002", "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + "tate [Test Estate 1]"}); -#line 199 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table79, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Empty Contract Id")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Empty Contract Id")] - public void SaleTransactionWithEmptyContractId() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Empty Contract Id", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 203 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 175 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table77, "Then "); #line hidden - TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1324,9 +1109,9 @@ public void SaleTransactionWithEmptyContractId() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table80.AddRow(new string[] { + table78.AddRow(new string[] { "Today", - "1", + "13", "Sale", "1", "Test Merchant 1", @@ -1338,51 +1123,26 @@ public void SaleTransactionWithEmptyContractId() "testcustomer@customer.co.uk", "EmptyContract", "Variable Topup"}); -#line 205 - testRunner.When("I perform the following transactions", ((string)(null)), table80, "When "); +#line 179 + testRunner.When("I perform the following transactions", ((string)(null)), table78, "When "); #line hidden - TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table81.AddRow(new string[] { + table79.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", - "1", + "13", "1012", "Contract Id [00000000-0000-0000-0000-000000000000] must be set for a sale transac" + "tion"}); -#line 209 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table81, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Contract Id")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Contract Id")] - public void SaleTransactionWithInvalidContractId() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Invalid Contract Id", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 213 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 183 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table79, "Then "); #line hidden - TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1396,9 +1156,9 @@ public void SaleTransactionWithInvalidContractId() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table82.AddRow(new string[] { + table80.AddRow(new string[] { "Today", - "1", + "14", "Sale", "1", "Test Merchant 1", @@ -1410,51 +1170,26 @@ public void SaleTransactionWithInvalidContractId() "testcustomer@customer.co.uk", "InvalidContract", "Variable Topup"}); -#line 215 - testRunner.When("I perform the following transactions", ((string)(null)), table82, "When "); +#line 187 + testRunner.When("I perform the following transactions", ((string)(null)), table80, "When "); #line hidden - TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table83.AddRow(new string[] { + table81.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", - "1", + "14", "1015", "Contract Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test M" + "erchant 1]"}); -#line 219 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table83, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Empty Product Id")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Empty Product Id")] - public void SaleTransactionWithEmptyProductId() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Empty Product Id", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 223 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 191 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table81, "Then "); #line hidden - TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1468,9 +1203,9 @@ public void SaleTransactionWithEmptyProductId() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table84.AddRow(new string[] { + table82.AddRow(new string[] { "Today", - "1", + "15", "Sale", "1", "Test Merchant 1", @@ -1482,51 +1217,26 @@ public void SaleTransactionWithEmptyProductId() "testcustomer@customer.co.uk", "Safaricom Contract", "EmptyProduct"}); -#line 225 - testRunner.When("I perform the following transactions", ((string)(null)), table84, "When "); +#line 195 + testRunner.When("I perform the following transactions", ((string)(null)), table82, "When "); #line hidden - TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table85.AddRow(new string[] { + table83.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", - "1", + "15", "1013", "Product Id [00000000-0000-0000-0000-000000000000] must be set for a sale transact" + "ion"}); -#line 229 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table85, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Product Id")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Product Id")] - public void SaleTransactionWithInvalidProductId() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Invalid Product Id", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 233 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 199 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table83, "Then "); #line hidden - TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1540,9 +1250,9 @@ public void SaleTransactionWithInvalidProductId() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table86.AddRow(new string[] { + table84.AddRow(new string[] { "Today", - "1", + "16", "Sale", "1", "Test Merchant 1", @@ -1554,51 +1264,26 @@ public void SaleTransactionWithInvalidProductId() "testcustomer@customer.co.uk", "Safaricom Contract", "InvalidProduct"}); -#line 235 - testRunner.When("I perform the following transactions", ((string)(null)), table86, "When "); +#line 203 + testRunner.When("I perform the following transactions", ((string)(null)), table84, "When "); #line hidden - TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table87.AddRow(new string[] { + table85.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", - "1", + "16", "1016", "Product Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Me" + "rchant 1]"}); -#line 239 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table87, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Not Enough Credit Available")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Not Enough Credit Available")] - public void SaleTransactionWithNotEnoughCreditAvailable() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Sale Transaction with Not Enough Credit Available", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 243 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); +#line 207 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table85, "Then "); #line hidden - TechTalk.SpecFlow.Table table88 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1612,12 +1297,12 @@ public void SaleTransactionWithNotEnoughCreditAvailable() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table88.AddRow(new string[] { + table86.AddRow(new string[] { "Today", - "1", + "17", "Sale", "1", - "Test Merchant 1", + "Test Merchant 4", "123456780", "Test Estate 1", "Safaricom", @@ -1626,24 +1311,24 @@ public void SaleTransactionWithNotEnoughCreditAvailable() "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup"}); -#line 245 - testRunner.When("I perform the following transactions", ((string)(null)), table88, "When "); +#line 211 + testRunner.When("I perform the following transactions", ((string)(null)), table86, "When "); #line hidden - TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table89.AddRow(new string[] { + table87.AddRow(new string[] { "Test Estate 1", - "Test Merchant 1", - "1", + "Test Merchant 4", + "17", "1009", - "Merchant [Test Merchant 1] does not have enough credit available [240.00] to perf" + + "Merchant [Test Merchant 4] does not have enough credit available [100.00] to perf" + "orm transaction amount [300.00]"}); -#line 249 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table89, "Then "); +#line 215 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table87, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index ab450838..6998b5ce 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 table90 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table88 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table90.AddRow(new string[] { + table88.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table90.AddRow(new string[] { + table88.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table90.AddRow(new string[] { + table88.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)), table90, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table88, "Given "); #line hidden - TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table91.AddRow(new string[] { + table89.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table91.AddRow(new string[] { + table89.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); - table91.AddRow(new string[] { + table89.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); #line 12 - testRunner.Given("the following api resources exist", ((string)(null)), table91, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table89, "Given "); #line hidden - TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table90 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table92.AddRow(new string[] { + table90.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor,voucherManagement", "client_credentials"}); #line 18 - testRunner.Given("the following clients exist", ((string)(null)), table92, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table90, "Given "); #line hidden - TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table93.AddRow(new string[] { + table91.AddRow(new string[] { "serviceClient"}); #line 22 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table93, "Given "); + "s", ((string)(null)), table91, "Given "); #line hidden - TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table94.AddRow(new string[] { + table92.AddRow(new string[] { "Test Estate 1"}); #line 26 - testRunner.Given("I have created the following estates", ((string)(null)), table94, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table92, "Given "); #line hidden - TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table95.AddRow(new string[] { + table93.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table95.AddRow(new string[] { + table93.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); #line 30 - testRunner.Given("I have created the following operators", ((string)(null)), table95, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table93, "Given "); #line hidden - TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table96.AddRow(new string[] { + table94.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table96.AddRow(new string[] { + table94.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 35 - testRunner.Given("I create a contract with the following values", ((string)(null)), table96, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table94, "Given "); #line hidden - TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -200,7 +200,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table97.AddRow(new string[] { + table95.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -208,7 +208,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table97.AddRow(new string[] { + table95.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)), table97, "When "); + testRunner.When("I create the following Products", ((string)(null)), table95, "When "); #line hidden - TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table98.AddRow(new string[] { + table96.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)), table98, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table96, "When "); #line hidden } @@ -266,7 +266,7 @@ public void GetPendingSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -276,7 +276,7 @@ public void GetPendingSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table99.AddRow(new string[] { + table97.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"}); - table99.AddRow(new string[] { + table97.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"}); - table99.AddRow(new string[] { + table97.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)), table99, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table97, "Given "); #line hidden - TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table100.AddRow(new string[] { + table98.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table100.AddRow(new string[] { + table98.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table100.AddRow(new string[] { + table98.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table100.AddRow(new string[] { + table98.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table100.AddRow(new string[] { + table98.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table100.AddRow(new string[] { + table98.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)), table100, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table98, "Given "); #line hidden - TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table101.AddRow(new string[] { + table99.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table101.AddRow(new string[] { + table99.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table101.AddRow(new string[] { + table99.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)), table101, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table99, "Given "); #line hidden - TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table102.AddRow(new string[] { + table100.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table102.AddRow(new string[] { + table100.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table102.AddRow(new string[] { + table100.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)), table102, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table100, "Given "); #line hidden - TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -416,7 +416,7 @@ public void GetPendingSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -432,7 +432,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -448,7 +448,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -464,7 +464,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -480,7 +480,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -496,7 +496,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -512,7 +512,7 @@ public void GetPendingSettlement() "10 KES", "", "123456789"}); - table103.AddRow(new string[] { + table101.AddRow(new string[] { "2022-01-06", "7", "Sale", @@ -528,7 +528,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table103.AddRow(new string[] { + table101.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)), table103, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table101, "When "); #line hidden - TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table104.AddRow(new string[] { + table102.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)), table104, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table102, "Then "); #line hidden - TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table105.AddRow(new string[] { + table103.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); - table105.AddRow(new string[] { + table103.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)), table105, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table103, "When "); #line hidden - TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table106.AddRow(new string[] { + table104.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)), table106, "When "); + testRunner.When("I get the completed settlements the following information should be returned", ((string)(null)), table104, "When "); #line hidden } this.ScenarioCleanup(); @@ -662,7 +662,7 @@ public void ProcessSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -672,7 +672,7 @@ public void ProcessSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table107.AddRow(new string[] { + table105.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"}); - table107.AddRow(new string[] { + table105.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)), table107, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table105, "Given "); #line hidden - TechTalk.SpecFlow.Table table108 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table108.AddRow(new string[] { + table106.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table108.AddRow(new string[] { + table106.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table108.AddRow(new string[] { + table106.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table108.AddRow(new string[] { + table106.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)), table108, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table106, "Given "); #line hidden - TechTalk.SpecFlow.Table table109 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table109.AddRow(new string[] { + table107.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table109.AddRow(new string[] { + table107.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)), table109, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table107, "Given "); #line hidden - TechTalk.SpecFlow.Table table110 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table108 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table110.AddRow(new string[] { + table108.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table110.AddRow(new string[] { + table108.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)), table110, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table108, "Given "); #line hidden - TechTalk.SpecFlow.Table table111 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table109 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -780,7 +780,7 @@ public void ProcessSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table111.AddRow(new string[] { + table109.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -796,7 +796,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table111.AddRow(new string[] { + table109.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -812,7 +812,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table111.AddRow(new string[] { + table109.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -828,7 +828,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table111.AddRow(new string[] { + table109.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -844,7 +844,7 @@ public void ProcessSettlement() "10 KES", "test@recipient.co.uk", ""}); - table111.AddRow(new string[] { + table109.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)), table111, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table109, "When "); #line hidden - TechTalk.SpecFlow.Table table112 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table110 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table112.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table112.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table112.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table112.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table112.AddRow(new string[] { + table110.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)), table112, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table110, "Then "); #line hidden - TechTalk.SpecFlow.Table table113 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table111 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table113.AddRow(new string[] { + table111.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)), table113, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table111, "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 ffebcb9c..b7317ccc 100644 --- a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj +++ b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ - + From cb8d49731c482a298bba6a55b50159125a0d94c9 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 6 Nov 2023 14:58:42 +0000 Subject: [PATCH 4/8] More test fixes --- .../Services/TransactionValidationService.cs | 34 +- .../Common/EstateDetails.cs | 2 +- .../Features/LogonTransaction.feature | 28 +- .../Features/LogonTransaction.feature.cs | 145 ++++---- .../Features/ReconciliationFeature.feature.cs | 128 +++---- .../Features/RedeemVoucher.feature.cs | 84 ++--- .../Features/SaleTransactionFeature.feature | 16 +- .../SaleTransactionFeature.feature.cs | 352 +++++++++--------- .../Features/Settlement.feature.cs | 238 ++++++------ 9 files changed, 505 insertions(+), 522 deletions(-) diff --git a/TransactionProcessor.BusinessLogic/Services/TransactionValidationService.cs b/TransactionProcessor.BusinessLogic/Services/TransactionValidationService.cs index 193fa70d..f24ee6bd 100644 --- a/TransactionProcessor.BusinessLogic/Services/TransactionValidationService.cs +++ b/TransactionProcessor.BusinessLogic/Services/TransactionValidationService.cs @@ -159,28 +159,12 @@ public TransactionValidationService(IEstateClient estateClient, } } - // Check the amount - if (transactionAmount.HasValue){ - if (transactionAmount <= 0){ - throw new TransactionValidationException("Transaction Amount must be greater than 0", TransactionResponseCode.InvalidSaleTransactionAmount); - } - - MerchantBalanceState merchantBalanceState = await this.MerchantBalanceStateRepository.Load(estateId, merchantId, cancellationToken); - - // Check the merchant has enough balance to perform the sale - if (merchantBalanceState.AvailableBalance < transactionAmount){ - throw new - TransactionValidationException($"Merchant [{merchant.MerchantName}] does not have enough credit available [{merchantBalanceState.AvailableBalance}] to perform transaction amount [{transactionAmount}]", - TransactionResponseCode.MerchantDoesNotHaveEnoughCredit); - } - } - // Contract and Product Validation if (contractId == Guid.Empty){ throw new TransactionValidationException($"Contract Id [{contractId}] must be set for a sale transaction", TransactionResponseCode.InvalidContractIdValue); } - + List merchantContracts = null; try{ merchantContracts = await this.GetMerchantContracts(estateId, merchantId, cancellationToken); @@ -217,6 +201,22 @@ public TransactionValidationService(IEstateClient estateClient, TransactionResponseCode.ProductNotValidForMerchant); } + // Check the amount + if (transactionAmount.HasValue){ + if (transactionAmount <= 0){ + throw new TransactionValidationException("Transaction Amount must be greater than 0", TransactionResponseCode.InvalidSaleTransactionAmount); + } + + MerchantBalanceState merchantBalanceState = await this.MerchantBalanceStateRepository.Load(estateId, merchantId, cancellationToken); + + // Check the merchant has enough balance to perform the sale + if (merchantBalanceState.AvailableBalance < transactionAmount){ + throw new + TransactionValidationException($"Merchant [{merchant.MerchantName}] does not have enough credit available [{merchantBalanceState.AvailableBalance}] to perform transaction amount [{transactionAmount}]", + TransactionResponseCode.MerchantDoesNotHaveEnoughCredit); + } + } + // If we get here everything is good return ("SUCCESS", TransactionResponseCode.Success); } diff --git a/TransactionProcessor.IntegrationTests/Common/EstateDetails.cs b/TransactionProcessor.IntegrationTests/Common/EstateDetails.cs index 3bdadee9..c5bf4003 100644 --- a/TransactionProcessor.IntegrationTests/Common/EstateDetails.cs +++ b/TransactionProcessor.IntegrationTests/Common/EstateDetails.cs @@ -293,7 +293,7 @@ public Contract GetContract(Guid contractId) /// public Guid GetMerchantId(String merchantName) { - if (merchantName == "InvalidMerchant") + if (merchantName == "InvalidMerchant" || this.EstateName == "InvalidEstate") { return Guid.Parse("D59320FA-4C3E-4900-A999-483F6A10C69A"); } diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature index 3df65cad..a3d7e686 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature @@ -36,6 +36,8 @@ Background: | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 4 | testcontact4@merchant2.co.uk | Test Estate 1 | | Test Merchant 5 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 5 | testcontact5@merchant2.co.uk | Test Estate 1 | + | Test Merchant 6 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 6 | testcontact6@merchant2.co.uk | Test Estate 1 | + | Test Merchant 7 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 7 | testcontact7@merchant2.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | @@ -44,6 +46,8 @@ Background: | Test Operator 1 | Test Merchant 3 | 00000001 | 10000001 | Test Estate 1 | | Test Operator 1 | Test Merchant 4 | 00000001 | 10000001 | Test Estate 1 | | Test Operator 1 | Test Merchant 5 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 6 | 00000001 | 10000001 | Test Estate 1 | + | Test Operator 1 | Test Merchant 7 | 00000001 | 10000001 | Test Estate 1 | Given I make the following manual merchant deposits | Reference | Amount | DateTime | MerchantName | EstateName | @@ -69,47 +73,35 @@ Scenario: Logon Transactions Given I have assigned the following devices to the merchants | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 4 | 00000001 | Test Estate 1 | + | 123456783 | Test Merchant 4 | 00000001 | Test Estate 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 4 | Logon | Test Merchant 4 | 123456780 | Test Estate 1 | + | Today | 4 | Logon | Test Merchant 4 | 123456783 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | | Test Estate 1 | Test Merchant 4 | 4 | 0000 | SUCCESS | - Given I have assigned the following devices to the merchants - | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 5 | 00000001 | Test Estate 1 | - When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 5 | Logon | Test Merchant 5 | 123456781 | Test Estate 1 | + | Today | 5 | Logon | Test Merchant 1 | 13579135 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 5 | 5 | 1000 | Device Identifier 123456781 not valid for Merchant Test Merchant 5 | - - Given I have assigned the following devices to the merchants - | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 6 | 00000001 | Test Estate 1 | + | Test Estate 1 | Test Merchant 1 | 5 | 1000 | Device Identifier 13579135 not valid for Merchant Test Merchant 1 | When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 6 | Logon | Test Merchant 6 | 123456781 | InvalidEstate | + | Today | 6 | Logon | Test Merchant 1 | 123456785 | InvalidEstate | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | | InvalidEstate | Test Merchant 1 | 6 | 1001 | Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate | - Given I have assigned the following devices to the merchants - | DeviceIdentifier | MerchantName | MerchantNumber | EstateName | - | 123456780 | Test Merchant 7 | 00000001 | Test Estate 1 | - When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | - | Today | 7 | Logon | InvalidMerchant | 123456781 | Test Estate 1 | + | Today | 7 | Logon | InvalidMerchant | 123456786 | Test Estate 1 | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index 768adedf..a63c2fd7 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -216,6 +216,24 @@ public virtual void FeatureBackground() "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 @@ -255,7 +273,19 @@ public virtual void FeatureBackground() "00000001", "10000001", "Test Estate 1"}); -#line 40 + 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 TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { @@ -288,7 +318,7 @@ public virtual void FeatureBackground() "Today", "Test Merchant 4", "Test Estate 1"}); -#line 48 +#line 52 testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table9, "Given "); #line hidden } @@ -308,7 +338,7 @@ public void LogonTransactions() "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 56 +#line 60 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -349,7 +379,7 @@ public void LogonTransactions() "Test Merchant 3", "123456782", "Test Estate 1"}); -#line 58 +#line 62 testRunner.When("I perform the following transactions", ((string)(null)), table10, "When "); #line hidden TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { @@ -376,7 +406,7 @@ public void LogonTransactions() "3", "0001", "SUCCESS"}); -#line 64 +#line 68 testRunner.Then("transaction response should contain the following information", ((string)(null)), table11, "Then "); #line hidden TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { @@ -385,11 +415,11 @@ public void LogonTransactions() "MerchantNumber", "EstateName"}); table12.AddRow(new string[] { - "123456780", + "123456783", "Test Merchant 4", "00000001", "Test Estate 1"}); -#line 70 +#line 74 testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table12, "Given "); #line hidden TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { @@ -404,9 +434,9 @@ public void LogonTransactions() "4", "Logon", "Test Merchant 4", - "123456780", + "123456783", "Test Estate 1"}); -#line 74 +#line 78 testRunner.When("I perform the following transactions", ((string)(null)), table13, "When "); #line hidden TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { @@ -421,144 +451,105 @@ public void LogonTransactions() "4", "0000", "SUCCESS"}); -#line 78 +#line 82 testRunner.Then("transaction response should contain the following information", ((string)(null)), table14, "Then "); #line hidden TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table15.AddRow(new string[] { - "123456780", - "Test Merchant 5", - "00000001", - "Test Estate 1"}); -#line 82 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table15, "Given "); -#line hidden - TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table16.AddRow(new string[] { + table15.AddRow(new string[] { "Today", "5", "Logon", - "Test Merchant 5", - "123456781", + "Test Merchant 1", + "13579135", "Test Estate 1"}); #line 86 - testRunner.When("I perform the following transactions", ((string)(null)), table16, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table15, "When "); #line hidden - TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table17.AddRow(new string[] { + table16.AddRow(new string[] { "Test Estate 1", - "Test Merchant 5", + "Test Merchant 1", "5", "1000", - "Device Identifier 123456781 not valid for Merchant Test Merchant 5"}); + "Device Identifier 13579135 not valid for Merchant Test Merchant 1"}); #line 90 - 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[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table18.AddRow(new string[] { - "123456780", - "Test Merchant 6", - "00000001", - "Test Estate 1"}); -#line 94 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table18, "Given "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table16, "Then "); #line hidden - TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table19.AddRow(new string[] { + table17.AddRow(new string[] { "Today", "6", "Logon", - "Test Merchant 6", - "123456781", + "Test Merchant 1", + "123456785", "InvalidEstate"}); -#line 98 - testRunner.When("I perform the following transactions", ((string)(null)), table19, "When "); +#line 94 + testRunner.When("I perform the following transactions", ((string)(null)), table17, "When "); #line hidden - TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table20.AddRow(new string[] { + table18.AddRow(new string[] { "InvalidEstate", "Test Merchant 1", "6", "1001", "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); -#line 102 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table20, "Then "); -#line hidden - TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table21.AddRow(new string[] { - "123456780", - "Test Merchant 7", - "00000001", - "Test Estate 1"}); -#line 106 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table21, "Given "); +#line 98 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table18, "Then "); #line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table22.AddRow(new string[] { + table19.AddRow(new string[] { "Today", "7", "Logon", "InvalidMerchant", - "123456781", + "123456786", "Test Estate 1"}); -#line 110 - testRunner.When("I perform the following transactions", ((string)(null)), table22, "When "); +#line 102 + testRunner.When("I perform the following transactions", ((string)(null)), table19, "When "); #line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table23.AddRow(new string[] { + table20.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 114 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table23, "Then "); +#line 106 + testRunner.Then("transaction response should contain the following information", ((string)(null)), table20, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index 633fa24c..8339a2ec 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 table24 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table24.AddRow(new string[] { + table21.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table24.AddRow(new string[] { + table21.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)), table24, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table21, "Given "); #line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table25.AddRow(new string[] { + table22.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table25.AddRow(new string[] { + table22.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); #line 11 - testRunner.Given("the following api resources exist", ((string)(null)), table25, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table22, "Given "); #line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table26.AddRow(new string[] { + table23.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor", "client_credentials"}); #line 16 - testRunner.Given("the following clients exist", ((string)(null)), table26, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table23, "Given "); #line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table27.AddRow(new string[] { + table24.AddRow(new string[] { "serviceClient"}); #line 20 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table27, "Given "); + "s", ((string)(null)), table24, "Given "); #line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table28.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 1"}); - table28.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 2"}); #line 24 - testRunner.Given("I have created the following estates", ((string)(null)), table28, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table25, "Given "); #line hidden - TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table29.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table29.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); #line 29 - testRunner.Given("I have created the following operators", ((string)(null)), table29, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table26, "Given "); #line hidden - TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table30.AddRow(new string[] { + table27.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table30.AddRow(new string[] { + table27.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); #line 34 - testRunner.Given("I create a contract with the following values", ((string)(null)), table30, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table27, "Given "); #line hidden - TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -192,7 +192,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table31.AddRow(new string[] { + table28.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -200,7 +200,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table31.AddRow(new string[] { + table28.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)), table31, "When "); + testRunner.When("I create the following Products", ((string)(null)), table28, "When "); #line hidden - TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -219,7 +219,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table32.AddRow(new string[] { + table29.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "Fixed", "Merchant Commission", "2.50"}); - table32.AddRow(new string[] { + table29.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)), table32, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table29, "When "); #line hidden - TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -247,7 +247,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table33.AddRow(new string[] { + table30.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"}); - table33.AddRow(new string[] { + table30.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"}); - table33.AddRow(new string[] { + table30.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)), table33, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table30, "Given "); #line hidden - TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table34.AddRow(new string[] { + table31.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table34.AddRow(new string[] { + table31.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table34.AddRow(new string[] { + table31.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)), table34, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table31, "Given "); #line hidden - TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table35.AddRow(new string[] { + table32.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table35.AddRow(new string[] { + table32.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table35.AddRow(new string[] { + table32.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)), table35, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table32, "Given "); #line hidden - TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table36.AddRow(new string[] { + table33.AddRow(new string[] { "Deposit1", "200.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table36.AddRow(new string[] { + table33.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table36.AddRow(new string[] { + table33.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)), table36, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table33, "Given "); #line hidden } @@ -380,28 +380,28 @@ public void ReconciliationTransactions() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table37 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "MerchantName", "DeviceIdentifier", "EstateName", "TransactionCount", "TransactionValue"}); - table37.AddRow(new string[] { + table34.AddRow(new string[] { "Today", "Test Merchant 1", "123456780", "Test Estate 1", "1", "100.00"}); - table37.AddRow(new string[] { + table34.AddRow(new string[] { "Today", "Test Merchant 2", "123456781", "Test Estate 1", "2", "200.00"}); - table37.AddRow(new string[] { + table34.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)), table37, "When "); + testRunner.When("I perform the following reconciliations", ((string)(null)), table34, "When "); #line hidden - TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "ResponseCode", "ResponseMessage"}); - table38.AddRow(new string[] { + table35.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "0000", "SUCCESS"}); - table38.AddRow(new string[] { + table35.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "0000", "SUCCESS"}); - table38.AddRow(new string[] { + table35.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "0000", "SUCCESS"}); #line 82 - testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table38, "Then "); + testRunner.Then("reconciliation response should contain the following information", ((string)(null)), table35, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index 97a62019..7978cac1 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 table39 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table39.AddRow(new string[] { + table36.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table39.AddRow(new string[] { + table36.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)), table39, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table36, "Given "); #line hidden - TechTalk.SpecFlow.Table table40 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table37 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table40.AddRow(new string[] { + table37.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table40.AddRow(new string[] { + table37.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); #line 12 - testRunner.Given("the following api resources exist", ((string)(null)), table40, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table37, "Given "); #line hidden - TechTalk.SpecFlow.Table table41 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table41.AddRow(new string[] { + table38.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,voucherManagement", "client_credentials"}); #line 17 - testRunner.Given("the following clients exist", ((string)(null)), table41, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table38, "Given "); #line hidden - TechTalk.SpecFlow.Table table42 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table39 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table42.AddRow(new string[] { + table39.AddRow(new string[] { "serviceClient"}); #line 21 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table42, "Given "); + "s", ((string)(null)), table39, "Given "); #line hidden - TechTalk.SpecFlow.Table table43 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table40 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table43.AddRow(new string[] { + table40.AddRow(new string[] { "Test Estate 1"}); - table43.AddRow(new string[] { + table40.AddRow(new string[] { "Test Estate 2"}); #line 25 - testRunner.Given("I have created the following estates", ((string)(null)), table43, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table40, "Given "); #line hidden - TechTalk.SpecFlow.Table table44 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table41 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table44.AddRow(new string[] { + table41.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); #line 30 - testRunner.Given("I have created the following operators", ((string)(null)), table44, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table41, "Given "); #line hidden - TechTalk.SpecFlow.Table table45 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table42 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table45.AddRow(new string[] { + table42.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 34 - testRunner.Given("I create a contract with the following values", ((string)(null)), table45, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table42, "Given "); #line hidden - TechTalk.SpecFlow.Table table46 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table43 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -183,7 +183,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table46.AddRow(new string[] { + table43.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)), table46, "When "); + testRunner.When("I create the following Products", ((string)(null)), table43, "When "); #line hidden - TechTalk.SpecFlow.Table table47 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table44 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -203,7 +203,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table47.AddRow(new string[] { + table44.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)), table47, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table44, "Given "); #line hidden - TechTalk.SpecFlow.Table table48 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table45 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table48.AddRow(new string[] { + table45.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)), table48, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table45, "Given "); #line hidden - TechTalk.SpecFlow.Table table49 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table46 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table49.AddRow(new string[] { + table46.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)), table49, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table46, "Given "); #line hidden - TechTalk.SpecFlow.Table table50 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table47 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table50.AddRow(new string[] { + table47.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)), table50, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table47, "Given "); #line hidden - TechTalk.SpecFlow.Table table51 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table48 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -275,7 +275,7 @@ public virtual void FeatureBackground() "MessageType", "AccountNumber", "CustomerName"}); - table51.AddRow(new string[] { + table48.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)), table51, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table48, "When "); #line hidden } diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index 50448099..d5bfe443 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -97,15 +97,15 @@ Scenario: Sale Transactions When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | RecipientEmail | RecipientMobile | MessageType | AccountNumber | CustomerName | - | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 110.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | + | Today | 1 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 110.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | Today | 2 | Sale | 1 | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | | Today | 3 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | | | | | | - | Today | 4 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 90.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | + | Today | 4 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 90.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | | | | | | | Today | 5 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | | Today | 6 | Sale | 1 | Test Merchant 2 | 123456781 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | | 123456789 | | | | | Today | 7 | Sale | 2 | Test Merchant 3 | 123456782 | Test Estate 1 | Voucher | 10.00 | | | Hospital 1 Contract | 10 KES | test@recipient.co.uk | | | | | - | Today | 8 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 0.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | | VerifyAccount | 12345678 | | - | Today | 9 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 20.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | 123456789 | ProcessBill | 12345678 | Mr Test Customer | + | Today | 8 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 0.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | | VerifyAccount | 12345678 | | + | Today | 9 | Sale | 2 | Test Merchant 1 | 123456780 | Test Estate 1 | PataPawa PostPay | 20.00 | | | PataPawa PostPay Contract | Post Pay Bill Pay | test@recipient.co.uk | 123456789 | ProcessBill | 12345678 | Mr Test Customer | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | @@ -140,12 +140,12 @@ Scenario: Sale Transactions | Today | Transaction Fee Processed | C | 0.00 | 0.50 | 0.50 | 20.00 | | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | - Then the following entries appear in the merchants balance history for estate 'Test Estate 2' and merchant 'Test Merchant 3' + Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 3' | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | | Today | Merchant Deposit | C | 110.00 | 0.00 | 110.00 | 230.00 | | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 130.00 | | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 30.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.85 | 0.85 | 20.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.85 | 0.50 | 20.00 | | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | When I request the receipt is resent @@ -178,7 +178,7 @@ Scenario: Sale Transactions When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 13 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | EmptyContract | Variable Topup | + | Today | 13 | Sale | 1 | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | testcustomer@customer.co.uk | EmptyContract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | @@ -210,7 +210,7 @@ Scenario: Sale Transactions When I perform the following transactions | DateTime | TransactionNumber | TransactionType | TransactionSource | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 17 | Sale | 1 | Test Merchant 4 | 123456780 | Test Estate 1 | Safaricom | 300.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 17 | Sale | 1 | Test Merchant 4 | 123456783 | Test Estate 1 | Safaricom | 300.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index a16f9284..9c1b4f57 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 table52 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table49 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table52.AddRow(new string[] { + table49.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table52.AddRow(new string[] { + table49.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table52.AddRow(new string[] { + table49.AddRow(new string[] { "voucherManagement", "Voucher Management REST Scope", "A scope for Voucher Management REST"}); - table52.AddRow(new string[] { + table49.AddRow(new string[] { "messagingService", "Scope for Messaging REST", "Scope for Messaging REST"}); #line 6 - testRunner.Given("I create the following api scopes", ((string)(null)), table52, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table49, "Given "); #line hidden - TechTalk.SpecFlow.Table table53 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table50 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table53.AddRow(new string[] { + table50.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table53.AddRow(new string[] { + table50.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); - table53.AddRow(new string[] { + table50.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); - table53.AddRow(new string[] { + table50.AddRow(new string[] { "messagingService", "Messaging REST", "Secret", "messagingService", ""}); #line 13 - testRunner.Given("the following api resources exist", ((string)(null)), table53, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table50, "Given "); #line hidden - TechTalk.SpecFlow.Table table54 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table51 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table54.AddRow(new string[] { + table51.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor,voucherManagement,messagingService", "client_credentials"}); #line 20 - testRunner.Given("the following clients exist", ((string)(null)), table54, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table51, "Given "); #line hidden - TechTalk.SpecFlow.Table table55 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table52 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table55.AddRow(new string[] { + table52.AddRow(new string[] { "serviceClient"}); #line 24 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table55, "Given "); + "s", ((string)(null)), table52, "Given "); #line hidden - TechTalk.SpecFlow.Table table56 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table53 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table56.AddRow(new string[] { + table53.AddRow(new string[] { "Test Estate 1"}); #line 28 - testRunner.Given("I have created the following estates", ((string)(null)), table56, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table53, "Given "); #line hidden - TechTalk.SpecFlow.Table table57 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table54 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table57.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table57.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table57.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "True", "True"}); #line 32 - testRunner.Given("I have created the following operators", ((string)(null)), table57, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table54, "Given "); #line hidden - TechTalk.SpecFlow.Table table58 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table55 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table58.AddRow(new string[] { + table55.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table58.AddRow(new string[] { + table55.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table58.AddRow(new string[] { + table55.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)), table58, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table55, "Given "); #line hidden - TechTalk.SpecFlow.Table table59 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table56 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -219,7 +219,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table59.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table59.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -235,7 +235,7 @@ public virtual void FeatureBackground() "10 KES", "", "Voucher"}); - table59.AddRow(new string[] { + table56.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)), table59, "When "); + testRunner.When("I create the following Products", ((string)(null)), table56, "When "); #line hidden - TechTalk.SpecFlow.Table table60 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table57 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -254,7 +254,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table60.AddRow(new string[] { + table57.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -262,7 +262,7 @@ public virtual void FeatureBackground() "Percentage", "Merchant Commission", "0.50"}); - table60.AddRow(new string[] { + table57.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)), table60, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table57, "When "); #line hidden - TechTalk.SpecFlow.Table table61 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table58 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -282,7 +282,7 @@ public virtual void FeatureBackground() "ContactName", "EmailAddress", "EstateName"}); - table61.AddRow(new string[] { + table58.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"}); - table61.AddRow(new string[] { + table58.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"}); - table61.AddRow(new string[] { + table58.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"}); - table61.AddRow(new string[] { + table58.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)), table61, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table58, "Given "); #line hidden - TechTalk.SpecFlow.Table table62 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table59 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Safaricom", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.AddRow(new string[] { "Voucher", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table62.AddRow(new string[] { + table59.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)), table62, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table59, "Given "); #line hidden - TechTalk.SpecFlow.Table table63 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table60 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table63.AddRow(new string[] { + table60.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table63.AddRow(new string[] { + table60.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table63.AddRow(new string[] { + table60.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 1"}); - table63.AddRow(new string[] { + table60.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)), table63, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table60, "Given "); #line hidden - TechTalk.SpecFlow.Table table64 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table61 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table64.AddRow(new string[] { + table61.AddRow(new string[] { "Deposit1", "240.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table64.AddRow(new string[] { + table61.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table64.AddRow(new string[] { + table61.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 1"}); - table64.AddRow(new string[] { + table61.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)), table64, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table61, "Given "); #line hidden - TechTalk.SpecFlow.Table table65 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table62 = new TechTalk.SpecFlow.Table(new string[] { "AccountNumber", "AccountName", "DueDate", "Amount"}); - table65.AddRow(new string[] { + table62.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)), table65, "Given "); + testRunner.Given("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table62, "Given "); #line hidden } @@ -501,7 +501,7 @@ public void SaleTransactions() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table66 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table63 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -520,7 +520,7 @@ public void SaleTransactions() "MessageType", "AccountNumber", "CustomerName"}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "1", "Sale", @@ -531,7 +531,7 @@ public void SaleTransactions() "Safaricom", "110.00", "123456789", - "", + "testcustomer@customer.co.uk", "Safaricom Contract", "Variable Topup", "", @@ -539,7 +539,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "2", "Sale", @@ -558,7 +558,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "3", "Sale", @@ -577,7 +577,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "4", "Sale", @@ -596,7 +596,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "5", "Sale", @@ -615,7 +615,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "6", "Sale", @@ -634,7 +634,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "7", "Sale", @@ -653,7 +653,7 @@ public void SaleTransactions() "", "", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "8", "Sale", @@ -672,7 +672,7 @@ public void SaleTransactions() "VerifyAccount", "12345678", ""}); - table66.AddRow(new string[] { + table63.AddRow(new string[] { "Today", "9", "Sale", @@ -692,72 +692,72 @@ public void SaleTransactions() "12345678", "Mr Test Customer"}); #line 98 - testRunner.When("I perform the following transactions", ((string)(null)), table66, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table63, "When "); #line hidden - TechTalk.SpecFlow.Table table67 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table64 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "8", "0000", "SUCCESS"}); - table67.AddRow(new string[] { + table64.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)), table67, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table64, "Then "); #line hidden - TechTalk.SpecFlow.Table table68 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table65 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -765,7 +765,7 @@ public void SaleTransactions() "Out", "ChangeAmount", "Balance"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -773,7 +773,7 @@ public void SaleTransactions() "0.00", "240.00", "230.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -781,7 +781,7 @@ public void SaleTransactions() "110.00", "110.00", "130.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -789,7 +789,7 @@ public void SaleTransactions() "90.00", "90.00", "30.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -797,7 +797,7 @@ public void SaleTransactions() "10.00", "10.00", "20.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -805,7 +805,7 @@ public void SaleTransactions() "20.00", "20.00", "20.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -813,7 +813,7 @@ public void SaleTransactions() "0.55", "0.55", "20.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -821,7 +821,7 @@ public void SaleTransactions() "0.45", "0.45", "20.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -829,7 +829,7 @@ public void SaleTransactions() "0.01", "0.10", "20.00"}); - table68.AddRow(new string[] { + table65.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -839,9 +839,9 @@ public void SaleTransactions() "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)), table68, "Then "); + "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table65, "Then "); #line hidden - TechTalk.SpecFlow.Table table69 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table66 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -849,7 +849,7 @@ public void SaleTransactions() "Out", "ChangeAmount", "Balance"}); - table69.AddRow(new string[] { + table66.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -857,7 +857,7 @@ public void SaleTransactions() "0.00", "110.00", "230.00"}); - table69.AddRow(new string[] { + table66.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -865,7 +865,7 @@ public void SaleTransactions() "100.00", "100.00", "130.00"}); - table69.AddRow(new string[] { + table66.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -873,7 +873,7 @@ public void SaleTransactions() "10.00", "10.00", "30.00"}); - table69.AddRow(new string[] { + table66.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -881,7 +881,7 @@ public void SaleTransactions() "0.50", "0.50", "20.00"}); - table69.AddRow(new string[] { + table66.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -891,9 +891,9 @@ public void SaleTransactions() "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)), table69, "Then "); + "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table66, "Then "); #line hidden - TechTalk.SpecFlow.Table table70 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table67 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -901,7 +901,7 @@ public void SaleTransactions() "Out", "ChangeAmount", "Balance"}); - table70.AddRow(new string[] { + table67.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -909,7 +909,7 @@ public void SaleTransactions() "0.00", "110.00", "230.00"}); - table70.AddRow(new string[] { + table67.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -917,7 +917,7 @@ public void SaleTransactions() "100.00", "100.00", "130.00"}); - table70.AddRow(new string[] { + table67.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -925,15 +925,15 @@ public void SaleTransactions() "10.00", "10.00", "30.00"}); - table70.AddRow(new string[] { + table67.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", "0.00", "0.85", - "0.85", + "0.50", "20.00"}); - table70.AddRow(new string[] { + table67.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -943,20 +943,20 @@ public void SaleTransactions() "20.00"}); #line 143 testRunner.Then("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 2\' and merchant \'Test Merchant 3\'", ((string)(null)), table70, "Then "); + "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table67, "Then "); #line hidden - TechTalk.SpecFlow.Table table71 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table68 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber"}); - table71.AddRow(new string[] { + table68.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1"}); #line 151 - testRunner.When("I request the receipt is resent", ((string)(null)), table71, "When "); + testRunner.When("I request the receipt is resent", ((string)(null)), table68, "When "); #line hidden - TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table69 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -970,7 +970,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table72.AddRow(new string[] { + table69.AddRow(new string[] { "Today", "10", "Sale", @@ -985,24 +985,24 @@ public void SaleTransactions() "Safaricom Contract", "Variable Topup"}); #line 155 - testRunner.When("I perform the following transactions", ((string)(null)), table72, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table69, "When "); #line hidden - TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table70 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table73.AddRow(new string[] { + 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)), table73, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table70, "Then "); #line hidden - TechTalk.SpecFlow.Table table74 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table71 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1016,7 +1016,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table74.AddRow(new string[] { + table71.AddRow(new string[] { "Today", "11", "Sale", @@ -1031,24 +1031,24 @@ public void SaleTransactions() "Safaricom Contract", "Variable Topup"}); #line 163 - testRunner.When("I perform the following transactions", ((string)(null)), table74, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table71, "When "); #line hidden - TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table72 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table75.AddRow(new string[] { + table72.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)), table75, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table72, "Then "); #line hidden - TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table73 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1062,7 +1062,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table76.AddRow(new string[] { + table73.AddRow(new string[] { "Today", "12", "Sale", @@ -1077,15 +1077,15 @@ public void SaleTransactions() "Safaricom Contract", "Variable Topup"}); #line 171 - testRunner.When("I perform the following transactions", ((string)(null)), table76, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table73, "When "); #line hidden - TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table74 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table77.AddRow(new string[] { + table74.AddRow(new string[] { "Test Estate 1", "InvalidMerchant", "12", @@ -1093,9 +1093,9 @@ public void SaleTransactions() "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)), table77, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table74, "Then "); #line hidden - TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table75 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1109,7 +1109,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table78.AddRow(new string[] { + table75.AddRow(new string[] { "Today", "13", "Sale", @@ -1124,15 +1124,15 @@ public void SaleTransactions() "EmptyContract", "Variable Topup"}); #line 179 - testRunner.When("I perform the following transactions", ((string)(null)), table78, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table75, "When "); #line hidden - TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table76 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table79.AddRow(new string[] { + table76.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "13", @@ -1140,9 +1140,9 @@ public void SaleTransactions() "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)), table79, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table76, "Then "); #line hidden - TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table77 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1156,7 +1156,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table80.AddRow(new string[] { + table77.AddRow(new string[] { "Today", "14", "Sale", @@ -1171,15 +1171,15 @@ public void SaleTransactions() "InvalidContract", "Variable Topup"}); #line 187 - testRunner.When("I perform the following transactions", ((string)(null)), table80, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table77, "When "); #line hidden - TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table78 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table81.AddRow(new string[] { + table78.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "14", @@ -1187,9 +1187,9 @@ public void SaleTransactions() "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)), table81, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table78, "Then "); #line hidden - TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table79 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1203,7 +1203,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table82.AddRow(new string[] { + table79.AddRow(new string[] { "Today", "15", "Sale", @@ -1218,15 +1218,15 @@ public void SaleTransactions() "Safaricom Contract", "EmptyProduct"}); #line 195 - testRunner.When("I perform the following transactions", ((string)(null)), table82, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table79, "When "); #line hidden - TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table80 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table83.AddRow(new string[] { + table80.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "15", @@ -1234,9 +1234,9 @@ public void SaleTransactions() "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)), table83, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table80, "Then "); #line hidden - TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table81 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1250,7 +1250,7 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table84.AddRow(new string[] { + table81.AddRow(new string[] { "Today", "16", "Sale", @@ -1265,15 +1265,15 @@ public void SaleTransactions() "Safaricom Contract", "InvalidProduct"}); #line 203 - testRunner.When("I perform the following transactions", ((string)(null)), table84, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table81, "When "); #line hidden - TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table82 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table85.AddRow(new string[] { + table82.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "16", @@ -1281,9 +1281,9 @@ public void SaleTransactions() "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)), table85, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table82, "Then "); #line hidden - TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table83 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1297,13 +1297,13 @@ public void SaleTransactions() "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table86.AddRow(new string[] { + table83.AddRow(new string[] { "Today", "17", "Sale", "1", "Test Merchant 4", - "123456780", + "123456783", "Test Estate 1", "Safaricom", "300.00", @@ -1312,15 +1312,15 @@ public void SaleTransactions() "Safaricom Contract", "Variable Topup"}); #line 211 - testRunner.When("I perform the following transactions", ((string)(null)), table86, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table83, "When "); #line hidden - TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table84 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table87.AddRow(new string[] { + table84.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "17", @@ -1328,7 +1328,7 @@ public void SaleTransactions() "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)), table87, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table84, "Then "); #line hidden } this.ScenarioCleanup(); diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 6998b5ce..0fb695f7 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 table88 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table85 = new TechTalk.SpecFlow.Table(new string[] { "Name", "DisplayName", "Description"}); - table88.AddRow(new string[] { + table85.AddRow(new string[] { "estateManagement", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); - table88.AddRow(new string[] { + table85.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table88.AddRow(new string[] { + table85.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)), table88, "Given "); + testRunner.Given("I create the following api scopes", ((string)(null)), table85, "Given "); #line hidden - TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table86 = new TechTalk.SpecFlow.Table(new string[] { "ResourceName", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table89.AddRow(new string[] { + table86.AddRow(new string[] { "estateManagement", "Estate Managememt REST", "Secret1", "estateManagement", "MerchantId, EstateId, role"}); - table89.AddRow(new string[] { + table86.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", ""}); - table89.AddRow(new string[] { + table86.AddRow(new string[] { "voucherManagement", "Voucher Management REST", "Secret1", "voucherManagement", ""}); #line 12 - testRunner.Given("the following api resources exist", ((string)(null)), table89, "Given "); + testRunner.Given("the following api resources exist", ((string)(null)), table86, "Given "); #line hidden - TechTalk.SpecFlow.Table table90 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table87 = new TechTalk.SpecFlow.Table(new string[] { "ClientId", "ClientName", "Secret", "AllowedScopes", "AllowedGrantTypes"}); - table90.AddRow(new string[] { + table87.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "estateManagement,transactionProcessor,voucherManagement", "client_credentials"}); #line 18 - testRunner.Given("the following clients exist", ((string)(null)), table90, "Given "); + testRunner.Given("the following clients exist", ((string)(null)), table87, "Given "); #line hidden - TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table88 = new TechTalk.SpecFlow.Table(new string[] { "ClientId"}); - table91.AddRow(new string[] { + table88.AddRow(new string[] { "serviceClient"}); #line 22 testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table91, "Given "); + "s", ((string)(null)), table88, "Given "); #line hidden - TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table89 = new TechTalk.SpecFlow.Table(new string[] { "EstateName"}); - table92.AddRow(new string[] { + table89.AddRow(new string[] { "Test Estate 1"}); #line 26 - testRunner.Given("I have created the following estates", ((string)(null)), table92, "Given "); + testRunner.Given("I have created the following estates", ((string)(null)), table89, "Given "); #line hidden - TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table90 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table93.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table93.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); #line 30 - testRunner.Given("I have created the following operators", ((string)(null)), table93, "Given "); + testRunner.Given("I have created the following operators", ((string)(null)), table90, "Given "); #line hidden - TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table91 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table94.AddRow(new string[] { + table91.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table94.AddRow(new string[] { + table91.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 35 - testRunner.Given("I create a contract with the following values", ((string)(null)), table94, "Given "); + testRunner.Given("I create a contract with the following values", ((string)(null)), table91, "Given "); #line hidden - TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table92 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -200,7 +200,7 @@ public virtual void FeatureBackground() "DisplayText", "Value", "ProductType"}); - table95.AddRow(new string[] { + table92.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -208,7 +208,7 @@ public virtual void FeatureBackground() "Custom", "", "MobileTopup"}); - table95.AddRow(new string[] { + table92.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)), table95, "When "); + testRunner.When("I create the following Products", ((string)(null)), table92, "When "); #line hidden - TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table93 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -227,7 +227,7 @@ public virtual void FeatureBackground() "CalculationType", "FeeDescription", "Value"}); - table96.AddRow(new string[] { + table93.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)), table96, "When "); + testRunner.When("I add the following Transaction Fees", ((string)(null)), table93, "When "); #line hidden } @@ -266,7 +266,7 @@ public void GetPendingSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table94 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -276,7 +276,7 @@ public void GetPendingSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table97.AddRow(new string[] { + table94.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"}); - table97.AddRow(new string[] { + table94.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"}); - table97.AddRow(new string[] { + table94.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)), table97, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table94, "Given "); #line hidden - TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table95 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table98.AddRow(new string[] { + table95.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table98.AddRow(new string[] { + table95.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table98.AddRow(new string[] { + table95.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table98.AddRow(new string[] { + table95.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table98.AddRow(new string[] { + table95.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table98.AddRow(new string[] { + table95.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)), table98, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table95, "Given "); #line hidden - TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table96 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table99.AddRow(new string[] { + table96.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table99.AddRow(new string[] { + table96.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table99.AddRow(new string[] { + table96.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)), table99, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table96, "Given "); #line hidden - TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table97 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table100.AddRow(new string[] { + table97.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table100.AddRow(new string[] { + table97.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table100.AddRow(new string[] { + table97.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)), table100, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table97, "Given "); #line hidden - TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table98 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -416,7 +416,7 @@ public void GetPendingSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -432,7 +432,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -448,7 +448,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -464,7 +464,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -480,7 +480,7 @@ public void GetPendingSettlement() "Variable Topup", "", ""}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -496,7 +496,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -512,7 +512,7 @@ public void GetPendingSettlement() "10 KES", "", "123456789"}); - table101.AddRow(new string[] { + table98.AddRow(new string[] { "2022-01-06", "7", "Sale", @@ -528,7 +528,7 @@ public void GetPendingSettlement() "10 KES", "test@recipient.co.uk", ""}); - table101.AddRow(new string[] { + table98.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)), table101, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table98, "When "); #line hidden - TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table99 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table102.AddRow(new string[] { + table99.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)), table102, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table99, "Then "); #line hidden - TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table100 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table103.AddRow(new string[] { + table100.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); - table103.AddRow(new string[] { + table100.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)), table103, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table100, "When "); #line hidden - TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table101 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table104.AddRow(new string[] { + table101.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)), table104, "When "); + testRunner.When("I get the completed settlements the following information should be returned", ((string)(null)), table101, "When "); #line hidden } this.ScenarioCleanup(); @@ -662,7 +662,7 @@ public void ProcessSettlement() #line 4 this.FeatureBackground(); #line hidden - TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table102 = new TechTalk.SpecFlow.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -672,7 +672,7 @@ public void ProcessSettlement() "EmailAddress", "EstateName", "SettlementSchedule"}); - table105.AddRow(new string[] { + table102.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"}); - table105.AddRow(new string[] { + table102.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)), table105, "Given "); + testRunner.Given("I create the following merchants", ((string)(null)), table102, "Given "); #line hidden - TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table103 = new TechTalk.SpecFlow.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table106.AddRow(new string[] { + table103.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table106.AddRow(new string[] { + table103.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table106.AddRow(new string[] { + table103.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table106.AddRow(new string[] { + table103.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)), table106, "Given "); + testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table103, "Given "); #line hidden - TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table104 = new TechTalk.SpecFlow.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table107.AddRow(new string[] { + table104.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table107.AddRow(new string[] { + table104.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)), table107, "Given "); + testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table104, "Given "); #line hidden - TechTalk.SpecFlow.Table table108 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table105 = new TechTalk.SpecFlow.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table108.AddRow(new string[] { + table105.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table108.AddRow(new string[] { + table105.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)), table108, "Given "); + testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table105, "Given "); #line hidden - TechTalk.SpecFlow.Table table109 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table106 = new TechTalk.SpecFlow.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -780,7 +780,7 @@ public void ProcessSettlement() "ProductName", "RecipientEmail", "RecipientMobile"}); - table109.AddRow(new string[] { + table106.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -796,7 +796,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table109.AddRow(new string[] { + table106.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -812,7 +812,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table109.AddRow(new string[] { + table106.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -828,7 +828,7 @@ public void ProcessSettlement() "Variable Topup", "", ""}); - table109.AddRow(new string[] { + table106.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -844,7 +844,7 @@ public void ProcessSettlement() "10 KES", "test@recipient.co.uk", ""}); - table109.AddRow(new string[] { + table106.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)), table109, "When "); + testRunner.When("I perform the following transactions", ((string)(null)), table106, "When "); #line hidden - TechTalk.SpecFlow.Table table110 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table107 = new TechTalk.SpecFlow.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table110.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table110.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table110.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table110.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table110.AddRow(new string[] { + table107.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)), table110, "Then "); + testRunner.Then("transaction response should contain the following information", ((string)(null)), table107, "Then "); #line hidden - TechTalk.SpecFlow.Table table111 = new TechTalk.SpecFlow.Table(new string[] { + TechTalk.SpecFlow.Table table108 = new TechTalk.SpecFlow.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table111.AddRow(new string[] { + table108.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)), table111, "When "); + testRunner.When("I get the pending settlements the following information should be returned", ((string)(null)), table108, "When "); #line hidden #line 152 testRunner.When("I process the settlement for \'2022-01-13\' on Estate \'Test Estate 1\' for Merchant " + From 521fff7947f6687d91a81c5185523499d2de88de Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 6 Nov 2023 15:21:40 +0000 Subject: [PATCH 5/8] Fix broken unit tests --- .../Services/TransactionValidationServiceTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs index 6e8ee367..0e81e187 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs @@ -517,6 +517,8 @@ public async Task TransactionValidationService_ValidateSaleTransaction_InvalidTr .ReturnsAsync(TestData.GetEstateResponseWithOperator1); this.EstateClient.Setup(e => e.GetMerchant(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.GetMerchantResponseWithOperator1); + this.EstateClient.Setup(e => e.GetMerchantContracts(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .ReturnsAsync(TestData.MerchantContractResponses); (String responseMessage, TransactionResponseCode responseCode) response = await this.TransactionValidationService.ValidateSaleTransaction(TestData.EstateId, TestData.MerchantId, @@ -659,7 +661,8 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantN .ReturnsAsync(TestData.GetEstateResponseWithOperator1); this.EstateClient.Setup(e => e.GetMerchant(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.GetMerchantResponseWithOperator1); - + this.EstateClient.Setup(e => e.GetMerchantContracts(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .ReturnsAsync(TestData.MerchantContractResponses); this.StateRepository.Setup(p => p.Load(It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.MerchantBalanceProjectionStateNoCredit); From ec4373796a66ecd8941bba3a25da2d0b57b0db30 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 6 Nov 2023 16:05:06 +0000 Subject: [PATCH 6/8] :| --- .../Features/LogonTransaction.feature | 12 +- .../Features/LogonTransaction.feature.cs | 577 +----------------- 2 files changed, 7 insertions(+), 582 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature index a3d7e686..0ffbb712 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature @@ -49,12 +49,12 @@ Background: | Test Operator 1 | Test Merchant 6 | 00000001 | 10000001 | Test Estate 1 | | Test Operator 1 | Test Merchant 7 | 00000001 | 10000001 | Test Estate 1 | - Given I make the following manual merchant deposits - | Reference | Amount | DateTime | MerchantName | EstateName | - | Deposit1 | 2000.00 | Today | Test Merchant 1 | Test Estate 1 | - | Deposit1 | 1000.00 | Today | Test Merchant 2 | Test Estate 1 | - | Deposit1 | 1000.00 | Today | Test Merchant 3 | Test Estate 1 | - | Deposit1 | 1000.00 | Today | Test Merchant 4 | Test Estate 1 | + #Given I make the following manual merchant deposits + #| Reference | Amount | DateTime | MerchantName | EstateName | + #| Deposit1 | 2000.00 | Today | Test Merchant 1 | Test Estate 1 | + #| Deposit1 | 1000.00 | Today | Test Merchant 2 | Test Estate 1 | + #| Deposit1 | 1000.00 | Today | Test Merchant 3 | Test Estate 1 | + #| Deposit1 | 1000.00 | Today | Test Merchant 4 | Test Estate 1 | @PRTest Scenario: Logon Transactions diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index a63c2fd7..b34d8696 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -1,576 +1 @@ -// ------------------------------------------------------------------------------ -// -// 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 - TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { - "Reference", - "Amount", - "DateTime", - "MerchantName", - "EstateName"}); - table9.AddRow(new string[] { - "Deposit1", - "2000.00", - "Today", - "Test Merchant 1", - "Test Estate 1"}); - table9.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 2", - "Test Estate 1"}); - table9.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 3", - "Test Estate 1"}); - table9.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 4", - "Test Estate 1"}); -#line 52 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table9, "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 table10 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table10.AddRow(new string[] { - "Today", - "1", - "Logon", - "Test Merchant 1", - "123456780", - "Test Estate 1"}); - table10.AddRow(new string[] { - "Today", - "2", - "Logon", - "Test Merchant 2", - "123456781", - "Test Estate 1"}); - table10.AddRow(new string[] { - "Today", - "3", - "Logon", - "Test Merchant 3", - "123456782", - "Test Estate 1"}); -#line 62 - testRunner.When("I perform the following transactions", ((string)(null)), table10, "When "); -#line hidden - TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table11.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "0001", - "SUCCESS"}); - table11.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 2", - "2", - "0001", - "SUCCESS"}); - table11.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)), table11, "Then "); -#line hidden - TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "MerchantNumber", - "EstateName"}); - table12.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)), table12, "Given "); -#line hidden - TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table13.AddRow(new string[] { - "Today", - "4", - "Logon", - "Test Merchant 4", - "123456783", - "Test Estate 1"}); -#line 78 - testRunner.When("I perform the following transactions", ((string)(null)), table13, "When "); -#line hidden - TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table14.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)), table14, "Then "); -#line hidden - TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table15.AddRow(new string[] { - "Today", - "5", - "Logon", - "Test Merchant 1", - "13579135", - "Test Estate 1"}); -#line 86 - testRunner.When("I perform the following transactions", ((string)(null)), table15, "When "); -#line hidden - TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table16.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)), table16, "Then "); -#line hidden - TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table17.AddRow(new string[] { - "Today", - "6", - "Logon", - "Test Merchant 1", - "123456785", - "InvalidEstate"}); -#line 94 - testRunner.When("I perform the following transactions", ((string)(null)), table17, "When "); -#line hidden - TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table18.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)), table18, "Then "); -#line hidden - TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName"}); - table19.AddRow(new string[] { - "Today", - "7", - "Logon", - "InvalidMerchant", - "123456786", - "Test Estate 1"}); -#line 102 - testRunner.When("I perform the following transactions", ((string)(null)), table19, "When "); -#line hidden - TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table20.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)), table20, "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 +#error Unable to use SpecFlow tools folder 'C:\Users\stuar\.nuget\packages\specflow\3.9.74\tools': Folder does not exist From a03f93a34d29e8fc1a1ccb15706bf3d17f67518c Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 6 Nov 2023 16:23:44 +0000 Subject: [PATCH 7/8] :| --- TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs index 4fe162e9..16c1b8e7 100644 --- a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs @@ -685,7 +685,7 @@ await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBal balanceHistory.ShouldNotBeNull(); balanceHistory.ShouldNotBeEmpty(); balanceHistory.Count.ShouldBe(table.RowCount); - }); + }, TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(30)); foreach (TableRow tableRow in table.Rows) { //| DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | var entryDateTime = SpecflowTableHelper.GetDateForDateString(tableRow["DateTime"], DateTime.UtcNow); From 493c52402b98c1a5b809d92d37e33314e553ee6f Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 6 Nov 2023 16:47:21 +0000 Subject: [PATCH 8/8] ... --- .../Features/SaleTransactionFeature.feature | 61 +++++++++---------- .../Shared/SharedSteps.cs | 1 + 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index d5bfe443..37e73d71 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -118,36 +118,7 @@ Scenario: Sale Transactions | Test Estate 1 | Test Merchant 3 | 7 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 8 | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 1 | 9 | 0000 | SUCCESS | - - Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 1' - | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | - | Today | Merchant Deposit | C | 240.00 | 0.00 | 240.00 | 230.00 | - | Today | Transaction Completed | D | 0.00 | 110.00 | 110.00 | 130.00 | - | Today | Transaction Completed | D | 0.00 | 90.00 | 90.00 | 30.00 | - | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 20.00 | - | Today | Transaction Completed | D | 0.00 | 20.00 | 20.00 | 20.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.55 | 0.55 | 20.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.45 | 0.45 | 20.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.01 | 0.10 | 20.00 | - | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | - - - Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 2' - | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | - | Today | Merchant Deposit | C | 110.00 | 0.00 | 110.00 | 230.00 | - | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 130.00 | - | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 30.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.50 | 0.50 | 20.00 | - | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | - - Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 3' - | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | - | Today | Merchant Deposit | C | 110.00 | 0.00 | 110.00 | 230.00 | - | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 130.00 | - | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 30.00 | - | Today | Transaction Fee Processed | C | 0.00 | 0.85 | 0.50 | 20.00 | - | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | - + When I request the receipt is resent | EstateName | MerchantName | TransactionNumber | | Test Estate 1 | Test Merchant 1 | 1 | @@ -214,4 +185,32 @@ Scenario: Sale Transactions Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | ResponseCode | ResponseMessage | - | Test Estate 1 | Test Merchant 4 | 17 | 1009 | Merchant [Test Merchant 4] does not have enough credit available [100.00] to perform transaction amount [300.00] | \ No newline at end of file + | Test Estate 1 | Test Merchant 4 | 17 | 1009 | Merchant [Test Merchant 4] does not have enough credit available [100.00] to perform transaction amount [300.00] | + + Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 1' + | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | + | Today | Merchant Deposit | C | 240.00 | 0.00 | 240.00 | 230.00 | + | Today | Transaction Completed | D | 0.00 | 110.00 | 110.00 | 130.00 | + | Today | Transaction Completed | D | 0.00 | 90.00 | 90.00 | 30.00 | + | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 20.00 | + | Today | Transaction Completed | D | 0.00 | 20.00 | 20.00 | 20.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.55 | 0.55 | 20.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.45 | 0.45 | 20.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.01 | 0.10 | 20.00 | + | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | + + Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 2' + | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | + | Today | Merchant Deposit | C | 110.00 | 0.00 | 110.00 | 230.00 | + | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 130.00 | + | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 30.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.50 | 0.50 | 20.00 | + | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | + + Then the following entries appear in the merchants balance history for estate 'Test Estate 1' and merchant 'Test Merchant 3' + | DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | + | Today | Merchant Deposit | C | 110.00 | 0.00 | 110.00 | 230.00 | + | Today | Transaction Completed | D | 0.00 | 100.00 | 100.00 | 130.00 | + | Today | Transaction Completed | D | 0.00 | 10.00 | 10.00 | 30.00 | + | Today | Transaction Fee Processed | C | 0.00 | 0.85 | 0.50 | 20.00 | + | Today | Opening Balance | C | 0.00 | 0.00 | 0.00 | 20.00 | \ No newline at end of file diff --git a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs index 16c1b8e7..ad1e1931 100644 --- a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs @@ -686,6 +686,7 @@ await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBal balanceHistory.ShouldNotBeEmpty(); balanceHistory.Count.ShouldBe(table.RowCount); }, TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(30)); + foreach (TableRow tableRow in table.Rows) { //| DateTime | Reference | EntryType | In | Out | ChangeAmount | Balance | var entryDateTime = SpecflowTableHelper.GetDateForDateString(tableRow["DateTime"], DateTime.UtcNow);