diff --git a/TransactionProcessor.BusinessLogic/OperatorInterfaces/SafaricomPinless/SafaricomPinlessProxy.cs b/TransactionProcessor.BusinessLogic/OperatorInterfaces/SafaricomPinless/SafaricomPinlessProxy.cs index f99ca631..71d65e41 100644 --- a/TransactionProcessor.BusinessLogic/OperatorInterfaces/SafaricomPinless/SafaricomPinlessProxy.cs +++ b/TransactionProcessor.BusinessLogic/OperatorInterfaces/SafaricomPinless/SafaricomPinlessProxy.cs @@ -84,7 +84,16 @@ public async Task ProcessSaleMessage(Guid transactionId, throw new Exception("CustomerAccountNumber is a required field for this transaction type"); } - String requestUrl = this.BuildRequest(transactionDateTime, transactionReference, customerMsisdn, transactionAmount); + // Multiply amount before sending + // Covert the transaction amount to Decimal and remove decimal places + if (Decimal.TryParse(transactionAmount, out Decimal amountAsDecimal) == false) + { + throw new Exception("Transaction Amount is not a valid decimal value"); + } + + Decimal operatorTransactionAmount = amountAsDecimal * 100; + + String requestUrl = this.BuildRequest(transactionDateTime, transactionReference, customerMsisdn, operatorTransactionAmount); // Concatenate the request message HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, new Uri(requestUrl)); @@ -115,18 +124,12 @@ public async Task ProcessSaleMessage(Guid transactionId, private String BuildRequest(DateTime transactionDateTime, String externalReference, String customerMsisdn, - String transactionAmount) + Decimal transactionAmount) { String requestUrl = $"{this.SafaricomConfiguration.Url}?VENDOR={this.SafaricomConfiguration.LoginId}&REQTYPE=EXRCTRFREQ&DATA="; StringBuilder xmlData = new StringBuilder(); - - // Covert the transaction amount to Decimal and remove decimal places - if (Decimal.TryParse(transactionAmount, out Decimal amountAsDecimal) == false) - { - throw new Exception("Transaction Amount is not a valid decimal value"); - } - + // Now build up the XML part of the message xmlData.Append(""); xmlData.Append(""); @@ -140,7 +143,7 @@ private String BuildRequest(DateTime transactionDateTime, xmlData.Append($"{this.SafaricomConfiguration.ExtCode}"); xmlData.Append($"{externalReference}"); xmlData.Append($"{customerMsisdn}"); - xmlData.Append($"{amountAsDecimal:G0}"); + xmlData.Append($"{transactionAmount:G0}"); xmlData.Append("0"); xmlData.Append("0"); xmlData.Append("0"); diff --git a/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature index c21493fe..3c60551a 100644 --- a/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature @@ -61,19 +61,19 @@ Background: 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 | 200.00 | Today | Test Merchant 1 | Test Estate 1 | + | Deposit1 | 100.00 | Today | Test Merchant 2 | Test Estate 1 | + | Deposit1 | 100.00 | Today | Test Merchant 3 | Test Estate 2 | @PRTest Scenario: Sale Transactions When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | | Safaricom Contract | Variable Topup | - | Today | 2 | Sale | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | | Safaricom Contract | Variable Topup | - | Today | 3 | Sale | Test Merchant 3 | 123456782 | Test Estate 2 | Safaricom | 1000.00 | 123456789 | | Safaricom Contract | Variable Topup | - | Today | 4 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 1 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | + | Today | 2 | Sale | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | + | Today | 3 | Sale | Test Merchant 3 | 123456782 | Test Estate 2 | Safaricom | 100.00 | 123456789 | | Safaricom Contract | Variable Topup | + | Today | 4 | Sale | 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 | @@ -87,7 +87,7 @@ Scenario: Sale Transaction with Invalid Device When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | Test Merchant 1 | 123456781 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 1 | Sale | 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 | @@ -97,7 +97,7 @@ Scenario: Sale Transaction with Invalid Estate When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | Test Merchant 1 | 123456780 | InvalidEstate | Safaricom | 1000.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 1 | Sale | 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 | @@ -107,7 +107,7 @@ Scenario: Sale Transaction with Invalid Merchant When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | InvalidMerchant | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 1 | Sale | 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 | @@ -118,9 +118,9 @@ Scenario: Sale Transaction with Not Enough Credit Available When I perform the following transactions | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | - | Today | 1 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 3000.00 | 123456789 | testcustomer@customer.co.uk | Safaricom Contract | Variable Topup | + | Today | 1 | Sale | Test Merchant 1 | 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 [2000.0] to perform transaction amount [3000.00] | + | Test Estate 1 | Test Merchant 1 | 1 | 1009 | Merchant [Test Merchant 1] does not have enough credit available [200.0] to perform transaction amount [300.00] | diff --git a/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature.cs index 7bee7287..5aa74e27 100644 --- a/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/SaleTransaction/SaleTransactionFeature.feature.cs @@ -1,822 +1,3 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.3.0.0 -// SpecFlow Generator Version:3.1.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.SaleTransaction -{ - using TechTalk.SpecFlow; - using System; - using System.Linq; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.3.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [Xunit.TraitAttribute("Category", "base")] - [Xunit.TraitAttribute("Category", "shared")] - public partial class SaleTransactionFeature : object, Xunit.IClassFixture, System.IDisposable - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - - private string[] _featureTags = new string[] { - "base", - "shared"}; - - private Xunit.Abstractions.ITestOutputHelper _testOutputHelper; - -#line 1 "SaleTransactionFeature.feature" -#line hidden - - public SaleTransactionFeature(SaleTransactionFeature.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"), "SaleTransaction", null, ProgrammingLanguage.CSharp, new string[] { - "base", - "shared"}); - testRunner.OnFeatureStart(featureInfo); - } - - public static void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - public virtual void TestInitialize() - { - } - - public virtual void TestTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioInitialize(scenarioInfo); - testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(_testOutputHelper); - } - - public virtual void ScenarioStart() - { - testRunner.OnScenarioStart(); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - public virtual void FeatureBackground() - { -#line 4 -#line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { - "ResourceName", - "DisplayName", - "Secret", - "Scopes", - "UserClaims"}); - table22.AddRow(new string[] { - "estateManagement", - "Estate Managememt REST", - "Secret1", - "estateManagement", - "MerchantId, EstateId, role"}); - table22.AddRow(new string[] { - "transactionProcessor", - "Transaction Processor REST", - "Secret1", - "transactionProcessor", - ""}); -#line 6 - testRunner.Given("the following api resources exist", ((string)(null)), table22, "Given "); -#line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { - "ClientId", - "ClientName", - "Secret", - "AllowedScopes", - "AllowedGrantTypes"}); - table23.AddRow(new string[] { - "serviceClient", - "Service Client", - "Secret1", - "estateManagement,transactionProcessor", - "client_credentials"}); -#line 11 - testRunner.Given("the following clients exist", ((string)(null)), table23, "Given "); -#line hidden - TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { - "ClientId"}); - table24.AddRow(new string[] { - "serviceClient"}); -#line 15 - testRunner.Given("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table24, "Given "); -#line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName"}); - table25.AddRow(new string[] { - "Test Estate 1"}); - table25.AddRow(new string[] { - "Test Estate 2"}); -#line 19 - testRunner.Given("I have created the following estates", ((string)(null)), table25, "Given "); -#line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "RequireCustomMerchantNumber", - "RequireCustomTerminalNumber"}); - table26.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "True", - "True"}); - table26.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "True", - "True"}); -#line 24 - testRunner.Given("I have created the following operators", ((string)(null)), table26, "Given "); -#line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription"}); - table27.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract"}); - table27.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract"}); -#line 29 - testRunner.Given("I create a contract with the following values", ((string)(null)), table27, "Given "); -#line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription", - "ProductName", - "DisplayText", - "Value"}); - table28.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Custom", - ""}); - table28.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Custom", - ""}); -#line 34 - testRunner.When("I create the following Products", ((string)(null)), table28, "When "); -#line hidden - TechTalk.SpecFlow.Table table29 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "OperatorName", - "ContractDescription", - "ProductName", - "CalculationType", - "FeeDescription", - "Value"}); - table29.AddRow(new string[] { - "Test Estate 1", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Fixed", - "Merchant Commission", - "2.50"}); - table29.AddRow(new string[] { - "Test Estate 2", - "Safaricom", - "Safaricom Contract", - "Variable Topup", - "Percentage", - "Merchant Commission", - "0.85"}); -#line 39 - testRunner.When("I add the following Transaction Fees", ((string)(null)), table29, "When "); -#line hidden - TechTalk.SpecFlow.Table table30 = new TechTalk.SpecFlow.Table(new string[] { - "MerchantName", - "AddressLine1", - "Town", - "Region", - "Country", - "ContactName", - "EmailAddress", - "EstateName"}); - table30.AddRow(new string[] { - "Test Merchant 1", - "Address Line 1", - "TestTown", - "Test Region", - "United Kingdom", - "Test Contact 1", - "testcontact1@merchant1.co.uk", - "Test Estate 1"}); - table30.AddRow(new string[] { - "Test Merchant 2", - "Address Line 1", - "TestTown", - "Test Region", - "United Kingdom", - "Test Contact 2", - "testcontact2@merchant2.co.uk", - "Test Estate 1"}); - table30.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 44 - testRunner.Given("I create the following merchants", ((string)(null)), table30, "Given "); -#line hidden - TechTalk.SpecFlow.Table table31 = new TechTalk.SpecFlow.Table(new string[] { - "OperatorName", - "MerchantName", - "MerchantNumber", - "TerminalNumber", - "EstateName"}); - table31.AddRow(new string[] { - "Safaricom", - "Test Merchant 1", - "00000001", - "10000001", - "Test Estate 1"}); - table31.AddRow(new string[] { - "Safaricom", - "Test Merchant 2", - "00000002", - "10000002", - "Test Estate 1"}); - table31.AddRow(new string[] { - "Safaricom", - "Test Merchant 3", - "00000003", - "10000003", - "Test Estate 2"}); -#line 50 - testRunner.Given("I have assigned the following operator to the merchants", ((string)(null)), table31, "Given "); -#line hidden - TechTalk.SpecFlow.Table table32 = new TechTalk.SpecFlow.Table(new string[] { - "DeviceIdentifier", - "MerchantName", - "EstateName"}); - table32.AddRow(new string[] { - "123456780", - "Test Merchant 1", - "Test Estate 1"}); - table32.AddRow(new string[] { - "123456781", - "Test Merchant 2", - "Test Estate 1"}); - table32.AddRow(new string[] { - "123456782", - "Test Merchant 3", - "Test Estate 2"}); -#line 56 - testRunner.Given("I have assigned the following devices to the merchants", ((string)(null)), table32, "Given "); -#line hidden - TechTalk.SpecFlow.Table table33 = new TechTalk.SpecFlow.Table(new string[] { - "Reference", - "Amount", - "DateTime", - "MerchantName", - "EstateName"}); - table33.AddRow(new string[] { - "Deposit1", - "2000.00", - "Today", - "Test Merchant 1", - "Test Estate 1"}); - table33.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 2", - "Test Estate 1"}); - table33.AddRow(new string[] { - "Deposit1", - "1000.00", - "Today", - "Test Merchant 3", - "Test Estate 2"}); -#line 62 - testRunner.Given("I make the following manual merchant deposits", ((string)(null)), table33, "Given "); -#line hidden - } - - void System.IDisposable.Dispose() - { - this.TestTearDown(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transactions")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transactions")] - [Xunit.TraitAttribute("Category", "PRTest")] - public virtual 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); -#line 69 -this.ScenarioInitialize(scenarioInfo); -#line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); -#line hidden - TechTalk.SpecFlow.Table table34 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table34.AddRow(new string[] { - "Today", - "1", - "Sale", - "Test Merchant 1", - "123456780", - "Test Estate 1", - "Safaricom", - "1000.00", - "123456789", - "", - "Safaricom Contract", - "Variable Topup"}); - table34.AddRow(new string[] { - "Today", - "2", - "Sale", - "Test Merchant 2", - "123456781", - "Test Estate 1", - "Safaricom", - "1000.00", - "123456789", - "", - "Safaricom Contract", - "Variable Topup"}); - table34.AddRow(new string[] { - "Today", - "3", - "Sale", - "Test Merchant 3", - "123456782", - "Test Estate 2", - "Safaricom", - "1000.00", - "123456789", - "", - "Safaricom Contract", - "Variable Topup"}); - table34.AddRow(new string[] { - "Today", - "4", - "Sale", - "Test Merchant 1", - "123456780", - "Test Estate 1", - "Safaricom", - "1000.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 71 - testRunner.When("I perform the following transactions", ((string)(null)), table34, "When "); -#line hidden - TechTalk.SpecFlow.Table table35 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table35.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "0000", - "SUCCESS"}); - table35.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 2", - "2", - "0000", - "SUCCESS"}); - table35.AddRow(new string[] { - "Test Estate 2", - "Test Merchant 3", - "3", - "0000", - "SUCCESS"}); - table35.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "4", - "0000", - "SUCCESS"}); -#line 78 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table35, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [Xunit.SkippableFactAttribute(DisplayName="Sale Transaction with Invalid Device")] - [Xunit.TraitAttribute("FeatureTitle", "SaleTransaction")] - [Xunit.TraitAttribute("Description", "Sale Transaction with Invalid Device")] - [Xunit.TraitAttribute("Category", "PRTest")] - public virtual void SaleTransactionWithInvalidDevice() - { - string[] tagsOfScenario = new string[] { - "PRTest"}; - 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); -#line 86 -this.ScenarioInitialize(scenarioInfo); -#line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); -#line hidden - TechTalk.SpecFlow.Table table36 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table36.AddRow(new string[] { - "Today", - "1", - "Sale", - "Test Merchant 1", - "123456781", - "Test Estate 1", - "Safaricom", - "1000.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 88 - testRunner.When("I perform the following transactions", ((string)(null)), table36, "When "); -#line hidden - TechTalk.SpecFlow.Table table37 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table37.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "1000", - "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); -#line 92 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table37, "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 virtual 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); -#line 96 -this.ScenarioInitialize(scenarioInfo); -#line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); -#line hidden - TechTalk.SpecFlow.Table table38 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table38.AddRow(new string[] { - "Today", - "1", - "Sale", - "Test Merchant 1", - "123456780", - "InvalidEstate", - "Safaricom", - "1000.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 98 - testRunner.When("I perform the following transactions", ((string)(null)), table38, "When "); -#line hidden - TechTalk.SpecFlow.Table table39 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table39.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)), table39, "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 virtual 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); -#line 106 -this.ScenarioInitialize(scenarioInfo); -#line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); -#line hidden - TechTalk.SpecFlow.Table table40 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table40.AddRow(new string[] { - "Today", - "1", - "Sale", - "InvalidMerchant", - "123456780", - "Test Estate 1", - "Safaricom", - "1000.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 108 - testRunner.When("I perform the following transactions", ((string)(null)), table40, "When "); -#line hidden - TechTalk.SpecFlow.Table table41 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table41.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 112 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table41, "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")] - [Xunit.TraitAttribute("Category", "PRTest")] - public virtual void SaleTransactionWithNotEnoughCreditAvailable() - { - string[] tagsOfScenario = new string[] { - "PRTest"}; - 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); -#line 117 -this.ScenarioInitialize(scenarioInfo); -#line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 4 -this.FeatureBackground(); -#line hidden - TechTalk.SpecFlow.Table table42 = new TechTalk.SpecFlow.Table(new string[] { - "DateTime", - "TransactionNumber", - "TransactionType", - "MerchantName", - "DeviceIdentifier", - "EstateName", - "OperatorName", - "TransactionAmount", - "CustomerAccountNumber", - "CustomerEmailAddress", - "ContractDescription", - "ProductName"}); - table42.AddRow(new string[] { - "Today", - "1", - "Sale", - "Test Merchant 1", - "123456780", - "Test Estate 1", - "Safaricom", - "3000.00", - "123456789", - "testcustomer@customer.co.uk", - "Safaricom Contract", - "Variable Topup"}); -#line 119 - testRunner.When("I perform the following transactions", ((string)(null)), table42, "When "); -#line hidden - TechTalk.SpecFlow.Table table43 = new TechTalk.SpecFlow.Table(new string[] { - "EstateName", - "MerchantName", - "TransactionNumber", - "ResponseCode", - "ResponseMessage"}); - table43.AddRow(new string[] { - "Test Estate 1", - "Test Merchant 1", - "1", - "1009", - "Merchant [Test Merchant 1] does not have enough credit available [2000.0] to perf" + - "orm transaction amount [3000.00]"}); -#line 124 - testRunner.Then("transaction response should contain the following information", ((string)(null)), table43, "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.3.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class FixtureData : System.IDisposable - { - - public FixtureData() - { - SaleTransactionFeature.FeatureSetup(); - } - - void System.IDisposable.Dispose() - { - SaleTransactionFeature.FeatureTearDown(); - } - } - } -} -#pragma warning restore -#endregion +#error Could not find a reference to SpecFlow in project 'TransactionProcessor.IntegrationTests'. +#error Please add the 'TechTalk.SpecFlow' package to the project and use MSBuild generation instead of using SpecFlowSingleFileGenerator. +#error For more information see https://specflow.org/documentation/Generate-Tests-from-MsBuild/ \ No newline at end of file