diff --git a/TransactionProcessor.Aggregates.Tests/ContractAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/ContractAggregateTests.cs index 2845d7e3..11e16720 100644 --- a/TransactionProcessor.Aggregates.Tests/ContractAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/ContractAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Models.Contract; @@ -7,6 +8,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class ContractAggregateTests { + public ContractAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void ContractAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/EstateAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/EstateAggregateTests.cs index d46b7dd3..484ccae6 100644 --- a/TransactionProcessor.Aggregates.Tests/EstateAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/EstateAggregateTests.cs @@ -1,4 +1,5 @@ -using Shouldly; +using Shared.Serialisation; +using Shouldly; using SimpleResults; using TransactionProcessor.Models.Estate; using TransactionProcessor.Testing; @@ -7,6 +8,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class EstateAggregateTests { + public EstateAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void EstateAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/FloatActivityAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/FloatActivityAggregateTests.cs index 5771d04c..7fa192af 100644 --- a/TransactionProcessor.Aggregates.Tests/FloatActivityAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/FloatActivityAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Testing; @@ -5,6 +6,11 @@ namespace TransactionProcessor.Aggregates.Tests; public class FloatActivityAggregateTests { + + public FloatActivityAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void FloatActivityAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/FloatAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/FloatAggregateTests.cs index 0b4b0b63..7f5ac511 100644 --- a/TransactionProcessor.Aggregates.Tests/FloatAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/FloatAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Testing; @@ -6,6 +7,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class FloatAggregateTests { + public FloatAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void FloatAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs index 99d95e7b..c22938fd 100644 --- a/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs @@ -1,5 +1,6 @@ using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; +using Shared.Serialisation; using Shouldly; using SimpleResults; using System.Reflection; @@ -14,6 +15,11 @@ namespace TransactionProcessor.Aggregates.Tests { public class MerchantAggregateTests{ + + public MerchantAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void MerchantAggregate_CanBeCreated_IsCreated(){ MerchantAggregate aggregate = MerchantAggregate.Create(TestData.MerchantId); diff --git a/TransactionProcessor.Aggregates.Tests/MerchantDepositListAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/MerchantDepositListAggregateTests.cs index 6eb487c0..d50adab2 100644 --- a/TransactionProcessor.Aggregates.Tests/MerchantDepositListAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/MerchantDepositListAggregateTests.cs @@ -1,4 +1,5 @@ using Shared.EventStore.Aggregate; +using Shared.Serialisation; using Shared.ValueObjects; using Shouldly; using SimpleResults; @@ -9,6 +10,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class MerchantDepositListAggregateTests { + public MerchantDepositListAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + #region Methods [Fact] diff --git a/TransactionProcessor.Aggregates.Tests/MerchantStatementAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/MerchantStatementAggregateTests.cs index 000d22e5..1866dcfc 100644 --- a/TransactionProcessor.Aggregates.Tests/MerchantStatementAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/MerchantStatementAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Models.Merchant; @@ -6,6 +7,11 @@ namespace TransactionProcessor.Aggregates.Tests { public class MerchantStatementAggregateTests { + + public MerchantStatementAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void MerchantStatementAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/MerchantStatementForDateAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/MerchantStatementForDateAggregateTests.cs index 3fa82221..140a694f 100644 --- a/TransactionProcessor.Aggregates.Tests/MerchantStatementForDateAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/MerchantStatementForDateAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.DataTransferObjects.Requests.Merchant; @@ -9,6 +10,10 @@ namespace TransactionProcessor.Aggregates.Tests; public class MerchantStatementForDateAggregateTests { + public MerchantStatementForDateAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + private const Int32 TransactionLineType = 1; private const Int32 SettledFeeLineType = 2; private const Int32 DepositLineType = 3; diff --git a/TransactionProcessor.Aggregates.Tests/OperatorAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/OperatorAggregateTests.cs index 9227b289..0957cd4e 100644 --- a/TransactionProcessor.Aggregates.Tests/OperatorAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/OperatorAggregateTests.cs @@ -1,4 +1,5 @@ -using Shouldly; +using Shared.Serialisation; +using Shouldly; using SimpleResults; using TransactionProcessor.Testing; @@ -6,10 +7,8 @@ namespace TransactionProcessor.Aggregates.Tests { public class OperatorAggregateTests { - [Fact] - public void OperatorAggregate_Create_OperatorIsCreated() - { - + public OperatorAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); } [Fact] diff --git a/TransactionProcessor.Aggregates.Tests/ReconciliationAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/ReconciliationAggregateTests.cs index 2638f044..2da9f1aa 100644 --- a/TransactionProcessor.Aggregates.Tests/ReconciliationAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/ReconciliationAggregateTests.cs @@ -1,4 +1,5 @@ -using Shouldly; +using Shared.Serialisation; +using Shouldly; using SimpleResults; using TransactionProcessor.Testing; @@ -6,6 +7,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class ReconciliationAggregateTests { + public ReconciliationAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void ReconciliationAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/SettlementAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/SettlementAggregateTests.cs index 725b4620..408916e7 100644 --- a/TransactionProcessor.Aggregates.Tests/SettlementAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/SettlementAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Testing; @@ -6,6 +7,10 @@ namespace TransactionProcessor.Aggregates.Tests { public class SettlementAggregateTests { + public SettlementAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void SettlementAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates.Tests/TransactionAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/TransactionAggregateTests.cs index 8db7624a..fe738d1a 100644 --- a/TransactionProcessor.Aggregates.Tests/TransactionAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/TransactionAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Aggregates; @@ -8,6 +9,11 @@ namespace TransactionProcessor.Aggregates.Tests{ public class TransactionAggregateTests{ + + public TransactionAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void TransactionAggregate_CanBeCreated_IsCreated(){ Aggregates.TransactionAggregate aggregate = Aggregates.TransactionAggregate.Create(TestData.TransactionId); diff --git a/TransactionProcessor.Aggregates.Tests/VoucherAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/VoucherAggregateTests.cs index f9d20df4..7089b9fd 100644 --- a/TransactionProcessor.Aggregates.Tests/VoucherAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/VoucherAggregateTests.cs @@ -1,3 +1,4 @@ +using Shared.Serialisation; using Shouldly; using SimpleResults; using TransactionProcessor.Models; @@ -7,6 +8,10 @@ namespace TransactionProcessor.Aggregates.Tests; public class VoucherAggregateTests { + public VoucherAggregateTests() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + [Fact] public void VoucherAggregate_CanBeCreated_IsCreated() { diff --git a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj index 4e887b8b..9830c488 100644 --- a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj +++ b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj @@ -8,7 +8,7 @@ - + diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ContractDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ContractDomainEventHandlerTests.cs index 2588611b..940c6fee 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ContractDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ContractDomainEventHandlerTests.cs @@ -1,7 +1,9 @@ -using System.Threading; -using Moq; +using Moq; using Shared.Logger; +using Shared.Serialisation; using Shouldly; +using System.Text.Json; +using System.Threading; using TransactionProcessor.BusinessLogic.EventHandling; using TransactionProcessor.DomainEvents; using TransactionProcessor.Repository; @@ -12,6 +14,7 @@ namespace TransactionProcessor.BusinessLogic.Tests.DomainEventHandlers; public class ContractDomainEventHandlerTests { + #region Methods private Mock EstateReportingRepository; @@ -19,6 +22,7 @@ public class ContractDomainEventHandlerTests private ReadModelDomainEventHandler DomainEventHandler; public ContractDomainEventHandlerTests() { Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); this.EstateReportingRepository= new Mock(); this.DomainEventHandler = new ReadModelDomainEventHandler(this.EstateReportingRepository.Object); } diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/EstateDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/EstateDomainEventHandlerTests.cs index 13c47a0d..232a9b05 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/EstateDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/EstateDomainEventHandlerTests.cs @@ -1,9 +1,11 @@ -using System.Threading; -using System.Threading.Tasks; -using Moq; +using Moq; using Shared.Logger; +using Shared.Serialisation; using Shouldly; using SimpleResults; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; using TransactionProcessor.BusinessLogic.EventHandling; using TransactionProcessor.DomainEvents; using TransactionProcessor.Repository; @@ -23,6 +25,7 @@ public class EstateDomainEventHandlerTests public EstateDomainEventHandlerTests() { Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); this.EstateReportingRepository = new Mock(); this.DomainEventHandler = new ReadModelDomainEventHandler(this.EstateReportingRepository.Object); diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/MerchantScheduleDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/MerchantScheduleDomainEventHandlerTests.cs index 17486649..0732e1c3 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/MerchantScheduleDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/MerchantScheduleDomainEventHandlerTests.cs @@ -1,9 +1,11 @@ -using System.Threading; -using System.Threading.Tasks; using Moq; using Shared.Logger; +using Shared.Serialisation; using Shouldly; using SimpleResults; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; using TransactionProcessor.BusinessLogic.EventHandling; using TransactionProcessor.DomainEvents; using TransactionProcessor.Repository; @@ -20,6 +22,7 @@ public class MerchantScheduleDomainEventHandlerTests public MerchantScheduleDomainEventHandlerTests() { Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); this.EstateReportingRepository = new Mock(); this.DomainEventHandler = new ReadModelDomainEventHandler(this.EstateReportingRepository.Object); } diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/OperatorDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/OperatorDomainEventHandlerTests.cs index aadf153a..c5a5186c 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/OperatorDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/OperatorDomainEventHandlerTests.cs @@ -1,7 +1,9 @@ -using System.Threading; -using Moq; +using Moq; using Shared.Logger; +using Shared.Serialisation; using Shouldly; +using System.Text.Json; +using System.Threading; using TransactionProcessor.BusinessLogic.EventHandling; using TransactionProcessor.DomainEvents; using TransactionProcessor.Repository; @@ -18,6 +20,7 @@ public class OperatorDomainEventHandlerTests public OperatorDomainEventHandlerTests() { Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); this.EstateReportingRepository = new Mock(); this.DomainEventHandler = new ReadModelDomainEventHandler(this.EstateReportingRepository.Object); } diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ReadModelDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ReadModelDomainEventHandlerTests.cs index c4e7c0e7..733f7b93 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ReadModelDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/ReadModelDomainEventHandlerTests.cs @@ -1,12 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using Moq; using Shared.DomainDrivenDesign.EventSourcing; using Shared.Logger; +using Shared.Serialisation; using Shouldly; using SimpleResults; +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; using TransactionProcessor.BusinessLogic.EventHandling; using TransactionProcessor.DomainEvents; using TransactionProcessor.Repository; @@ -25,6 +27,7 @@ private sealed record UnhandledDomainEvent() : DomainEvent(Guid.NewGuid(), Guid. public ReadModelDomainEventHandlerTests() { Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); this.EstateReportingRepository = new Mock(); this.DomainEventHandler = new ReadModelDomainEventHandler(this.EstateReportingRepository.Object); } diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/TransactionDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/TransactionDomainEventHandlerTests.cs index 9755d3f0..3c3bcf08 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/TransactionDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/TransactionDomainEventHandlerTests.cs @@ -13,9 +13,11 @@ namespace TransactionProcessor.BusinessLogic.Tests.DomainEventHandlers using Shared.DomainDrivenDesign.EventSourcing; using Shared.General; using Shared.Logger; + using Shared.Serialisation; using Shouldly; using System; using System.Collections.Generic; + using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Testing; @@ -28,6 +30,7 @@ public abstract class DomainEventHandlerTests public DomainEventHandlerTests(ITestOutputHelper testOutputHelper) { this.Mediator = new Mock(); + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); IConfigurationRoot configurationRoot = new ConfigurationBuilder().AddInMemoryCollection(TestData.DefaultAppSettings).Build(); ConfigurationReader.Initialise(configurationRoot); this.Mediator.Setup(s => s.Send(It.IsAny>(), It.IsAny())).ReturnsAsync(Result.Success()); diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs index 84605d1e..e2a97361 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs @@ -19,11 +19,13 @@ namespace TransactionProcessor.BusinessLogic.Tests.DomainEventHandlers; using Shared.EventStore.Aggregate; using Shared.General; using Shared.Logger; +using Shared.Serialisation; using System; using System.Collections.Generic; using System.IO; using System.IO.Abstractions.TestingHelpers; using System.Reflection; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Testing; @@ -55,6 +57,7 @@ public VoucherDomainEventHandlerTests() { IConfigurationRoot configurationRoot = new ConfigurationBuilder().AddInMemoryCollection(TestData.DefaultAppSettings).Build(); ConfigurationReader.Initialise(configurationRoot); Logger.Initialise(NullLogger.Instance); + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); SecurityServiceClient = new Mock(); MessagingServiceClient = new Mock(); @@ -86,7 +89,7 @@ public VoucherDomainEventHandlerTests() { [Fact] public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithEmailAddress_IsHandled() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientEmail())); @@ -111,7 +114,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithEmailAddress_ [Fact] public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithRecipientMobile_IsHandled() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientMobile())); diff --git a/TransactionProcessor.BusinessLogic.Tests/Manager/TransactionProcessorManagerTests.cs b/TransactionProcessor.BusinessLogic.Tests/Manager/TransactionProcessorManagerTests.cs index 2609c8ef..7227c03c 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Manager/TransactionProcessorManagerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Manager/TransactionProcessorManagerTests.cs @@ -1,24 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Moq; +using Moq; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; +using Shared.Serialisation; using Shouldly; using SimpleResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using TransactionProcessor.Aggregates; using TransactionProcessor.BusinessLogic.Manager; using TransactionProcessor.BusinessLogic.Services; using TransactionProcessor.Models.Contract; using TransactionProcessor.Models.Estate; using TransactionProcessor.Models.Merchant; -using MerchantScheduleModel = TransactionProcessor.Models.MerchantSchedule.MerchantSchedule; using TransactionProcessor.Repository; using TransactionProcessor.Testing; using Xunit; using Contract = TransactionProcessor.Models.Contract.Contract; +using MerchantScheduleModel = TransactionProcessor.Models.MerchantSchedule.MerchantSchedule; using Operator = TransactionProcessor.Models.Operator.Operator; namespace TransactionProcessor.BusinessLogic.Tests.Manager @@ -33,7 +34,7 @@ public class TransactionProcessorManagerTests public TransactionProcessorManagerTests() { this.TransactionProcessorReadModelRepository = new Mock(); - + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); this.AggregateService = new Mock(); this.TransactionProcessorManager = new TransactionProcessorManager(this.TransactionProcessorReadModelRepository.Object, this.AggregateService.Object); diff --git a/TransactionProcessor.BusinessLogic.Tests/Mediator/MediatorTests.cs b/TransactionProcessor.BusinessLogic.Tests/Mediator/MediatorTests.cs index 0c03b07a..18e5e148 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Mediator/MediatorTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Mediator/MediatorTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Text.Json; using System.Threading.Tasks; using MediatR; using Microsoft.AspNetCore.Hosting; @@ -9,6 +10,7 @@ using Microsoft.Extensions.Hosting; using Moq; using Shared.EventStore.EventStore; +using Shared.Serialisation; using TransactionProcessor.BusinessLogic.Manager; using TransactionProcessor.DataTransferObjects.Responses.Contract; using TransactionProcessor.ProjectionEngine.Repository; @@ -28,6 +30,8 @@ public class MediatorTests public MediatorTests() { + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); + this.Requests.Add(TestData.Commands.ProcessLogonTransactionCommand); this.Requests.Add(TestData.Commands.ProcessReconciliationCommand); this.Requests.Add(TestData.Commands.ProcessSaleTransactionCommand); @@ -120,7 +124,7 @@ public async Task Mediator_Send_RequestHandled() ServiceRegistry services = new ServiceRegistry(); Startup s = new Startup(hostingEnvironment.Object); Startup.Configuration = this.SetupMemoryConfiguration(); - + this.AddTestRegistrations(services, hostingEnvironment.Object); s.ConfigureContainer(services); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/EstateDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/EstateDomainServiceTests.cs index 6dc13a8c..19f9dbc9 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/EstateDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/EstateDomainServiceTests.cs @@ -5,7 +5,6 @@ using Moq; using SecurityService.Client; using SecurityService.DataTransferObjects; -using SecurityService.DataTransferObjects.Responses; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; using Shouldly; @@ -79,9 +78,9 @@ public async Task EstateDomainService_CreateEstateUser_EstateUserIsCreated() { .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -108,9 +107,9 @@ public async Task EstateDomainService_CreateEstateUser_EstateRoleOverrideIsUsedI .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -139,9 +138,9 @@ public async Task EstateDomainService_CreateEstateUser_UserCreateFailed_ResultIs .ReturnsAsync(Result.Failure); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -181,7 +180,7 @@ public async Task EstateDomainService_CreateEstateUser_NullUserReturned_ResultIs .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { + .ReturnsAsync(Result.Success(new List() { null })); @@ -200,9 +199,9 @@ public async Task EstateDomainService_CreateEstateUser_GetEstateFailed_ResultIsF .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -223,9 +222,9 @@ public async Task EstateDomainService_CreateEstateUser_EstateNotCreated_ResultIs .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -246,9 +245,9 @@ public async Task EstateDomainService_CreateEstateUser_SaveFailed_ResultIsFailed .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/MerchantDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/MerchantDomainServiceTests.cs index abdea891..59a965d5 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/MerchantDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/MerchantDomainServiceTests.cs @@ -3,7 +3,6 @@ using Newtonsoft.Json; using SecurityService.Client; using SecurityService.DataTransferObjects; -using SecurityService.DataTransferObjects.Responses; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; using Shared.EventStore.EventStore; @@ -268,9 +267,9 @@ public async Task MerchantDomainService_CreateMerchantUser_MerchantUserIsCreated .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List() { - new UserDetails { - UserId = Guid.Parse("FA077CE3-B915-4048-88E3-9B500699317F") + .ReturnsAsync(Result.Success(new List() { + new UserResponse { + UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); @@ -375,7 +374,7 @@ public async Task MerchantDomainService_CreateMerchantUser_UserInListIsNull_Erro .ReturnsAsync(Result.Success); this.SecurityServiceClient .Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List { + .ReturnsAsync(Result.Success(new List { null })); @@ -837,7 +836,7 @@ public async Task MerchantDomainService_MakeMerchantWithdrawal_WithdrawalIsMade( this.SecurityServiceClient .Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(TestData.TokenResponse())); + .ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.EventStoreContext.Setup(e => e.GetPartitionStateFromProjection(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(JsonConvert.SerializeObject(TestData.MerchantBalanceProjectionState))); @@ -863,7 +862,7 @@ public async Task MerchantDomainService_MakeMerchantWithdrawal_DuplicateWithdraw this.SecurityServiceClient .Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(TestData.TokenResponse())); + .ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.EventStoreContext.Setup(e => e.GetPartitionStateFromProjection(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(JsonConvert.SerializeObject(TestData.MerchantBalanceProjectionState))); @@ -1412,7 +1411,7 @@ public async Task MerchantDomainService_CreateMerchantUser_SaveFailed_ResultIsFa this.SecurityServiceClient.Setup(s => s.CreateUser(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success()); this.SecurityServiceClient.Setup(s => s.GetUsers(It.IsAny(), It.IsAny())) - .ReturnsAsync(Result.Success(new List { new UserDetails { UserId = Guid.NewGuid() } })); + .ReturnsAsync(Result.Success(new List { new UserResponse { UserId = "FA077CE3-B915-4048-88E3-9B500699317F" } })); this.AggregateService.Setup(m => m.Save(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Failure()); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/MerchantStatementDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/MerchantStatementDomainServiceTests.cs index 41326060..6d909c4c 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/MerchantStatementDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/MerchantStatementDomainServiceTests.cs @@ -244,7 +244,7 @@ public async Task MerchantStatementDomainService_EmailStatement_StatementIsEmail this.MessagingServiceClient.Setup(m => m.SendEmail(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success); - this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); Result result = await this.DomainService.EmailStatement(TestData.Commands.EmailMerchantStatementCommand, CancellationToken.None); result.IsSuccess.ShouldBeTrue(); @@ -260,7 +260,7 @@ public async Task MerchantStatementDomainService_EmailStatement_MerchantNotFound this.MessagingServiceClient.Setup(m => m.SendEmail(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success); - this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); Result result = await this.DomainService.EmailStatement(TestData.Commands.EmailMerchantStatementCommand, CancellationToken.None); result.IsFailed.ShouldBeTrue(); @@ -388,7 +388,7 @@ public async Task MerchantStatementDomainService_EmailStatement_SaveFailed_State this.MessagingServiceClient.Setup(m => m.SendEmail(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success); - this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(m => m.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); Result result = await this.DomainService.EmailStatement(TestData.Commands.EmailMerchantStatementCommand, CancellationToken.None); result.IsFailed.ShouldBeTrue(); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs index e85d97ef..c761e6e7 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs @@ -279,7 +279,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_DeclinedByOper [Fact] public async Task TransactionDomainService_ProcessSaleTransaction_OperatorProxyThrowsException_TransactionIsProcessed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); @@ -321,7 +321,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_OperatorProxyT [Fact] public async Task TransactionDomainService_ProcessSaleTransaction_TransactionIsProcessed(){ - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); @@ -386,7 +386,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_TransactionIsP [Fact] public async Task TransactionDomainService_ProcessSaleTransaction_NoFloatFound_TransactionIsProcessed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); @@ -593,7 +593,7 @@ public async Task TransactionDomainService_CalculateFeesForTransaction_FeesCalcu this.AggregateService.Setup(t => t.Save(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(c => c.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.CreatedContractAggregateWithAProductAndTransactionFee(CalculationType.Fixed, FeeType.Merchant)); this.FeeCalculationManager.Setup(f => f.CalculateFees(It.IsAny>(), It.IsAny(), It.IsAny())).Returns(TestData.CalculatedMerchantFees); @@ -609,7 +609,7 @@ public async Task TransactionDomainService_CalculateFeesForTransaction_MerchantW this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedAuthorisedSaleTransactionAggregate())); this.AggregateService.Setup(t => t.Save(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.MerchantAggregateWithEverything(SettlementSchedule.Immediate)); - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(c => c.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.CreatedContractAggregateWithAProductAndTransactionFee(CalculationType.Fixed, FeeType.Merchant)); this.FeeCalculationManager.Setup(f => f.CalculateFees(It.IsAny>(), It.IsAny(), It.IsAny())).Returns(TestData.CalculatedMerchantFees); @@ -626,7 +626,7 @@ public async Task TransactionDomainService_CalculateFeesForTransaction_NonMercha this.AggregateService.Setup(t => t.Save(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(c => c.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.CreatedContractAggregateWithAProductAndTransactionFee(CalculationType.Fixed, FeeType.ServiceProvider)); this.FeeCalculationManager.Setup(f => f.CalculateFees(It.IsAny>(), It.IsAny(), It.IsAny())).Returns(TestData.CalculatedServiceProviderFees); @@ -642,7 +642,7 @@ public async Task TransactionDomainService_CalculateFeesForTransaction_Transacti this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedLogonTransactionAggregate())); this.AggregateService.Setup(t => t.Save(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.FeeCalculationManager.Setup(f => f.CalculateFees(It.IsAny>(), It.IsAny(), It.IsAny())).Returns(TestData.CalculatedServiceProviderFees); @@ -661,7 +661,7 @@ public async Task TransactionDomainService_CalculateFeesForTransaction_NoFeesRet //this.EstateClient.Setup(e => e.GetTransactionFeesForProduct(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Failure()); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.FeeCalculationManager.Setup(f => f.CalculateFees(It.IsAny>(), It.IsAny(), It.IsAny())).Returns(TestData.CalculatedServiceProviderFees); @@ -696,7 +696,7 @@ public async Task TransactionDomainService_AddSettledMerchantFee_SaveFailed_Resu [Fact] public async Task TransactionDomainService_SendCustomerEmailReceipt_ReceiptSent() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedAuthorisedSaleTransactionAggregate())); this.AggregateService.Setup(c => c.Get(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) @@ -711,7 +711,7 @@ public async Task TransactionDomainService_SendCustomerEmailReceipt_ReceiptSent( [Fact] public async Task TransactionDomainService_SendCustomerEmailReceipt_GetTransactionFailed_ResultFailed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Failure()); TransactionCommands.SendCustomerEmailReceiptCommand command = new(TestData.EstateId, TestData.TransactionId, Guid.NewGuid(), TestData.CustomerEmailAddress); @@ -722,7 +722,7 @@ public async Task TransactionDomainService_SendCustomerEmailReceipt_GetTransacti [Fact] public async Task TransactionDomainService_ResendCustomerEmailReceipt_ReceiptSent() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedAuthorisedSaleTransactionAggregate())); this.MessagingServiceClient.Setup(m => m.ResendEmail(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success); @@ -734,7 +734,7 @@ public async Task TransactionDomainService_ResendCustomerEmailReceipt_ReceiptSen [Fact] public async Task TransactionDomainService_ResendCustomerEmailReceipt_GetTransactionFailed_ResultFailed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Failure()); TransactionCommands.ResendCustomerEmailReceiptCommand command = new(TestData.EstateId, TestData.TransactionId); @@ -974,7 +974,7 @@ public async Task TransactionDomainService_SendCustomerEmailReceipt_GetTokenFail [Fact] public async Task TransactionDomainService_SendCustomerEmailReceipt_GetMerchantFailed_ResultFailed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedAuthorisedSaleTransactionAggregate())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Failure()); @@ -987,7 +987,7 @@ public async Task TransactionDomainService_SendCustomerEmailReceipt_GetMerchantF [Fact] public async Task TransactionDomainService_SendCustomerEmailReceipt_GetEstateFailed_ResultFailed() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(t => t.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetCompletedAuthorisedSaleTransactionAggregate())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(TestData.Aggregates.MerchantAggregateWithOperator()); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs index 5b17929d..bf1303f5 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs @@ -38,7 +38,7 @@ public TransactionValidationServiceTests() { this.EventStoreContext = new Mock(); this.AggregateService = new Mock(); IAggregateService AggregateServiceResolver() => this.AggregateService.Object; - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.TransactionValidationService = new TransactionValidationService(this.EventStoreContext.Object, AggregateServiceResolver); } @@ -247,7 +247,7 @@ public async Task ValidateReconciliationTransactionX_MerchantHasNoDevices_Correc [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_DeviceNotRegisteredToMerchant_ResponseIsInvalidDeviceIdentifier() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -270,7 +270,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_DeviceNot [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_EstateFoundButHasNoOperators_ResponseIsInvalidEstateId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.CreatedEstateAggregate())); @@ -291,7 +291,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_EstateFou [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_EstateFoundButOperatorIsDeleted_ResponseIsOperatorNotEnabledForEstate() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperatorDeleted())); @@ -312,7 +312,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_EstateFou [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_EstateFoundButHasNullOperators_ResponseIsInvalidEstateId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.CreatedEstateAggregate())); @@ -333,7 +333,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_EstateFou [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_EstateFoundOperatorsNotConfiguredForEstate_ResponseIsOperatorNotValidForEstate() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -354,7 +354,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_EstateFou [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_EstateNotFound_ResponseIsInvalidEstateId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.NotFound("Estate Not Found")); @@ -375,7 +375,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_EstateNot [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_GetEstateFailed_ResponseIsInvalidEstateId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Failure("Failed")); @@ -396,7 +396,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_GetEstate [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_InvalidContractId_ResponseIsInvalidContractIdValue() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -422,7 +422,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_InvalidCo [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_InvalidProductId_ResponseIsInvalidProductIdValue() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -449,7 +449,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_InvalidPr [InlineData(-1)] public async Task TransactionValidationService_ValidateSaleTransaction_InvalidTransactionAmount_ResponseIsInvalidSaleTransactionAmount(Decimal transactionAmount) { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -471,7 +471,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_InvalidTr [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantDeviceListEmpty_ResponseIsNoValidDevices() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -494,7 +494,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantD [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantDoesNotHaveSuppliedContract_ResponseIsContractNotValidForMerchant() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -519,7 +519,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantD [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantHasNoContracts_ResponseIsMerchantDoesNotHaveEnoughCredit() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -546,7 +546,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantH [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantNotEnoughCredit_ResponseIsMerchantDoesNotHaveEnoughCredit() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -570,7 +570,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantN [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantNotFound_ResponseIsInvalidMerchantId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -594,7 +594,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantN [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_FailedGettingMerchant_ResponseIsInvalidMerchantId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -617,7 +617,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_FailedGet [Fact(Skip = "Need to review if test is needed now")] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantNotFoundOnGetContract_ResponseIsInvalidMerchantId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -645,7 +645,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantN [Fact(Skip = "not sure if this needed now")] public async Task TransactionValidationService_ValidateSaleTransaction_FailedGettingMerchantOnGetContract_ResponseIsInvalidMerchantId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -672,7 +672,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_FailedGet [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantOperatorListEmpty_ResponseIsNoMerchantOperators() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -696,7 +696,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantO [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_MerchantOperatorIsDeleted_ResponseIsOperatorNotEnabledForMerchant() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -719,7 +719,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_MerchantO [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_OperatorNotConfiguredFroMerchant_ResponseIsOperatorNotValidForMerchant() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator2())); @@ -742,7 +742,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_OperatorN [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_ProductIdNotConfigured_ResponseIsProductNotValidForMerchant() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -767,7 +767,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_ProductId [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_SuccessfulSale() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); @@ -791,7 +791,7 @@ public async Task TransactionValidationService_ValidateSaleTransaction_Successfu [Fact] public async Task TransactionValidationService_ValidateSaleTransaction_FailedGettingMerchantBalance_ResponseIsInvalidMerchantId() { - this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.TokenResponse())); + this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.GetTokenResponse())); this.AggregateService.Setup(e => e.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); diff --git a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj index c99fb2dc..2bd204d8 100644 --- a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj +++ b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj @@ -2,7 +2,7 @@ net10.0 - None + Full false diff --git a/TransactionProcessor.BusinessLogic/Common/Extensions.cs b/TransactionProcessor.BusinessLogic/Common/Extensions.cs index b8c8b526..6dba322e 100644 --- a/TransactionProcessor.BusinessLogic/Common/Extensions.cs +++ b/TransactionProcessor.BusinessLogic/Common/Extensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using SecurityService.DataTransferObjects; using Shared.Results; using SimpleResults; @@ -9,7 +10,6 @@ namespace TransactionProcessor.BusinessLogic.Common using System.Diagnostics.CodeAnalysis; using System.Threading; using SecurityService.Client; - using SecurityService.DataTransferObjects.Responses; using Shared.General; using Shared.Logger; using Type = System.Type; diff --git a/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs b/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs index 9f88ce12..eebf5564 100644 --- a/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs +++ b/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; using Prometheus; +using SecurityService.DataTransferObjects; using Shared.EventStore.Aggregate; using TransactionProcessor.BusinessLogic.Requests; using TransactionProcessor.DomainEvents; @@ -10,15 +11,10 @@ namespace TransactionProcessor.BusinessLogic.EventHandling { - using Polly; - using SecurityService.DataTransferObjects.Responses; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.EventHandling; - using Shared.Logger; using System.Threading; using System.Threading.Tasks; - using TransactionProcessor.BusinessLogic.Common; - using TransactionProcessor.BusinessLogic.Services; using static TransactionProcessor.BusinessLogic.Requests.SettlementCommands; using static TransactionProcessor.BusinessLogic.Requests.TransactionCommands; diff --git a/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs b/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs index a75a9f59..3789e922 100644 --- a/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs +++ b/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs @@ -1,4 +1,5 @@ -using Shared.Exceptions; +using SecurityService.DataTransferObjects; +using Shared.Exceptions; using Shared.Results; using SimpleResults; using TransactionProcessor.Aggregates; @@ -14,7 +15,6 @@ namespace TransactionProcessor.BusinessLogic.EventHandling; using MessagingService.DataTransferObjects; using Microsoft.EntityFrameworkCore; using SecurityService.Client; -using SecurityService.DataTransferObjects.Responses; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EntityFramework; using Shared.EventStore.Aggregate; diff --git a/TransactionProcessor.BusinessLogic/Services/EstateDomainService.cs b/TransactionProcessor.BusinessLogic/Services/EstateDomainService.cs index 2d4de0ca..9ef5804e 100644 --- a/TransactionProcessor.BusinessLogic/Services/EstateDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/EstateDomainService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using SecurityService.Client; using SecurityService.DataTransferObjects; -using SecurityService.DataTransferObjects.Responses; using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; using Shared.Exceptions; @@ -113,7 +112,7 @@ public async Task CreateEstateUser(EstateCommands.CreateEstateUserComman { CreateUserRequest createUserRequest = this.BuildEstateUserRequest(command); - Result getUserResult = await this.CreateEstateSecurityUser(createUserRequest, cancellationToken); + Result getUserResult = await this.CreateEstateSecurityUser(createUserRequest, cancellationToken); if (getUserResult.IsFailed) return ResultHelpers.CreateFailure(getUserResult); @@ -123,7 +122,7 @@ public async Task CreateEstateUser(EstateCommands.CreateEstateUserComman EstateAggregate estateAggregate = estateResult.Data; - Result stateResult = estateAggregate.AddSecurityUser(getUserResult.Data.UserId, command.RequestDto.EmailAddress); + Result stateResult = estateAggregate.AddSecurityUser(Guid.Parse(getUserResult.Data.UserId), command.RequestDto.EmailAddress); if (stateResult.IsFailed) return ResultHelpers.CreateFailure(stateResult); @@ -159,17 +158,17 @@ private CreateUserRequest BuildEstateUserRequest(EstateCommands.CreateEstateUser return createUserRequest; } - private async Task> CreateEstateSecurityUser(CreateUserRequest createUserRequest, + private async Task> CreateEstateSecurityUser(CreateUserRequest createUserRequest, CancellationToken cancellationToken) { Result createUserResult = await this.SecurityServiceClient.CreateUser(createUserRequest, cancellationToken); if (createUserResult.IsFailed) return ResultHelpers.CreateFailure(createUserResult); - Result> userDetailsResult = await this.SecurityServiceClient.GetUsers(createUserRequest.EmailAddress, cancellationToken); + Result> userDetailsResult = await this.SecurityServiceClient.GetUsers(createUserRequest.EmailAddress, cancellationToken); if (userDetailsResult.IsFailed) return ResultHelpers.CreateFailure(userDetailsResult); - UserDetails user = userDetailsResult.Data.SingleOrDefault(); + UserResponse user = userDetailsResult.Data.SingleOrDefault(); if (user == null) return Result.Failure($"Unable to get user details for username {createUserRequest.EmailAddress}"); diff --git a/TransactionProcessor.BusinessLogic/Services/IdGenerationService.cs b/TransactionProcessor.BusinessLogic/Services/IdGenerationService.cs index 5689705d..5c95319d 100644 --- a/TransactionProcessor.BusinessLogic/Services/IdGenerationService.cs +++ b/TransactionProcessor.BusinessLogic/Services/IdGenerationService.cs @@ -17,13 +17,13 @@ public class IdGenerationService internal delegate Guid GenerateUniqueIdFromString(String payload); - private static readonly JsonSerialiser JsonSerialiser = new(() => new JsonSerializerSettings { - Formatting = Formatting.None, - TypeNameHandling = TypeNameHandling.None - }); + //private static readonly StringSe JsonSerialiser = new(() => new JsonSerializerSettings { + // Formatting = Formatting.None, + // TypeNameHandling = TypeNameHandling.None + // }); private static readonly GenerateUniqueIdFromObject GenerateUniqueId = - data => IdGenerationService.GenerateGuidFromString(IdGenerationService.JsonSerialiser.Serialise(data)); + data => IdGenerationService.GenerateGuidFromString(StringSerialiser.Serialise(data)); private static readonly GenerateUniqueIdFromString GenerateGuidFromString = uniqueKey => { using SHA256 sha256Hash = SHA256.Create(); diff --git a/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs b/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs index 3ada1340..89c6268b 100644 --- a/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs @@ -13,7 +13,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using SecurityService.DataTransferObjects.Responses; +using KurrentDB.Client; using TransactionProcessor.Aggregates; using TransactionProcessor.BusinessLogic.Common; using TransactionProcessor.BusinessLogic.Requests; @@ -254,12 +254,12 @@ public async Task CreateMerchantUser(MerchantCommands.CreateMerchantUser MerchantAggregate merchantAggregate = contextResult.Data.MerchantAggregate; - Result getUserResult = await this.CreateMerchantSecurityUser(createUserRequest, cancellationToken); + Result getUserResult = await this.CreateMerchantSecurityUser(createUserRequest, cancellationToken); if (getUserResult.IsFailed) return ResultHelpers.CreateFailure(getUserResult); // Add the user to the aggregate - Result stateResult = merchantAggregate.AddSecurityUser(getUserResult.Data.UserId, command.RequestDto.EmailAddress); + Result stateResult = merchantAggregate.AddSecurityUser(Guid.Parse(getUserResult.Data.UserId), command.RequestDto.EmailAddress); if (stateResult.IsFailed) return stateResult; @@ -294,17 +294,17 @@ private CreateUserRequest BuildMerchantUserRequest(MerchantCommands.CreateMercha return createUserRequest; } - private async Task> CreateMerchantSecurityUser(CreateUserRequest createUserRequest, - CancellationToken cancellationToken) { + private async Task> CreateMerchantSecurityUser(CreateUserRequest createUserRequest, + CancellationToken cancellationToken) { Result createUserResult = await this.SecurityServiceClient.CreateUser(createUserRequest, cancellationToken); if (createUserResult.IsFailed) return ResultHelpers.CreateFailure(createUserResult); - Result> userDetailsResult = await this.SecurityServiceClient.GetUsers(createUserRequest.EmailAddress, cancellationToken); + Result> userDetailsResult = await this.SecurityServiceClient.GetUsers(createUserRequest.EmailAddress, cancellationToken); if (userDetailsResult.IsFailed) return ResultHelpers.CreateFailure(userDetailsResult); - UserDetails user = userDetailsResult.Data.SingleOrDefault(); + UserResponse user = userDetailsResult.Data.SingleOrDefault(); if (user == null) return Result.Failure($"Unable to get user details for username {createUserRequest.EmailAddress}"); diff --git a/TransactionProcessor.BusinessLogic/Services/MerchantStatementDomainService.cs b/TransactionProcessor.BusinessLogic/Services/MerchantStatementDomainService.cs index 3d98d757..4f67d098 100644 --- a/TransactionProcessor.BusinessLogic/Services/MerchantStatementDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/MerchantStatementDomainService.cs @@ -1,31 +1,24 @@ -using Google.Protobuf.Reflection; -using MessagingService.Client; +using MessagingService.Client; using MessagingService.DataTransferObjects; using SecurityService.Client; -using SecurityService.DataTransferObjects.Responses; -using Shared.DomainDrivenDesign.EventSourcing; using Shared.EventStore.Aggregate; using Shared.Exceptions; using Shared.General; -using Shared.Logger; using Shared.Results; -using Shared.ValueObjects; using SimpleResults; using System; using System.Collections.Generic; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.IO.Abstractions; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using SecurityService.DataTransferObjects; using TransactionProcessor.Aggregates; using TransactionProcessor.Aggregates.Models; using TransactionProcessor.BusinessLogic.Common; using TransactionProcessor.BusinessLogic.Requests; using TransactionProcessor.Models.Merchant; -using TransactionProcessor.Repository; using Transaction = TransactionProcessor.Aggregates.Models.Transaction; namespace TransactionProcessor.BusinessLogic.Services diff --git a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs index 93a4ea75..88155658 100644 --- a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using SecurityService.DataTransferObjects; using Shared.Exceptions; using Shared.General; using Shared.Results; @@ -14,7 +14,6 @@ namespace TransactionProcessor.BusinessLogic.Services{ using Models; using OperatorInterfaces; using SecurityService.Client; - using SecurityService.DataTransferObjects.Responses; using Shared.EventStore.Aggregate; using Shared.Logger; using System; diff --git a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj index 9827cafc..013a38b5 100644 --- a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj +++ b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj @@ -6,15 +6,15 @@ - + - + - - - + + + diff --git a/TransactionProcessor.Client/TransactionProcessor.Client.csproj b/TransactionProcessor.Client/TransactionProcessor.Client.csproj index 1f51f713..d4236ab8 100644 --- a/TransactionProcessor.Client/TransactionProcessor.Client.csproj +++ b/TransactionProcessor.Client/TransactionProcessor.Client.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/TransactionProcessor.Client/TransactionProcessorClient.cs b/TransactionProcessor.Client/TransactionProcessorClient.cs index 91ff21a0..ca8839b0 100644 --- a/TransactionProcessor.Client/TransactionProcessorClient.cs +++ b/TransactionProcessor.Client/TransactionProcessorClient.cs @@ -25,17 +25,7 @@ namespace TransactionProcessor.Client; using Newtonsoft.Json; using Shared.Results; -public class TransactionProcessorClient : ClientBase, ITransactionProcessorClient { - private static String Serialise(Object arg) - { - return JsonConvert.SerializeObject(arg); - } - - private static Object Deserialise(String arg, Type type) - { - return JsonConvert.DeserializeObject(arg, type); - } - +public class TransactionProcessorClient : ClientProxyBase, ITransactionProcessorClient { #region Fields private readonly Func BaseAddressResolver; @@ -45,12 +35,11 @@ private static Object Deserialise(String arg, Type type) #region Constructors public TransactionProcessorClient(Func baseAddressResolver, - HttpClient httpClient) : base(httpClient, Serialise, Deserialise) + HttpClient httpClient, + Func serialise, + Func deserialise) : base(httpClient, serialise, deserialise) { this.BaseAddressResolver = baseAddressResolver; - - // Add the API version header - //this.HttpClient.DefaultRequestHeaders.Add("api-version", "1.0"); } #endregion diff --git a/TransactionProcessor.Database/TransactionProcessor.Database.csproj b/TransactionProcessor.Database/TransactionProcessor.Database.csproj index 3cd76ede..fa091d44 100644 --- a/TransactionProcessor.Database/TransactionProcessor.Database.csproj +++ b/TransactionProcessor.Database/TransactionProcessor.Database.csproj @@ -18,9 +18,9 @@ - + - + diff --git a/TransactionProcessor.DatabaseTests/TransactionProcessor.DatabaseTests.csproj b/TransactionProcessor.DatabaseTests/TransactionProcessor.DatabaseTests.csproj index 2f5be939..323bc50e 100644 --- a/TransactionProcessor.DatabaseTests/TransactionProcessor.DatabaseTests.csproj +++ b/TransactionProcessor.DatabaseTests/TransactionProcessor.DatabaseTests.csproj @@ -22,7 +22,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj b/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj index eded7ba0..87369caf 100644 --- a/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj +++ b/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj @@ -6,6 +6,6 @@ enable - + diff --git a/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj b/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj index 9fd938ba..f9d6f0f5 100644 --- a/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj +++ b/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj @@ -7,12 +7,12 @@ - + - + diff --git a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs index 911b0116..388decc9 100644 --- a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs @@ -4,18 +4,19 @@ namespace TransactionProcessor.IntegrationTests.Common { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Text; - using System.Threading; - using System.Threading.Tasks; using Client; using EventStore.Client; using global::Shared.IntegrationTesting; + using global::Shared.Serialisation; using Newtonsoft.Json; using SecurityService.Client; using Shouldly; + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Text; + using System.Threading; + using System.Threading.Tasks; using Retry = IntegrationTests.Retry; /// @@ -160,6 +161,16 @@ public override async Task CreateSubscriptions(){ // return securityServiceContainer; //} + String Serialise(Object arg) + { + return StringSerialiser.Serialise(arg, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); + } + + Object Deserialise(String arg, Type type) + { + return StringSerialiser.DeserializeObject(arg, type, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); + } + /// /// Starts the containers for scenario run. /// @@ -182,8 +193,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do } }; HttpClient httpClient = new HttpClient(clientHandler); - this.SecurityServiceClient = new SecurityServiceClient(SecurityServiceBaseAddressResolver, httpClient); - this.TransactionProcessorClient = new TransactionProcessorClient(TransactionProcessorBaseAddressResolver, httpClient); + this.SecurityServiceClient = new SecurityServiceClient(SecurityServiceBaseAddressResolver, httpClient, Serialise, Deserialise); + this.TransactionProcessorClient = new TransactionProcessorClient(TransactionProcessorBaseAddressResolver, httpClient, Serialise, Deserialise); this.TestHostHttpClient= new HttpClient(clientHandler); this.TestHostHttpClient.BaseAddress = new Uri($"http://127.0.0.1:{this.TestHostServicePort}"); diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index 92597123..a7b668ae 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -111,85 +111,85 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table25.AddRow(new string[] { + table41.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); #line 6 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table25, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table41, "Given "); #line hidden - global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table42 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table26.AddRow(new string[] { + table42.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "MerchantId, EstateId, role"}); #line 10 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table26, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table42, "Given "); #line hidden - global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table43 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table27.AddRow(new string[] { + table43.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); #line 14 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table27, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table43, "Given "); #line hidden - global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table44 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table28.AddRow(new string[] { + table44.AddRow(new string[] { "serviceClient"}); #line 18 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table28, "Given "); + "s", ((string)(null)), table44, "Given "); #line hidden - global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table45 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table29.AddRow(new string[] { + table45.AddRow(new string[] { "Test Estate 1"}); #line 22 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table29, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table45, "Given "); #line hidden - global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table46 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table30.AddRow(new string[] { + table46.AddRow(new string[] { "Test Estate 1", "Test Operator 1", "False", "False"}); #line 26 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table30, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table46, "Given "); #line hidden - global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table47 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table31.AddRow(new string[] { + table47.AddRow(new string[] { "Test Estate 1", "Test Operator 1"}); #line 30 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table31, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table47, "And "); #line hidden - global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table48 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -199,7 +199,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -209,7 +209,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -219,7 +219,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -229,7 +229,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 3", "testcontact3@merchant2.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 4", "Address Line 1", "TestTown", @@ -239,7 +239,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 4", "testcontact4@merchant2.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 5", "Address Line 1", "TestTown", @@ -249,7 +249,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 5", "testcontact5@merchant2.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 6", "Address Line 1", "TestTown", @@ -259,7 +259,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 6", "testcontact6@merchant2.co.uk", "Test Estate 1"}); - table32.AddRow(new string[] { + table48.AddRow(new string[] { "Test Merchant 7", "Address Line 1", "TestTown", @@ -270,58 +270,58 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact7@merchant2.co.uk", "Test Estate 1"}); #line 34 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table32, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table48, "Given "); #line hidden - global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table49 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 3", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 4", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 5", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 6", "00000001", "10000001", "Test Estate 1"}); - table33.AddRow(new string[] { + table49.AddRow(new string[] { "Test Operator 1", "Test Merchant 7", "00000001", "10000001", "Test Estate 1"}); #line 44 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table33, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table49, "Given "); #line hidden } @@ -355,28 +355,28 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table50 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table34.AddRow(new string[] { + table50.AddRow(new string[] { "Today", "1", "Logon", "Test Merchant 1", "123456780", "Test Estate 1"}); - table34.AddRow(new string[] { + table50.AddRow(new string[] { "Today", "2", "Logon", "Test Merchant 2", "123456781", "Test Estate 1"}); - table34.AddRow(new string[] { + table50.AddRow(new string[] { "Today", "3", "Logon", @@ -384,56 +384,56 @@ await testRunner.GivenAsync("I have a token to access the estate management and "123456782", "Test Estate 1"}); #line 57 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table34, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table50, "When "); #line hidden - global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table51 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table35.AddRow(new string[] { + table51.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0001", "SUCCESS"}); - table35.AddRow(new string[] { + table51.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0001", "SUCCESS"}); - table35.AddRow(new string[] { + table51.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0001", "SUCCESS"}); #line 63 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table35, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table51, "Then "); #line hidden - global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table52 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "MerchantNumber", "EstateName"}); - table36.AddRow(new string[] { + table52.AddRow(new string[] { "123456783", "Test Merchant 4", "00000001", "Test Estate 1"}); #line 69 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table36, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table52, "Given "); #line hidden - global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table53 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table37.AddRow(new string[] { + table53.AddRow(new string[] { "Today", "4", "Logon", @@ -441,31 +441,31 @@ await testRunner.GivenAsync("I have a token to access the estate management and "123456783", "Test Estate 1"}); #line 73 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table37, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table53, "When "); #line hidden - global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table54 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table38.AddRow(new string[] { + table54.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "4", "0000", "SUCCESS"}); #line 77 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table38, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table54, "Then "); #line hidden - global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table55 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table39.AddRow(new string[] { + table55.AddRow(new string[] { "Today", "5", "Logon", @@ -473,31 +473,31 @@ await testRunner.GivenAsync("I have a token to access the estate management and "13579135", "Test Estate 1"}); #line 81 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table39, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table55, "When "); #line hidden - global::Reqnroll.Table table40 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table56 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table40.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "1000", "Device Identifier 13579135 not valid for Merchant Test Merchant 1"}); #line 85 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table40, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table56, "Then "); #line hidden - global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table57 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table41.AddRow(new string[] { + table57.AddRow(new string[] { "Today", "6", "Logon", @@ -505,31 +505,31 @@ await testRunner.GivenAsync("I have a token to access the estate management and "123456785", "InvalidEstate"}); #line 89 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table41, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table57, "When "); #line hidden - global::Reqnroll.Table table42 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table58 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table42.AddRow(new string[] { + table58.AddRow(new string[] { "InvalidEstate", "Test Merchant 1", "6", "1001", "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); #line 93 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table42, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table58, "Then "); #line hidden - global::Reqnroll.Table table43 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table59 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", "MerchantName", "DeviceIdentifier", "EstateName"}); - table43.AddRow(new string[] { + table59.AddRow(new string[] { "Today", "7", "Logon", @@ -537,15 +537,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "123456786", "Test Estate 1"}); #line 97 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table43, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table59, "When "); #line hidden - global::Reqnroll.Table table44 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table60 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table44.AddRow(new string[] { + table60.AddRow(new string[] { "Test Estate 1", "InvalidMerchant", "7", @@ -553,7 +553,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + "tate [Test Estate 1]"}); #line 101 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table44, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table60, "Then "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs index 82fefab3..3f323a9b 100644 --- a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs @@ -111,139 +111,139 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table61 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table1.AddRow(new string[] { + table61.AddRow(new string[] { "Estate"}); - table1.AddRow(new string[] { + table61.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table61, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table62 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table2.AddRow(new string[] { + table62.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); #line 11 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table62, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table63 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table3.AddRow(new string[] { + table63.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table63, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table64 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table4.AddRow(new string[] { + table64.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); - table4.AddRow(new string[] { + table64.AddRow(new string[] { "estateClient", "Estate Client", "Secret1", "transactionProcessor", "password"}); #line 19 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table64, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table65 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table5.AddRow(new string[] { + table65.AddRow(new string[] { "serviceClient"}); #line 24 - await testRunner.GivenAsync("I have a token to access the estate management resource", ((string)(null)), table5, "Given "); + await testRunner.GivenAsync("I have a token to access the estate management resource", ((string)(null)), table65, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table66 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table6.AddRow(new string[] { + table66.AddRow(new string[] { "Test Estate 1"}); - table6.AddRow(new string[] { + table66.AddRow(new string[] { "Test Estate 2"}); #line 28 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table66, "Given "); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table67 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table7.AddRow(new string[] { + table67.AddRow(new string[] { "Test Estate 1", "Test Operator 1", "False", "False"}); - table7.AddRow(new string[] { + table67.AddRow(new string[] { "Test Estate 2", "Test Operator 1", "False", "False"}); #line 33 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table67, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table68 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table8.AddRow(new string[] { + table68.AddRow(new string[] { "Test Estate 1", "Test Operator 1"}); - table8.AddRow(new string[] { + table68.AddRow(new string[] { "Test Estate 2", "Test Operator 1"}); #line 38 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table8, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table68, "And "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table69 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table9.AddRow(new string[] { + table69.AddRow(new string[] { "Test Estate 1", "Test Operator 1", "Safaricom Contract"}); #line 43 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table9, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table69, "Given "); #line hidden - global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table70 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName"}); - table10.AddRow(new string[] { + table70.AddRow(new string[] { "estateuser1@testestate1.co.uk", "123456", "TestEstate", "User1", "Test Estate 1"}); - table10.AddRow(new string[] { + table70.AddRow(new string[] { "estateuser1@testestate2.co.uk", "123456", "TestEstate", "User1", "Test Estate 2"}); #line 47 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table10, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table70, "Given "); #line hidden } @@ -306,7 +306,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table71 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -317,7 +317,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "EmailAddress", "EstateName", "SettlementSchedule"}); - table11.AddRow(new string[] { + table71.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -329,9 +329,9 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Estate 1", "Weekly"}); #line 56 - await testRunner.WhenAsync("I create the following merchants", ((string)(null)), table11, "When "); + await testRunner.WhenAsync("I create the following merchants", ((string)(null)), table71, "When "); #line hidden - global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table72 = new global::Reqnroll.Table(new string[] { "MerchantName", "MondayOpening", "MondayClosing", @@ -348,7 +348,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "SundayOpening", "SundayClosing", "EstateName"}); - table12.AddRow(new string[] { + table72.AddRow(new string[] { "Test Merchant 1", "0800", "1700", @@ -366,52 +366,52 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "1700", "Test Estate 1"}); #line 59 - await testRunner.WhenAsync("I set the following opening hours", ((string)(null)), table12, "When "); + await testRunner.WhenAsync("I set the following opening hours", ((string)(null)), table72, "When "); #line hidden - global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table73 = new global::Reqnroll.Table(new string[] { "MerchantName", "EstateName", "Year", "Month", "ClosedDays"}); - table13.AddRow(new string[] { + table73.AddRow(new string[] { "Test Merchant 1", "Test Estate 1", "2026", "1", "1"}); - table13.AddRow(new string[] { + table73.AddRow(new string[] { "Test Merchant 1", "Test Estate 1", "2026", "12", "25,26"}); #line 62 - await testRunner.WhenAsync("I create the following merchant schedules", ((string)(null)), table13, "When "); + await testRunner.WhenAsync("I create the following merchant schedules", ((string)(null)), table73, "When "); #line hidden - global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table74 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table14.AddRow(new string[] { + table74.AddRow(new string[] { "Test Operator 1", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); #line 66 - await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table14, "When "); + await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table74, "When "); #line hidden - global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table75 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "MerchantName", "EstateName"}); - table15.AddRow(new string[] { + table75.AddRow(new string[] { "merchantuser1@testmerchant1.co.uk", "123456", "TestMerchant", @@ -419,159 +419,159 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Merchant 1", "Test Estate 1"}); #line 69 - await testRunner.WhenAsync("I create the following security users", ((string)(null)), table15, "When "); + await testRunner.WhenAsync("I create the following security users", ((string)(null)), table75, "When "); #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table76 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table16.AddRow(new string[] { + table76.AddRow(new string[] { "TestDevice1", "Test Merchant 1", "Test Estate 1"}); #line 72 - await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table16, "When "); + await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table76, "When "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table77 = new global::Reqnroll.Table(new string[] { "OriginalDeviceIdentifier", "NewDeviceIdentifier", "MerchantName", "EstateName"}); - table17.AddRow(new string[] { + table77.AddRow(new string[] { "TestDevice1", "TestDevice2", "Test Merchant 1", "Test Estate 1"}); #line 75 - await testRunner.WhenAsync("I swap the merchant device the device is swapped", ((string)(null)), table17, "When "); + await testRunner.WhenAsync("I swap the merchant device the device is swapped", ((string)(null)), table77, "When "); #line hidden - global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table78 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table18.AddRow(new string[] { + table78.AddRow(new string[] { "Deposit1", "500.00", "LastMonth", "Test Merchant 1", "Test Estate 1"}); - table18.AddRow(new string[] { + table78.AddRow(new string[] { "Deposit2", "1000.00", "LastWeek", "Test Merchant 1", "Test Estate 1"}); - table18.AddRow(new string[] { + table78.AddRow(new string[] { "Deposit3", "1000.00", "Yesterday", "Test Merchant 1", "Test Estate 1"}); - table18.AddRow(new string[] { + table78.AddRow(new string[] { "Deposit4", "400.00", "Today", "Test Merchant 1", "Test Estate 1"}); #line 78 - await testRunner.WhenAsync("I make the following manual merchant deposits", ((string)(null)), table18, "When "); + await testRunner.WhenAsync("I make the following manual merchant deposits", ((string)(null)), table78, "When "); #line hidden - global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table79 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table19.AddRow(new string[] { + table79.AddRow(new string[] { "400.00", "LastMonth", "Test Merchant 1", "Test Estate 1"}); #line 85 - await testRunner.WhenAsync("I make the following merchant withdrawals", ((string)(null)), table19, "When "); + await testRunner.WhenAsync("I make the following merchant withdrawals", ((string)(null)), table79, "When "); #line hidden - global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table80 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table20.AddRow(new string[] { + table80.AddRow(new string[] { "500.00", "LastMonth", "Test Merchant 1", "Test Estate 1"}); - table20.AddRow(new string[] { + table80.AddRow(new string[] { "1000.00", "LastWeek", "Test Merchant 1", "Test Estate 1"}); - table20.AddRow(new string[] { + table80.AddRow(new string[] { "1000.00", "Yesterday", "Test Merchant 1", "Test Estate 1"}); - table20.AddRow(new string[] { + table80.AddRow(new string[] { "400.00", "Today", "Test Merchant 1", "Test Estate 1"}); #line 89 - await testRunner.WhenAsync("I make the following automatic merchant deposits", ((string)(null)), table20, "When "); + await testRunner.WhenAsync("I make the following automatic merchant deposits", ((string)(null)), table80, "When "); #line hidden - global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table81 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table21.AddRow(new string[] { + table81.AddRow(new string[] { "0", "LastMonth", "Test Merchant 1", "Test Estate 1"}); #line 96 - await testRunner.WhenAsync("I make the following manual merchant deposits the deposit is rejected", ((string)(null)), table21, "When "); + await testRunner.WhenAsync("I make the following manual merchant deposits the deposit is rejected", ((string)(null)), table81, "When "); #line hidden - global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table82 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table22.AddRow(new string[] { + table82.AddRow(new string[] { "-100", "LastMonth", "Test Merchant 1", "Test Estate 1"}); #line 100 - await testRunner.WhenAsync("I make the following manual merchant deposits the deposit is rejected", ((string)(null)), table22, "When "); + await testRunner.WhenAsync("I make the following manual merchant deposits the deposit is rejected", ((string)(null)), table82, "When "); #line hidden - global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table83 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table23.AddRow(new string[] { + table83.AddRow(new string[] { "0", "LastMonth", "Test Merchant 1", "Test Estate 1"}); #line 104 - await testRunner.WhenAsync("I make the following automatic merchant deposits the deposit is rejected", ((string)(null)), table23, "When "); + await testRunner.WhenAsync("I make the following automatic merchant deposits the deposit is rejected", ((string)(null)), table83, "When "); #line hidden - global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table84 = new global::Reqnroll.Table(new string[] { "Amount", "DateTime", "MerchantName", "EstateName"}); - table24.AddRow(new string[] { + table84.AddRow(new string[] { "-100", "LastMonth", "Test Merchant 1", "Test Estate 1"}); #line 108 - await testRunner.WhenAsync("I make the following automatic merchant deposits the deposit is rejected", ((string)(null)), table24, "When "); + await testRunner.WhenAsync("I make the following automatic merchant deposits the deposit is rejected", ((string)(null)), table84, "When "); #line hidden - global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table85 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -581,7 +581,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "ContactName", "EmailAddress", "EstateName"}); - table25.AddRow(new string[] { + table85.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -591,7 +591,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table25.AddRow(new string[] { + table85.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -601,7 +601,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table25.AddRow(new string[] { + table85.AddRow(new string[] { "Test Merchant 4", "Address Line 1", "TestTown", @@ -612,26 +612,26 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "testcontact1@merchant1.co.uk", "Test Estate 1"}); #line 112 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table25, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table85, "Given "); #line hidden - global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table86 = new global::Reqnroll.Table(new string[] { "MerchantName", "EstateName", "SettlementSchedule"}); - table26.AddRow(new string[] { + table86.AddRow(new string[] { "Test Merchant 2", "Test Estate 1", "Immediate"}); - table26.AddRow(new string[] { + table86.AddRow(new string[] { "Test Merchant 3", "Test Estate 1", "Weekly"}); - table26.AddRow(new string[] { + table86.AddRow(new string[] { "Test Merchant 4", "Test Estate 1", "Monthly"}); #line 118 - await testRunner.WhenAsync("I set the merchants settlement schedule", ((string)(null)), table26, "When "); + await testRunner.WhenAsync("I set the merchants settlement schedule", ((string)(null)), table86, "When "); #line hidden } await this.ScenarioCleanupAsync(); @@ -662,7 +662,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table87 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -672,7 +672,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "ContactName", "EmailAddress", "EstateName"}); - table27.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -682,7 +682,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table27.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -692,7 +692,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant2.co.uk", "Test Estate 1"}); - table27.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -702,7 +702,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant3.co.uk", "Test Estate 1"}); - table27.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 4", "Address Line 1", "TestTown", @@ -712,7 +712,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Contact 1", "testcontact1@merchant4.co.uk", "Test Estate 2"}); - table27.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 5", "Address Line 1", "TestTown", @@ -723,110 +723,110 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "testcontact1@merchant5.co.uk", "Test Estate 2"}); #line 126 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table27, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table87, "Given "); #line hidden - global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table88 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table28.AddRow(new string[] { + table88.AddRow(new string[] { "Test Operator 1", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table28.AddRow(new string[] { + table88.AddRow(new string[] { "Test Operator 1", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table28.AddRow(new string[] { + table88.AddRow(new string[] { "Test Operator 1", "Test Merchant 3", "00000001", "10000001", "Test Estate 1"}); - table28.AddRow(new string[] { + table88.AddRow(new string[] { "Test Operator 1", "Test Merchant 4", "00000001", "10000001", "Test Estate 2"}); - table28.AddRow(new string[] { + table88.AddRow(new string[] { "Test Operator 1", "Test Merchant 5", "00000001", "10000001", "Test Estate 2"}); #line 134 - await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table28, "When "); + await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table88, "When "); #line hidden - global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table89 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table29.AddRow(new string[] { + table89.AddRow(new string[] { "TestDevice1", "Test Merchant 1", "Test Estate 1"}); - table29.AddRow(new string[] { + table89.AddRow(new string[] { "TestDevice2", "Test Merchant 2", "Test Estate 1"}); - table29.AddRow(new string[] { + table89.AddRow(new string[] { "TestDevice3", "Test Merchant 3", "Test Estate 1"}); - table29.AddRow(new string[] { + table89.AddRow(new string[] { "TestDevice4", "Test Merchant 4", "Test Estate 2"}); - table29.AddRow(new string[] { + table89.AddRow(new string[] { "TestDevice5", "Test Merchant 5", "Test Estate 2"}); #line 142 - await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table29, "When "); + await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table89, "When "); #line hidden - global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table90 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "MerchantName", "EstateName"}); - table30.AddRow(new string[] { + table90.AddRow(new string[] { "merchantuser1@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Merchant 1", "Test Estate 1"}); - table30.AddRow(new string[] { + table90.AddRow(new string[] { "merchantuser1@testmerchant2.co.uk", "123456", "TestMerchant", "User1", "Test Merchant 2", "Test Estate 1"}); - table30.AddRow(new string[] { + table90.AddRow(new string[] { "merchantuser1@testmerchant3.co.uk", "123456", "TestMerchant", "User1", "Test Merchant 3", "Test Estate 1"}); - table30.AddRow(new string[] { + table90.AddRow(new string[] { "merchantuser1@testmerchant4.co.uk", "123456", "TestMerchant", "User1", "Test Merchant 4", "Test Estate 2"}); - table30.AddRow(new string[] { + table90.AddRow(new string[] { "merchantuser1@testmerchant5.co.uk", "123456", "TestMerchant", @@ -834,7 +834,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Merchant 5", "Test Estate 2"}); #line 150 - await testRunner.WhenAsync("I create the following security users", ((string)(null)), table30, "When "); + await testRunner.WhenAsync("I create the following security users", ((string)(null)), table90, "When "); #line hidden #line 158 await testRunner.WhenAsync("I get the merchants for \'Test Estate 1\' then 3 merchants will be returned", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); @@ -871,7 +871,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table91 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -882,7 +882,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "EmailAddress", "EstateName", "SettlementSchedule"}); - table31.AddRow(new string[] { + table91.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -894,31 +894,31 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Estate 1", "Weekly"}); #line 164 - await testRunner.WhenAsync("I create the following merchants", ((string)(null)), table31, "When "); + await testRunner.WhenAsync("I create the following merchants", ((string)(null)), table91, "When "); #line hidden - global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table92 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table32.AddRow(new string[] { + table92.AddRow(new string[] { "Test Operator 1", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); #line 167 - await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table32, "When "); + await testRunner.WhenAsync("I assign the following operator to the merchants", ((string)(null)), table92, "When "); #line hidden - global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table93 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "MerchantName", "EstateName"}); - table33.AddRow(new string[] { + table93.AddRow(new string[] { "merchantuser1@testmerchant1.co.uk", "123456", "TestMerchant", @@ -926,44 +926,44 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Merchant 1", "Test Estate 1"}); #line 170 - await testRunner.WhenAsync("I create the following security users", ((string)(null)), table33, "When "); + await testRunner.WhenAsync("I create the following security users", ((string)(null)), table93, "When "); #line hidden - global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table94 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table34.AddRow(new string[] { + table94.AddRow(new string[] { "TestDevice1", "Test Merchant 1", "Test Estate 1"}); #line 173 - await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table34, "When "); + await testRunner.WhenAsync("I add the following devices to the merchant", ((string)(null)), table94, "When "); #line hidden - global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table95 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table35.AddRow(new string[] { + table95.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); #line 176 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table35, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table95, "When "); #line hidden - global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table96 = new global::Reqnroll.Table(new string[] { "UpdateMerchantName", "SettlementSchedule", "EstateName", "MerchantName"}); - table36.AddRow(new string[] { + table96.AddRow(new string[] { "Update Merchant 1", "Monthly", "Test Estate 1", "Test Merchant 1"}); #line 179 - await testRunner.WhenAsync("I update the merchants with the following details", ((string)(null)), table36, "When "); + await testRunner.WhenAsync("I update the merchants with the following details", ((string)(null)), table96, "When "); #line hidden - global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table97 = new global::Reqnroll.Table(new string[] { "AddressLine1", "AddressLine2", "AddressLine3", @@ -974,7 +974,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Country", "EstateName", "MerchantName"}); - table37.AddRow(new string[] { + table97.AddRow(new string[] { "Address Line 1U", "Address Line 2", "Address Line 3", @@ -986,35 +986,35 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Test Estate 1", "Test Merchant 1"}); #line 182 - await testRunner.WhenAsync("I update the merchants address with the following details", ((string)(null)), table37, "When "); + await testRunner.WhenAsync("I update the merchants address with the following details", ((string)(null)), table97, "When "); #line hidden - global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table98 = new global::Reqnroll.Table(new string[] { "ContactName", "EmailAddress", "PhoneNumber", "EstateName", "MerchantName"}); - table38.AddRow(new string[] { + table98.AddRow(new string[] { "Test Contact 1U", "testcontact1update@merchant1.co.uk", "12345678", "Test Estate 1", "Test Merchant 1"}); #line 185 - await testRunner.WhenAsync("I update the merchants contact with the following details", ((string)(null)), table38, "When "); + await testRunner.WhenAsync("I update the merchants contact with the following details", ((string)(null)), table98, "When "); #line hidden - global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table99 = new global::Reqnroll.Table(new string[] { "OriginalDeviceIdentifier", "NewDeviceIdentifier", "MerchantName", "EstateName"}); - table39.AddRow(new string[] { + table99.AddRow(new string[] { "TestDevice1", "TestDevice2", "Test Merchant 1", "Test Estate 1"}); #line 188 - await testRunner.WhenAsync("I swap the merchant device the device is swapped", ((string)(null)), table39, "When "); + await testRunner.WhenAsync("I swap the merchant device the device is swapped", ((string)(null)), table99, "When "); #line hidden #line 191 await testRunner.WhenAsync("I remove the contract \'Safaricom Contract\' from merchant \'Test Merchant 1\' on \'Te" + diff --git a/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs b/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs index ded3c306..55a7f371 100644 --- a/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs @@ -111,73 +111,73 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table100 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table1.AddRow(new string[] { + table100.AddRow(new string[] { "Estate"}); #line 5 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table100, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table101 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table2.AddRow(new string[] { + table101.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); #line 9 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table101, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table102 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table3.AddRow(new string[] { + table102.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); #line 13 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table102, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table103 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table4.AddRow(new string[] { + table103.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); - table4.AddRow(new string[] { + table103.AddRow(new string[] { "estateClient", "Estate Client", "Secret1", "transactionProcessor", "password"}); #line 16 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table103, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table104 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table5.AddRow(new string[] { + table104.AddRow(new string[] { "serviceClient"}); #line 21 - await testRunner.GivenAsync("I have a token to access the estate management resource", ((string)(null)), table5, "Given "); + await testRunner.GivenAsync("I have a token to access the estate management resource", ((string)(null)), table104, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table105 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table6.AddRow(new string[] { + table105.AddRow(new string[] { "Test Estate 1"}); #line 25 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table105, "Given "); #line hidden } @@ -211,59 +211,59 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table106 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber", "OperatorId"}); - table7.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Operator 1", "True", "True", "27C722F6-208F-4F78-9A2F-993F8A8F24A3"}); - table7.AddRow(new string[] { + table106.AddRow(new string[] { "Test Estate 1", "Test Operator 2", "True", "True", "00000000-0000-0000-0000-000000000000"}); #line 32 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table106, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table107 = new global::Reqnroll.Table(new string[] { "UpdateOperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber", "EstateName", "OperatorName"}); - table8.AddRow(new string[] { + table107.AddRow(new string[] { "Update Operator 1", "False", "False", "Test Estate 1", "Test Operator 1"}); #line 37 - await testRunner.WhenAsync("I update the operators with the following details", ((string)(null)), table8, "When "); + await testRunner.WhenAsync("I update the operators with the following details", ((string)(null)), table107, "When "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table108 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table9.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "Update Operator 1", "False", "False"}); - table9.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "Test Operator 2", "True", "True"}); #line 41 - await testRunner.WhenAsync("I get all the operators the following details are returned", ((string)(null)), table9, "When "); + await testRunner.WhenAsync("I get all the operators the following details are returned", ((string)(null)), table108, "When "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index caf8bffe..d6b38a8b 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs @@ -111,98 +111,98 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 5 #line hidden - global::Reqnroll.Table table40 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table125 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table40.AddRow(new string[] { + table125.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); #line 7 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table40, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table125, "Given "); #line hidden - global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table126 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table41.AddRow(new string[] { + table126.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "MerchantId, EstateId, role"}); #line 11 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table41, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table126, "Given "); #line hidden - global::Reqnroll.Table table42 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table127 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table42.AddRow(new string[] { + table127.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); #line 15 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table42, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table127, "Given "); #line hidden - global::Reqnroll.Table table43 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table128 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table43.AddRow(new string[] { + table128.AddRow(new string[] { "serviceClient"}); #line 19 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table43, "Given "); + "s", ((string)(null)), table128, "Given "); #line hidden - global::Reqnroll.Table table44 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table129 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table44.AddRow(new string[] { + table129.AddRow(new string[] { "Test Estate 1"}); - table44.AddRow(new string[] { + table129.AddRow(new string[] { "Test Estate 2"}); #line 23 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table44, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table129, "Given "); #line hidden - global::Reqnroll.Table table45 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table130 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table45.AddRow(new string[] { + table130.AddRow(new string[] { "Test Estate 1", "Voucher", "False", "False"}); #line 28 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table45, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table130, "Given "); #line hidden - global::Reqnroll.Table table46 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table131 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table46.AddRow(new string[] { + table131.AddRow(new string[] { "Test Estate 1", "Voucher"}); #line 32 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table46, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table131, "And "); #line hidden - global::Reqnroll.Table table47 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table132 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table47.AddRow(new string[] { + table132.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 36 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table47, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table132, "Given "); #line hidden - global::Reqnroll.Table table48 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table133 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -210,7 +210,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table48.AddRow(new string[] { + table133.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -219,9 +219,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 40 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table48, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table133, "When "); #line hidden - global::Reqnroll.Table table49 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table134 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -231,7 +231,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table49.AddRow(new string[] { + table134.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -242,61 +242,61 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1"}); #line 44 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table49, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table134, "Given "); #line hidden - global::Reqnroll.Table table50 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table135 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table50.AddRow(new string[] { + table135.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); #line 48 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table50, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table135, "Given "); #line hidden - global::Reqnroll.Table table51 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table136 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table51.AddRow(new string[] { + table136.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); #line 52 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table51, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table136, "Given "); #line hidden - global::Reqnroll.Table table52 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table137 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table52.AddRow(new string[] { + table137.AddRow(new string[] { "Deposit1", "20.00", "Today", "Test Merchant 1", "Test Estate 1"}); #line 56 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table52, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table137, "Given "); #line hidden - global::Reqnroll.Table table53 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table138 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table53.AddRow(new string[] { + table138.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); #line 60 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table53, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table138, "When "); #line hidden - global::Reqnroll.Table table54 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table139 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -315,7 +315,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "MessageType", "AccountNumber", "CustomerName"}); - table54.AddRow(new string[] { + table139.AddRow(new string[] { "Today", "1", "Sale", @@ -335,7 +335,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 64 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table54, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table139, "When "); #line hidden } diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 62807b1c..6bdb6fd9 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -111,169 +111,169 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table140 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table1.AddRow(new string[] { + table140.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); #line 6 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table140, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table141 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table2.AddRow(new string[] { + table141.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "MerchantId, EstateId, role"}); #line 11 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table141, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table142 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table3.AddRow(new string[] { + table142.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); #line 16 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table142, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table143 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table4.AddRow(new string[] { + table143.AddRow(new string[] { "serviceClient"}); #line 20 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table4, "Given "); + "s", ((string)(null)), table143, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table144 = new global::Reqnroll.Table(new string[] { "AccountNumber", "AccountName", "DueDate", "Amount"}); - table5.AddRow(new string[] { + table144.AddRow(new string[] { "12345678", "Test Account 1", "Today", "100.00"}); #line 24 - await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table5, "Given "); + await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table144, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table145 = new global::Reqnroll.Table(new string[] { "Username", "Password"}); - table6.AddRow(new string[] { + table145.AddRow(new string[] { "operatora", "1234567898"}); #line 28 - await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table145, "Given "); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table146 = new global::Reqnroll.Table(new string[] { "MeterNumber", "CustomerName"}); - table7.AddRow(new string[] { + table146.AddRow(new string[] { "00000001", "Customer 1"}); - table7.AddRow(new string[] { + table146.AddRow(new string[] { "00000002", "Customer 2"}); - table7.AddRow(new string[] { + table146.AddRow(new string[] { "00000003", "Customer 3"}); #line 32 - await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table146, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table147 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table8.AddRow(new string[] { + table147.AddRow(new string[] { "Test Estate 1"}); #line 38 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table8, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table147, "Given "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table148 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table9.AddRow(new string[] { + table148.AddRow(new string[] { "Test Estate 1", "Safaricom", "False", "False"}); - table9.AddRow(new string[] { + table148.AddRow(new string[] { "Test Estate 1", "Voucher", "False", "False"}); - table9.AddRow(new string[] { + table148.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "False", "False"}); - table9.AddRow(new string[] { + table148.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "False", "False"}); #line 42 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table9, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table148, "Given "); #line hidden - global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table149 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table10.AddRow(new string[] { + table149.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table10.AddRow(new string[] { + table149.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table10.AddRow(new string[] { + table149.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay"}); - table10.AddRow(new string[] { + table149.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay"}); #line 49 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table10, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table149, "And "); #line hidden - global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table150 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table11.AddRow(new string[] { + table150.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table11.AddRow(new string[] { + table150.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table11.AddRow(new string[] { + table150.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract"}); - table11.AddRow(new string[] { + table150.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract"}); #line 56 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table11, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table150, "Given "); #line hidden - global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table151 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -281,7 +281,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table12.AddRow(new string[] { + table151.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -289,7 +289,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table12.AddRow(new string[] { + table151.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -297,7 +297,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table12.AddRow(new string[] { + table151.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -305,7 +305,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Bill Pay (Post)", "", "BillPayment"}); - table12.AddRow(new string[] { + table151.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -314,9 +314,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "BillPayment"}); #line 63 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table12, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table151, "When "); #line hidden - global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table152 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -324,7 +324,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table13.AddRow(new string[] { + table152.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -332,7 +332,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); - table13.AddRow(new string[] { + table152.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -340,7 +340,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); - table13.AddRow(new string[] { + table152.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -349,9 +349,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.50"}); #line 70 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table13, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table152, "When "); #line hidden - global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table153 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -361,7 +361,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table14.AddRow(new string[] { + table153.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -371,7 +371,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table14.AddRow(new string[] { + table153.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -381,7 +381,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table14.AddRow(new string[] { + table153.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -391,7 +391,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 3", "testcontact3@merchant3.co.uk", "Test Estate 1"}); - table14.AddRow(new string[] { + table153.AddRow(new string[] { "Test Merchant 4", "Address Line 1", "TestTown", @@ -402,239 +402,239 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact4@merchant4.co.uk", "Test Estate 1"}); #line 76 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table14, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table153, "Given "); #line hidden - global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table154 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 3", "00000001", "10000001", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Safaricom", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "Voucher", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 4", "00000004", "10000004", "Test Estate 1"}); - table15.AddRow(new string[] { + table154.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 4", "00000001", "10000001", "Test Estate 1"}); #line 83 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table15, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table154, "Given "); #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table155 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table16.AddRow(new string[] { + table155.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table16.AddRow(new string[] { + table155.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table16.AddRow(new string[] { + table155.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 1"}); - table16.AddRow(new string[] { + table155.AddRow(new string[] { "123456783", "Test Merchant 4", "Test Estate 1"}); #line 102 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table16, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table155, "Given "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table156 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table17.AddRow(new string[] { + table156.AddRow(new string[] { "Deposit1", "265.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table17.AddRow(new string[] { + table156.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table17.AddRow(new string[] { + table156.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 1"}); - table17.AddRow(new string[] { + table156.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 4", "Test Estate 1"}); #line 109 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table17, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table156, "Given "); #line hidden - global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table157 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "PataPawa PostPay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "PataPawa PrePay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "PataPawa PostPay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "PataPawa PrePay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "Safaricom Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "PataPawa PostPay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "PataPawa PrePay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "Safaricom Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "PataPawa PostPay Contract"}); - table18.AddRow(new string[] { + table157.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "PataPawa PrePay Contract"}); #line 116 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table18, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table157, "When "); #line hidden } @@ -668,7 +668,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table158 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -688,7 +688,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AccountNumber", "CustomerName", "MeterNumber"}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "1", "Sale", @@ -708,7 +708,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "2", "Sale", @@ -728,7 +728,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "3", "Sale", @@ -748,7 +748,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "4", "Sale", @@ -768,7 +768,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "5", "Sale", @@ -788,7 +788,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "6", "Sale", @@ -808,7 +808,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "7", "Sale", @@ -828,7 +828,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "8", "Sale", @@ -848,7 +848,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "9", "Sale", @@ -868,7 +868,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "Mr Test Customer", ""}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "10", "Sale", @@ -888,7 +888,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", "00000001"}); - table19.AddRow(new string[] { + table158.AddRow(new string[] { "Today", "11", "Sale", @@ -909,84 +909,84 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Customer 1", "00000001"}); #line 138 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table19, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table158, "When "); #line hidden - global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table159 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "8", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "9", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "10", "0000", "SUCCESS"}); - table20.AddRow(new string[] { + table159.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "11", "0000", "SUCCESS"}); #line 152 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table20, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table159, "Then "); #line hidden - global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table160 = new global::Reqnroll.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -994,7 +994,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Out", "ChangeAmount", "Balance"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -1002,7 +1002,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "265.00", "230.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1010,7 +1010,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "110.00", "110.00", "130.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1018,7 +1018,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "90.00", "90.00", "30.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1026,7 +1026,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10.00", "10.00", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1034,7 +1034,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "20.00", "20.00", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1042,7 +1042,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "20.00", "25.00", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1050,7 +1050,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.55", "0.55", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1058,7 +1058,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.45", "0.45", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1066,7 +1066,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.01", "0.10", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1074,7 +1074,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.01", "0.10", "20.00"}); - table21.AddRow(new string[] { + table160.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -1084,9 +1084,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "20.00"}); #line 166 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table21, "Then "); + "tate 1\' and merchant \'Test Merchant 1\'", ((string)(null)), table160, "Then "); #line hidden - global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table161 = new global::Reqnroll.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -1094,7 +1094,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Out", "ChangeAmount", "Balance"}); - table22.AddRow(new string[] { + table161.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -1102,7 +1102,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "110.00", "230.00"}); - table22.AddRow(new string[] { + table161.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1110,7 +1110,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "100.00", "100.00", "130.00"}); - table22.AddRow(new string[] { + table161.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1118,7 +1118,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10.00", "10.00", "30.00"}); - table22.AddRow(new string[] { + table161.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1126,7 +1126,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.50", "0.50", "20.00"}); - table22.AddRow(new string[] { + table161.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -1136,9 +1136,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "20.00"}); #line 180 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table22, "Then "); + "tate 1\' and merchant \'Test Merchant 2\'", ((string)(null)), table161, "Then "); #line hidden - global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table162 = new global::Reqnroll.Table(new string[] { "DateTime", "Reference", "EntryType", @@ -1146,7 +1146,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Out", "ChangeAmount", "Balance"}); - table23.AddRow(new string[] { + table162.AddRow(new string[] { "Today", "Merchant Deposit", "C", @@ -1154,7 +1154,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "110.00", "230.00"}); - table23.AddRow(new string[] { + table162.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1162,7 +1162,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "100.00", "100.00", "130.00"}); - table23.AddRow(new string[] { + table162.AddRow(new string[] { "Today", "Transaction Completed", "D", @@ -1170,7 +1170,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10.00", "10.00", "30.00"}); - table23.AddRow(new string[] { + table162.AddRow(new string[] { "Today", "Transaction Fee Processed", "C", @@ -1178,7 +1178,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.85", "0.50", "20.00"}); - table23.AddRow(new string[] { + table162.AddRow(new string[] { "Today", "Opening Balance", "C", @@ -1188,9 +1188,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "20.00"}); #line 188 await testRunner.ThenAsync("the following entries appear in the merchants balance history for estate \'Test Es" + - "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table23, "Then "); + "tate 1\' and merchant \'Test Merchant 3\'", ((string)(null)), table162, "Then "); #line hidden - global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table163 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1204,7 +1204,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table24.AddRow(new string[] { + table163.AddRow(new string[] { "Today", "12", "Sale", @@ -1219,24 +1219,24 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "Variable Topup"}); #line 200 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table24, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table163, "When "); #line hidden - global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table164 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table25.AddRow(new string[] { + table164.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "12", "1000", "Device Identifier 123456781 not valid for Merchant Test Merchant 1"}); #line 204 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table25, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table164, "Then "); #line hidden - global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table165 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1250,7 +1250,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table26.AddRow(new string[] { + table165.AddRow(new string[] { "Today", "13", "Sale", @@ -1265,24 +1265,24 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "Variable Topup"}); #line 208 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table26, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table165, "When "); #line hidden - global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table166 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table27.AddRow(new string[] { + table166.AddRow(new string[] { "InvalidEstate", "Test Merchant 1", "13", "1001", "Estate Id [79902550-64df-4491-b0c1-4e78943928a3] is not a valid estate"}); #line 212 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table27, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table166, "Then "); #line hidden - global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table167 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1296,7 +1296,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table28.AddRow(new string[] { + table167.AddRow(new string[] { "Today", "14", "Sale", @@ -1311,15 +1311,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "Variable Topup"}); #line 216 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table28, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table167, "When "); #line hidden - global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table168 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table29.AddRow(new string[] { + table168.AddRow(new string[] { "Test Estate 1", "InvalidMerchant", "14", @@ -1327,9 +1327,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Id [d59320fa-4c3e-4900-a999-483f6a10c69a] is not a valid merchant for es" + "tate [Test Estate 1]"}); #line 220 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table29, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table168, "Then "); #line hidden - global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table169 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1343,7 +1343,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table30.AddRow(new string[] { + table169.AddRow(new string[] { "Today", "15", "Sale", @@ -1358,15 +1358,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "EmptyContract", "Variable Topup"}); #line 224 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table30, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table169, "When "); #line hidden - global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table170 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table31.AddRow(new string[] { + table170.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "15", @@ -1374,9 +1374,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Contract Id [00000000-0000-0000-0000-000000000000] must be set for a sale transac" + "tion"}); #line 228 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table31, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table170, "Then "); #line hidden - global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table171 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1390,7 +1390,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table32.AddRow(new string[] { + table171.AddRow(new string[] { "Today", "16", "Sale", @@ -1405,15 +1405,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "InvalidContract", "Variable Topup"}); #line 232 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table32, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table171, "When "); #line hidden - global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table172 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table33.AddRow(new string[] { + table172.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "16", @@ -1421,9 +1421,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Contract Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test M" + "erchant 1]"}); #line 236 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table33, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table172, "Then "); #line hidden - global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table173 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1437,7 +1437,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table34.AddRow(new string[] { + table173.AddRow(new string[] { "Today", "17", "Sale", @@ -1452,15 +1452,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "EmptyProduct"}); #line 240 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table34, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table173, "When "); #line hidden - global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table174 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table35.AddRow(new string[] { + table174.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "17", @@ -1468,9 +1468,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Product Id [00000000-0000-0000-0000-000000000000] must be set for a sale transact" + "ion"}); #line 244 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table35, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table174, "Then "); #line hidden - global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table175 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1484,7 +1484,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table36.AddRow(new string[] { + table175.AddRow(new string[] { "Today", "18", "Sale", @@ -1499,15 +1499,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "InvalidProduct"}); #line 248 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table36, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table175, "When "); #line hidden - global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table176 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table37.AddRow(new string[] { + table176.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "18", @@ -1515,9 +1515,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Product Id [934d8164-f36a-448e-b27b-4d671d41d180] not valid for Merchant [Test Me" + "rchant 1]"}); #line 252 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table37, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table176, "Then "); #line hidden - global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table177 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1531,7 +1531,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table38.AddRow(new string[] { + table177.AddRow(new string[] { "Today", "19", "Sale", @@ -1546,15 +1546,15 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "Variable Topup"}); #line 256 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table38, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table177, "When "); #line hidden - global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table178 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table39.AddRow(new string[] { + table178.AddRow(new string[] { "Test Estate 1", "Test Merchant 4", "19", @@ -1562,7 +1562,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant [Test Merchant 4] does not have enough credit available [100.00] to perf" + "orm transaction amount [300.00]"}); #line 260 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table39, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table178, "Then "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 9ca19c60..c19f0e8a 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs @@ -111,108 +111,108 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table55 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table179 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table55.AddRow(new string[] { + table179.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); #line 6 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table55, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table179, "Given "); #line hidden - global::Reqnroll.Table table56 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table180 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table56.AddRow(new string[] { + table180.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "MerchantId, EstateId, role"}); #line 10 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table56, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table180, "Given "); #line hidden - global::Reqnroll.Table table57 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table181 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table57.AddRow(new string[] { + table181.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); #line 14 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table57, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table181, "Given "); #line hidden - global::Reqnroll.Table table58 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table182 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table58.AddRow(new string[] { + table182.AddRow(new string[] { "serviceClient"}); #line 18 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table58, "Given "); + "s", ((string)(null)), table182, "Given "); #line hidden - global::Reqnroll.Table table59 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table183 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table59.AddRow(new string[] { + table183.AddRow(new string[] { "Test Estate 1"}); #line 22 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table59, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table183, "Given "); #line hidden - global::Reqnroll.Table table60 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table184 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table60.AddRow(new string[] { + table184.AddRow(new string[] { "Test Estate 1", "Safaricom", "False", "False"}); - table60.AddRow(new string[] { + table184.AddRow(new string[] { "Test Estate 1", "Voucher", "False", "False"}); #line 26 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table60, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table184, "Given "); #line hidden - global::Reqnroll.Table table61 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table185 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table61.AddRow(new string[] { + table185.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table61.AddRow(new string[] { + table185.AddRow(new string[] { "Test Estate 1", "Voucher"}); #line 31 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table61, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table185, "And "); #line hidden - global::Reqnroll.Table table62 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table186 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table62.AddRow(new string[] { + table186.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table62.AddRow(new string[] { + table186.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); #line 36 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table62, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table186, "Given "); #line hidden - global::Reqnroll.Table table63 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table187 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -220,7 +220,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table63.AddRow(new string[] { + table187.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -228,7 +228,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table63.AddRow(new string[] { + table187.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -237,9 +237,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 41 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table63, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table187, "When "); #line hidden - global::Reqnroll.Table table64 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table188 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -247,7 +247,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table64.AddRow(new string[] { + table188.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -256,7 +256,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "2.50"}); #line 46 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table64, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table188, "When "); #line hidden } @@ -288,7 +288,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table65 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table189 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -299,7 +299,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "EmailAddress", "EstateName", "SettlementSchedule"}); - table65.AddRow(new string[] { + table189.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -310,7 +310,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1", "Immediate"}); - table65.AddRow(new string[] { + table189.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -321,7 +321,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact2@merchant2.co.uk", "Test Estate 1", "Weekly"}); - table65.AddRow(new string[] { + table189.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -333,131 +333,131 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 1", "Monthly"}); #line 51 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table65, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table189, "Given "); #line hidden - global::Reqnroll.Table table66 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table190 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); - table66.AddRow(new string[] { + table190.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 1"}); #line 57 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table66, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table190, "Given "); #line hidden - global::Reqnroll.Table table67 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table191 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table67.AddRow(new string[] { + table191.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table67.AddRow(new string[] { + table191.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table67.AddRow(new string[] { + table191.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 1"}); #line 66 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table67, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table191, "Given "); #line hidden - global::Reqnroll.Table table68 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table192 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table68.AddRow(new string[] { + table192.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table68.AddRow(new string[] { + table192.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table68.AddRow(new string[] { + table192.AddRow(new string[] { "Deposit1", "120.00", "Today", "Test Merchant 3", "Test Estate 1"}); #line 72 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table68, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table192, "Given "); #line hidden - global::Reqnroll.Table table69 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table193 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "Safaricom Contract"}); - table69.AddRow(new string[] { + table193.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "Hospital 1 Contract"}); #line 78 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table69, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table193, "When "); #line hidden - global::Reqnroll.Table table70 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table194 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -473,7 +473,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -489,7 +489,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -505,7 +505,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -521,7 +521,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -537,7 +537,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -553,7 +553,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "test@recipient.co.uk", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -569,7 +569,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "123456789"}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "7", "Sale", @@ -585,7 +585,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "test@recipient.co.uk", ""}); - table70.AddRow(new string[] { + table194.AddRow(new string[] { "2022-01-06", "8", "Sale", @@ -602,95 +602,95 @@ await testRunner.GivenAsync("I have a token to access the estate management and "test@recipient.co.uk", ""}); #line 87 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table70, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table194, "When "); #line hidden - global::Reqnroll.Table table71 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table195 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "3", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "7", "0000", "SUCCESS"}); - table71.AddRow(new string[] { + table195.AddRow(new string[] { "Test Estate 1", "Test Merchant 3", "8", "0000", "SUCCESS"}); #line 98 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table71, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table195, "Then "); #line hidden - global::Reqnroll.Table table72 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table196 = new global::Reqnroll.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table72.AddRow(new string[] { + table196.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); - table72.AddRow(new string[] { + table196.AddRow(new string[] { "2022-02-06", "Test Estate 1", "Test Merchant 3", "1"}); #line 109 - await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table72, "When "); + await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table196, "When "); #line hidden - global::Reqnroll.Table table73 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table197 = new global::Reqnroll.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table73.AddRow(new string[] { + table197.AddRow(new string[] { "2022-01-06", "Test Estate 1", "Test Merchant 1", "2"}); #line 114 - await testRunner.WhenAsync("I get the completed settlements the following information should be returned", ((string)(null)), table73, "When "); + await testRunner.WhenAsync("I get the completed settlements the following information should be returned", ((string)(null)), table197, "When "); #line hidden } await this.ScenarioCleanupAsync(); @@ -721,7 +721,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table74 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table198 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -732,7 +732,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "EmailAddress", "EstateName", "SettlementSchedule"}); - table74.AddRow(new string[] { + table198.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -743,7 +743,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1", "Immediate"}); - table74.AddRow(new string[] { + table198.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -755,101 +755,101 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 1", "Weekly"}); #line 120 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table74, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table198, "Given "); #line hidden - global::Reqnroll.Table table75 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table199 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table75.AddRow(new string[] { + table199.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table75.AddRow(new string[] { + table199.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table75.AddRow(new string[] { + table199.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table75.AddRow(new string[] { + table199.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); #line 125 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table75, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table199, "Given "); #line hidden - global::Reqnroll.Table table76 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table200 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table76.AddRow(new string[] { + table200.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table76.AddRow(new string[] { + table200.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); #line 132 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table76, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table200, "Given "); #line hidden - global::Reqnroll.Table table77 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table201 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table77.AddRow(new string[] { + table201.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table77.AddRow(new string[] { + table201.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table77.AddRow(new string[] { + table201.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table77.AddRow(new string[] { + table201.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); #line 137 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table77, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table201, "When "); #line hidden - global::Reqnroll.Table table78 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table202 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table78.AddRow(new string[] { + table202.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table78.AddRow(new string[] { + table202.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); #line 144 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table78, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table202, "Given "); #line hidden - global::Reqnroll.Table table79 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table203 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -865,7 +865,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table79.AddRow(new string[] { + table203.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -881,7 +881,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table79.AddRow(new string[] { + table203.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -897,7 +897,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table79.AddRow(new string[] { + table203.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -913,7 +913,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table79.AddRow(new string[] { + table203.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -929,7 +929,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "test@recipient.co.uk", ""}); - table79.AddRow(new string[] { + table203.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -946,59 +946,59 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "123456789"}); #line 149 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table79, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table203, "When "); #line hidden - global::Reqnroll.Table table80 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table204 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table80.AddRow(new string[] { + table204.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table80.AddRow(new string[] { + table204.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table80.AddRow(new string[] { + table204.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table80.AddRow(new string[] { + table204.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "0000", "SUCCESS"}); - table80.AddRow(new string[] { + table204.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "0000", "SUCCESS"}); #line 157 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table80, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table204, "Then "); #line hidden - global::Reqnroll.Table table81 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table205 = new global::Reqnroll.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table81.AddRow(new string[] { + table205.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "1"}); #line 165 - await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table81, "When "); + await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table205, "When "); #line hidden #line 169 await testRunner.WhenAsync("I process the settlement for \'2022-01-13\' on Estate \'Test Estate 1\' for Merchant " + diff --git a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs index 7be85b31..db9f3001 100644 --- a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs @@ -111,110 +111,110 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table82 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table206 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table82.AddRow(new string[] { + table206.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); #line 6 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table82, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table206, "Given "); #line hidden - global::Reqnroll.Table table83 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table207 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table83.AddRow(new string[] { + table207.AddRow(new string[] { "transactionProcessor", "Estate Managememt REST", "Secret1", "transactionProcessor", "MerchantId, EstateId, role"}); #line 10 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table83, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table207, "Given "); #line hidden - global::Reqnroll.Table table84 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table208 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table84.AddRow(new string[] { + table208.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor", "client_credentials"}); #line 14 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table84, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table208, "Given "); #line hidden - global::Reqnroll.Table table85 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table209 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table85.AddRow(new string[] { + table209.AddRow(new string[] { "serviceClient"}); #line 18 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor resource" + - "s", ((string)(null)), table85, "Given "); + "s", ((string)(null)), table209, "Given "); #line hidden - global::Reqnroll.Table table86 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table210 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table86.AddRow(new string[] { + table210.AddRow(new string[] { "Test Estate 1"}); - table86.AddRow(new string[] { + table210.AddRow(new string[] { "Test Estate 2"}); #line 22 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table86, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table210, "Given "); #line hidden - global::Reqnroll.Table table87 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table211 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table87.AddRow(new string[] { + table211.AddRow(new string[] { "Test Estate 1", "Safaricom", "False", "False"}); - table87.AddRow(new string[] { + table211.AddRow(new string[] { "Test Estate 2", "Safaricom", "False", "False"}); #line 27 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table87, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table211, "Given "); #line hidden - global::Reqnroll.Table table88 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table212 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table88.AddRow(new string[] { + table212.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table88.AddRow(new string[] { + table212.AddRow(new string[] { "Test Estate 2", "Safaricom"}); #line 32 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table88, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table212, "And "); #line hidden - global::Reqnroll.Table table89 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table213 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table89.AddRow(new string[] { + table213.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table89.AddRow(new string[] { + table213.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); #line 37 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table89, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table213, "Given "); #line hidden - global::Reqnroll.Table table90 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table214 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -222,7 +222,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table90.AddRow(new string[] { + table214.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -230,7 +230,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table90.AddRow(new string[] { + table214.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -239,9 +239,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "MobileTopup"}); #line 42 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table90, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table214, "When "); #line hidden - global::Reqnroll.Table table91 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table215 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -250,7 +250,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "FeeDescription", "Value", "FeeType"}); - table91.AddRow(new string[] { + table215.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -259,7 +259,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.50", "Merchant"}); - table91.AddRow(new string[] { + table215.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -269,9 +269,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.85", "Merchant"}); #line 47 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table91, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table215, "When "); #line hidden - global::Reqnroll.Table table92 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table216 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -282,7 +282,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "EmailAddress", "EstateName", "SettlementSchedule"}); - table92.AddRow(new string[] { + table216.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -293,7 +293,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1", "Weekly"}); - table92.AddRow(new string[] { + table216.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -304,7 +304,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact2@merchant2.co.uk", "Test Estate 1", "Weekly"}); - table92.AddRow(new string[] { + table216.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -316,101 +316,101 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Monthly"}); #line 52 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table92, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table216, "Given "); #line hidden - global::Reqnroll.Table table93 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table217 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table93.AddRow(new string[] { + table217.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table93.AddRow(new string[] { + table217.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table93.AddRow(new string[] { + table217.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 58 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table93, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table217, "Given "); #line hidden - global::Reqnroll.Table table94 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table218 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table94.AddRow(new string[] { + table218.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table94.AddRow(new string[] { + table218.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table94.AddRow(new string[] { + table218.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 64 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table94, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table218, "Given "); #line hidden - global::Reqnroll.Table table95 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table219 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table95.AddRow(new string[] { + table219.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table95.AddRow(new string[] { + table219.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table95.AddRow(new string[] { + table219.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); #line 70 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table95, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table219, "When "); #line hidden - global::Reqnroll.Table table96 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table220 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table96.AddRow(new string[] { + table220.AddRow(new string[] { "Deposit1", "50000.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table96.AddRow(new string[] { + table220.AddRow(new string[] { "Deposit1", "50000.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table96.AddRow(new string[] { + table220.AddRow(new string[] { "Deposit1", "50000.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 76 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table96, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table220, "Given "); #line hidden - global::Reqnroll.Table table97 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table221 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -424,7 +424,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CustomerEmailAddress", "ContractDescription", "ProductName"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -438,7 +438,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -452,7 +452,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -466,7 +466,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -480,7 +480,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "5", "Sale", @@ -494,7 +494,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "6", "Sale", @@ -508,7 +508,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "7", "Sale", @@ -522,7 +522,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "8", "Sale", @@ -536,7 +536,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -550,7 +550,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "2", "Sale", @@ -564,7 +564,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "3", "Sale", @@ -578,7 +578,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "4", "Sale", @@ -592,7 +592,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Safaricom Contract", "Variable Topup"}); - table97.AddRow(new string[] { + table221.AddRow(new string[] { "2022-01-06", "1", "Sale", @@ -607,112 +607,112 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Safaricom Contract", "Variable Topup"}); #line 82 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table97, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table221, "When "); #line hidden - global::Reqnroll.Table table98 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table222 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "2", "1008", "DECLINED BY OPERATOR"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "3", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "1008", "DECLINED BY OPERATOR"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "6", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "7", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "8", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "1", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "1008", "DECLINED BY OPERATOR"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "3", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "4", "0000", "SUCCESS"}); - table98.AddRow(new string[] { + table222.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "1", "0000", "SUCCESS"}); #line 100 - await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table98, "Then "); + await testRunner.ThenAsync("transaction response should contain the following information", ((string)(null)), table222, "Then "); #line hidden - global::Reqnroll.Table table99 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table223 = new global::Reqnroll.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table99.AddRow(new string[] { + table223.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 1", "6"}); - table99.AddRow(new string[] { + table223.AddRow(new string[] { "2022-01-13", "Test Estate 1", "Test Merchant 2", "3"}); #line 118 - await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table99, "When "); + await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table223, "When "); #line hidden #line 123 await testRunner.WhenAsync("I process the settlement for \'2022-01-13\' on Estate \'Test Estate 1\' for Merchant " + @@ -724,18 +724,18 @@ await testRunner.GivenAsync("I have a token to access the estate management and "\'Test Merchant 2\' then 3 fees are marked as settled and the settlement is comple" + "ted", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden - global::Reqnroll.Table table100 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table224 = new global::Reqnroll.Table(new string[] { "SettlementDate", "EstateName", "MerchantName", "NumberOfFees"}); - table100.AddRow(new string[] { + table224.AddRow(new string[] { "2022-02-06", "Test Estate 2", "Test Merchant 3", "1"}); #line 127 - await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table100, "When "); + await testRunner.WhenAsync("I get the pending settlements the following information should be returned", ((string)(null)), table224, "When "); #line hidden #line 131 await testRunner.WhenAsync("I process the settlement for \'2022-02-06\' on Estate \'Test Estate 2\' for Merchant " + @@ -776,12 +776,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden - global::Reqnroll.Table table101 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table225 = new global::Reqnroll.Table(new string[] { "SettlementDate", "NumberOfFeesSettled", "ValueOfFeesSettled", "IsCompleted"}); - table101.AddRow(new string[] { + table225.AddRow(new string[] { "2022-01-13", "6", "2.39", @@ -789,14 +789,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 136 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 1\' for Merchant \'Test " + "Merchant 1\' with the Start Date \'2022-01-13\' and the End Date \'2022-02-06\' the f" + - "ollowing data is returned", ((string)(null)), table101, "When "); + "ollowing data is returned", ((string)(null)), table225, "When "); #line hidden - global::Reqnroll.Table table102 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table226 = new global::Reqnroll.Table(new string[] { "SettlementDate", "NumberOfFeesSettled", "ValueOfFeesSettled", "IsCompleted"}); - table102.AddRow(new string[] { + table226.AddRow(new string[] { "2022-01-13", "3", "0.71", @@ -804,14 +804,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 140 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 1\' for Merchant \'Test " + "Merchant 2\' with the Start Date \'2022-01-13\' and the End Date \'2022-02-06\' the f" + - "ollowing data is returned", ((string)(null)), table102, "When "); + "ollowing data is returned", ((string)(null)), table226, "When "); #line hidden - global::Reqnroll.Table table103 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table227 = new global::Reqnroll.Table(new string[] { "SettlementDate", "NumberOfFeesSettled", "ValueOfFeesSettled", "IsCompleted"}); - table103.AddRow(new string[] { + table227.AddRow(new string[] { "2022-02-06", "1", "0.85", @@ -819,84 +819,84 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 144 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 2\' for Merchant \'Test " + "Merchant 3\' with the Start Date \'2022-01-13\' and the End Date \'2022-02-06\' the f" + - "ollowing data is returned", ((string)(null)), table103, "When "); + "ollowing data is returned", ((string)(null)), table227, "When "); #line hidden - global::Reqnroll.Table table104 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table228 = new global::Reqnroll.Table(new string[] { "FeeDescription", "IsSettled", "Operator", "CalculatedValue"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.50"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.13"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.75"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.20"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.30"}); - table104.AddRow(new string[] { + table228.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.51"}); #line 148 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 1\' for Merchant \'Test " + - "Merchant 1\' with the Date \'2022-01-13\' the following fees are settled", ((string)(null)), table104, "When "); + "Merchant 1\' with the Date \'2022-01-13\' the following fees are settled", ((string)(null)), table228, "When "); #line hidden - global::Reqnroll.Table table105 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table229 = new global::Reqnroll.Table(new string[] { "FeeDescription", "IsSettled", "Operator", "CalculatedValue"}); - table105.AddRow(new string[] { + table229.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.50"}); - table105.AddRow(new string[] { + table229.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.13"}); - table105.AddRow(new string[] { + table229.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.08"}); #line 157 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 1\' for Merchant \'Test " + - "Merchant 2\' with the Date \'2022-01-13\' the following fees are settled", ((string)(null)), table105, "When "); + "Merchant 2\' with the Date \'2022-01-13\' the following fees are settled", ((string)(null)), table229, "When "); #line hidden - global::Reqnroll.Table table106 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table230 = new global::Reqnroll.Table(new string[] { "FeeDescription", "IsSettled", "Operator", "CalculatedValue"}); - table106.AddRow(new string[] { + table230.AddRow(new string[] { "Merchant Commission", "True", "Safaricom", "0.85"}); #line 163 await testRunner.WhenAsync("I get the Estate Settlement Report for Estate \'Test Estate 2\' for Merchant \'Test " + - "Merchant 3\' with the Date \'2022-02-06\' the following fees are settled", ((string)(null)), table106, "When "); + "Merchant 3\' with the Date \'2022-02-06\' the following fees are settled", ((string)(null)), table230, "When "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs index d66c783d..7c18bd96 100644 --- a/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs @@ -1,7 +1,7 @@ -using SecurityService.DataTransferObjects.Responses; -using SimpleResults; +using SimpleResults; using System; using System.Collections.Generic; +using SecurityService.DataTransferObjects; using TransactionProcessor.DataTransferObjects.Requests.Contract; using TransactionProcessor.DataTransferObjects.Requests.Merchant; using TransactionProcessor.DataTransferObjects.Requests.MerchantSchedule; @@ -18,7 +18,6 @@ namespace TransactionProcessor.IntegrationTests.Shared using Microsoft.EntityFrameworkCore.Metadata.Internal; using Newtonsoft.Json.Linq; using Reqnroll; - using SecurityService.DataTransferObjects.Requests; using SecurityService.IntegrationTesting.Helpers; using Shouldly; using System.Linq; @@ -441,7 +440,7 @@ await this.TransactionProcessorSteps.ThenTheFollowingEntriesAppearInTheMerchants public async Task GivenTheFollowingSecurityRolesExist(DataTable table) { List requests = table.Rows.ToCreateRoleRequests(); - List<(String, Guid)> responses = await this.SecurityServiceSteps.GivenICreateTheFollowingRoles(requests, CancellationToken.None); + List<(String, String)> responses = await this.SecurityServiceSteps.GivenICreateTheFollowingRoles(requests, CancellationToken.None); } [Given(@"I have a token to access the estate management resource")] diff --git a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj index 446db22b..93b88e20 100644 --- a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj +++ b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj @@ -7,17 +7,17 @@ - + - - - + + + - - - + + + @@ -28,7 +28,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj index ce625232..c222abbd 100644 --- a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj +++ b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj b/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj index 505f2742..c2010469 100644 --- a/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj +++ b/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/TransactionProcessor.Testing/TestData.cs b/TransactionProcessor.Testing/TestData.cs index 5242104e..0d2b0394 100644 --- a/TransactionProcessor.Testing/TestData.cs +++ b/TransactionProcessor.Testing/TestData.cs @@ -1,9 +1,9 @@ -using System.Text; -using FileProcessor.FileImportLog.DomainEvents; +using FileProcessor.FileImportLog.DomainEvents; using Microsoft.IdentityModel.Tokens; -using Newtonsoft.Json; +using SecurityService.DataTransferObjects; using Shared.EventStore.ProjectionEngine; using Shared.ValueObjects; +using System.Text; using TransactionProcessor.Aggregates; using TransactionProcessor.BusinessLogic.Events; using TransactionProcessor.BusinessLogic.Services; @@ -28,9 +28,6 @@ namespace TransactionProcessor.Testing { - using System; - using System.Collections.Generic; - using System.Linq; using BusinessLogic.OperatorInterfaces; using BusinessLogic.OperatorInterfaces.PataPawaPostPay; using BusinessLogic.OperatorInterfaces.SafaricomPinless; @@ -39,7 +36,11 @@ namespace TransactionProcessor.Testing using Models; using PataPawaPostPay; using ProjectionEngine.State; - using SecurityService.DataTransferObjects.Responses; + using Shared.Serialisation; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text.Json; using TransactionProcessor.Aggregates.Models; using TransactionProcessor.Database.Entities; using TransactionProcessor.Models.Estate; @@ -47,6 +48,10 @@ namespace TransactionProcessor.Testing public class TestData { + static TestData() { + StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions())); + } + public static String StatementData = "StatementData"; #region Fields @@ -1338,9 +1343,8 @@ public static TransactionAggregate GetStartedTransactionAggregate() return transactionAggregate; } - public static TokenResponse TokenResponse() - { - return SecurityService.DataTransferObjects.Responses.TokenResponse.Create("AccessToken", string.Empty, 100); + public static TokenResponse GetTokenResponse() { + return TokenResponse.Create("AccessToken", "RefreshToken", 100); } public static TransactionDomainEvents.CustomerEmailReceiptRequestedEvent CustomerEmailReceiptRequestedEvent = @@ -2657,7 +2661,7 @@ public static class DomainEvents { new CallbackReceivedEnrichedEvent(TestData.CallbackId) { Reference = TestData.CallbackReference, - CallbackMessage = JsonConvert.SerializeObject(TestData.Deposit), + CallbackMessage = StringSerialiser.Serialise(TestData.Deposit), EstateId = TestData.EstateId, MessageFormat = TestData.CallbackMessageFormat, TypeString = TestData.CallbackTypeString @@ -2667,7 +2671,7 @@ public static class DomainEvents { new CallbackReceivedEnrichedEvent(TestData.CallbackId) { Reference = TestData.CallbackReference, - CallbackMessage = JsonConvert.SerializeObject(TestData.Deposit), + CallbackMessage = StringSerialiser.Serialise(TestData.Deposit), EstateId = TestData.EstateId, MessageFormat = TestData.CallbackMessageFormat, TypeString = "OtherType" diff --git a/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj b/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj index ca12f84c..c4436cf2 100644 --- a/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj +++ b/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj @@ -6,10 +6,10 @@ - + - + diff --git a/TransactionProcessor.Tests/Factories/ModelFactoryTests.cs b/TransactionProcessor.Tests/Factories/ModelFactoryTests.cs index dc590b70..3a94aeff 100644 --- a/TransactionProcessor.Tests/Factories/ModelFactoryTests.cs +++ b/TransactionProcessor.Tests/Factories/ModelFactoryTests.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json; +using Shared.Serialisation; using TransactionProcessor.Aggregates; using TransactionProcessor.DataTransferObjects.Responses.Contract; using TransactionProcessor.DataTransferObjects.Responses.Estate; @@ -26,6 +28,10 @@ namespace TransactionProcessor.Tests.Factories public class ModelFactoryTests { + public ModelFactoryTests() { + StringSerialiser.Initialise(new SystemTextJsonSerializer(new JsonSerializerOptions())); + } + [Fact] public void ModelFactory_Contract_ContractOnly_IsConverted() { diff --git a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj index e24bfaeb..85dde6e0 100644 --- a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj +++ b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/TransactionProcessor/Bootstrapper/ClientRegistry.cs b/TransactionProcessor/Bootstrapper/ClientRegistry.cs index 0eb261ae..0dd26dd2 100644 --- a/TransactionProcessor/Bootstrapper/ClientRegistry.cs +++ b/TransactionProcessor/Bootstrapper/ClientRegistry.cs @@ -1,4 +1,6 @@ -namespace TransactionProcessor.Bootstrapper +using Shared.EventStore.SubscriptionWorker; + +namespace TransactionProcessor.Bootstrapper { using ClientProxyBase; using Lamar; @@ -6,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection; using SecurityService.Client; using Shared.General; + using Shared.Serialisation; using System; using System.Diagnostics.CodeAnalysis; using System.Net.Http; @@ -33,4 +36,22 @@ public ClientRegistry() #endregion } + + [ExcludeFromCodeCoverage] + public class SerialiserRegistry : ServiceRegistry + { + public SerialiserRegistry() + { + this.AddSingleton(); + this.AddSingleton>(_ => obj => StringSerialiser.Serialise(obj)); + this.AddSingleton>(_ => (str, type) => StringSerialiser.DeserializeObject(str, type)); + + var serialiserSettings = SystemTextJsonSerializer.GetDefaultJsonSerializerOptions().AddModifier(JsonTypeInfoModifierExtensions.ForType(typeInfo => + { + typeInfo.RenameProperty(x => x.StreamName, "eventStreamId"); + })); + + this.AddSingleton(serialiserSettings); + } + } } diff --git a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs index cd967bdc..a5f19aaa 100644 --- a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs +++ b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs @@ -1,10 +1,23 @@ -using TransactionProcessor.Aggregates; +using KurrentDB.Client; +using Shared.EventStore.SubscriptionWorker; +using Shared.Serialisation; +using SimpleResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Net.Http; +using System.Text.Json; +using System.Text.Json.Serialization.Metadata; +using System.Threading; +using System.Threading.Tasks; +using TransactionProcessor.Aggregates; using TransactionProcessor.BusinessLogic.Services; using TransactionProcessor.Database.Contexts; using TransactionProcessor.Repository; +using PersistentSubscriptionInfo = Shared.EventStore.SubscriptionWorker.PersistentSubscriptionInfo; -namespace TransactionProcessor.Bootstrapper -{ +namespace TransactionProcessor.Bootstrapper { using Lamar; using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; @@ -32,33 +45,27 @@ namespace TransactionProcessor.Bootstrapper /// /// [ExcludeFromCodeCoverage] - public class RepositoryRegistry : ServiceRegistry - { + public class RepositoryRegistry : ServiceRegistry { private static bool CachedAggregatesAdded; private static readonly object CachedAggregatesLock = new(); - public RepositoryRegistry() - { + public RepositoryRegistry() { string eventStoreConnectionString = Startup.Configuration.GetValue("EventStoreSettings:ConnectionString"); this.AddKurrentDBProjectionManagementClient(eventStoreConnectionString); this.AddKurrentDBPersistentSubscriptionsClient(eventStoreConnectionString); this.AddKurrentDBClient(eventStoreConnectionString); - this.AddSingleton>(cont => (esConnString, cacheDuration) => - SubscriptionRepository.Create(esConnString, cacheDuration)); + this.AddSingleton>(cont => (esConnString, + cacheDuration) => SubscriptionRepository.Create(esConnString, cacheDuration)); this.AddSingleton(typeof(IDbContextResolver<>), typeof(DbContextResolver<>)); - if (Startup.WebHostEnvironment.IsEnvironment("IntegrationTest") || - Startup.Configuration.GetValue("ServiceOptions:UseInMemoryDatabase")) - { + if (Startup.WebHostEnvironment.IsEnvironment("IntegrationTest") || Startup.Configuration.GetValue("ServiceOptions:UseInMemoryDatabase")) { this.AddDbContext(builder => builder.UseInMemoryDatabase("TransactionProcessorReadModel")); } - else - { - this.AddDbContext(options => - options.UseSqlServer(ConfigurationReader.GetConnectionString("TransactionProcessorReadModel"))); + else { + this.AddDbContext(options => options.UseSqlServer(ConfigurationReader.GetConnectionString("TransactionProcessorReadModel"))); } this.AddTransient(); @@ -94,17 +101,13 @@ private void RegisterAggregateRepositories() { private void RegisterAggregateCachingFunc() { // ✅ Defer to the container — safe and compliant - this.AddSingleton>(c => () => - { + this.AddSingleton>(c => () => { var aggregateService = c.GetService(); // Thread-safe single initialization - if (!CachedAggregatesAdded) - { - lock (CachedAggregatesLock) - { - if (!CachedAggregatesAdded) - { + if (!CachedAggregatesAdded) { + lock (CachedAggregatesLock) { + if (!CachedAggregatesAdded) { aggregateService.AddCachedAggregate(typeof(EstateAggregate), null); aggregateService.AddCachedAggregate(typeof(ContractAggregate), null); aggregateService.AddCachedAggregate(typeof(OperatorAggregate), null); diff --git a/TransactionProcessor/Controllers/DomainEventController.cs b/TransactionProcessor/Controllers/DomainEventController.cs index 47bdc320..506ce13d 100644 --- a/TransactionProcessor/Controllers/DomainEventController.cs +++ b/TransactionProcessor/Controllers/DomainEventController.cs @@ -144,19 +144,19 @@ private async Task GetDomainEvent(Object domainEvent) if (type == null) throw new NotFoundException($"Failed to find a domain event with type {eventType}"); - JsonIgnoreAttributeIgnorerContractResolver jsonIgnoreAttributeIgnorerContractResolver = new JsonIgnoreAttributeIgnorerContractResolver(); - JsonSerializerSettings jsonSerialiserSettings = new JsonSerializerSettings - { - ReferenceLoopHandling = ReferenceLoopHandling.Ignore, - TypeNameHandling = TypeNameHandling.All, - Formatting = Formatting.Indented, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - ContractResolver = jsonIgnoreAttributeIgnorerContractResolver - }; + //JsonIgnoreAttributeIgnorerContractResolver jsonIgnoreAttributeIgnorerContractResolver = new JsonIgnoreAttributeIgnorerContractResolver(); + //JsonSerializerSettings jsonSerialiserSettings = new JsonSerializerSettings + //{ + // ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + // TypeNameHandling = TypeNameHandling.All, + // Formatting = Formatting.Indented, + // DateTimeZoneHandling = DateTimeZoneHandling.Utc, + // ContractResolver = jsonIgnoreAttributeIgnorerContractResolver + //}; if (type.IsSubclassOf(typeof(DomainEvent))) { - String json = JsonConvert.SerializeObject(domainEvent, jsonSerialiserSettings); + String json = StringSerialiser.Serialise(domainEvent); //JsonConvert.SerializeObject(domainEvent, jsonSerialiserSettings); DomainEventFactory domainEventFactory = new(); String validatedJson = this.ValidateEvent(json); diff --git a/TransactionProcessor/Startup.cs b/TransactionProcessor/Startup.cs index 05d5c764..8812afa6 100644 --- a/TransactionProcessor/Startup.cs +++ b/TransactionProcessor/Startup.cs @@ -22,6 +22,7 @@ namespace TransactionProcessor using Shared.Extensions; using Shared.General; using Shared.Middleware; + using Shared.Serialisation; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -137,6 +138,7 @@ public void ConfigureContainer(ServiceRegistry services) { services.IncludeRegistry(); services.IncludeRegistry(); services.IncludeRegistry(); + services.IncludeRegistry(); services.IncludeRegistry(); services.AddMemoryCache(); @@ -146,6 +148,9 @@ public void ConfigureContainer(ServiceRegistry services) { Startup.Container = new Container(services); Startup.ServiceProvider = services.BuildServiceProvider(); + + var serialiser = Container.GetRequiredService(); + StringSerialiser.Initialise(serialiser); } internal static void AddAutoApiLogonOperator(String operatorId) { diff --git a/TransactionProcessor/TransactionProcessor.csproj b/TransactionProcessor/TransactionProcessor.csproj index 0d01ff8e..1f28abfa 100644 --- a/TransactionProcessor/TransactionProcessor.csproj +++ b/TransactionProcessor/TransactionProcessor.csproj @@ -12,7 +12,7 @@ - + @@ -31,11 +31,11 @@ - - - + + + - + diff --git a/TransactionProcessor/nlog.config b/TransactionProcessor/nlog.config index 1ec67c78..0cd9d21d 100644 --- a/TransactionProcessor/nlog.config +++ b/TransactionProcessor/nlog.config @@ -33,7 +33,7 @@ s - +