From 479abdf3e8f872249d01c0ed5f81c30e7c0c0dfe Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 16:24:47 +0100 Subject: [PATCH 1/7] nuget updates --- Directory.Packages.props | 76 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ec31b57..4cadfd6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,59 +4,59 @@ - - - + + + - + - - - - - - - - - - + + + + + + + + + + - + - + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + \ No newline at end of file From 31b6f0409f180630a337b0d396acbf47bfe2d52e Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 16:32:04 +0100 Subject: [PATCH 2/7] build fixes --- .../Common/DockerHelper.cs | 23 +++++++++++++++---- .../Steps/SharedSteps.cs | 8 ++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/FileProcessor.IntegrationTests/Common/DockerHelper.cs b/FileProcessor.IntegrationTests/Common/DockerHelper.cs index f6c3637..71bf250 100644 --- a/FileProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/FileProcessor.IntegrationTests/Common/DockerHelper.cs @@ -1,7 +1,7 @@ -using System; +using DotNet.Testcontainers.Builders; +using System; using System.Collections.Generic; using System.Threading.Tasks; -using DotNet.Testcontainers.Builders; namespace FileProcessor.IntegrationTests.Common { @@ -11,6 +11,7 @@ namespace FileProcessor.IntegrationTests.Common using Shared.IntegrationTesting; using Shared.Serialisation; using System.Net.Http; + using TestHosts.Clients; using TransactionProcessor.Client; public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.DockerHelper{ @@ -34,6 +35,8 @@ public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.Doc public EventStoreProjectionManagementClient ProjectionManagementClient; + public IAgencyBankingClient AgencyBankingClient; + #endregion #region Constructors @@ -85,7 +88,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do String SecurityServiceBaseAddressResolver(String api) => $"https://127.0.0.1:{this.SecurityServicePort}"; String FileProcessorBaseAddressResolver(String api) => $"http://127.0.0.1:{this.FileProcessorPort}"; String TransactionProcessorBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TransactionProcessorPort}"; - + String TestHostServiceBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TestHostServicePort}"; + HttpClientHandler clientHandler = new HttpClientHandler{ ServerCertificateCustomValidationCallback = (message, certificate2, @@ -109,7 +113,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do 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}"); - + this.AgencyBankingClient = new AgencyBankingClient(TestHostServiceBaseAddressResolver, httpClient, Serialise_CamelCase, this.Deserialise_CamelCase); + this.ProjectionManagementClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings()); } @@ -123,6 +128,16 @@ Object Deserialise(String arg, Type type) return StringSerialiser.DeserializeObject(arg, type, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); } + String Serialise_CamelCase(Object arg) + { + return StringSerialiser.Serialise(arg, new SerialiserOptions(SerialiserPropertyFormat.CamelCase)); + } + + Object Deserialise_CamelCase(String arg, Type type) + { + return StringSerialiser.DeserializeObject(arg, type, new SerialiserOptions(SerialiserPropertyFormat.CamelCase)); + } + #endregion } } diff --git a/FileProcessor.IntegrationTests/Steps/SharedSteps.cs b/FileProcessor.IntegrationTests/Steps/SharedSteps.cs index d309861..86a06ca 100644 --- a/FileProcessor.IntegrationTests/Steps/SharedSteps.cs +++ b/FileProcessor.IntegrationTests/Steps/SharedSteps.cs @@ -27,6 +27,7 @@ namespace FileProcessor.IntegrationTests.Steps using System.IO; using System.Text.Json; using System.Threading; + using TestHosts.Clients; [Binding] [Scope(Tag = "shared")] @@ -41,14 +42,15 @@ public class SharedSteps private readonly TransactionProcessorSteps TransactionProcessorSteps; private readonly FileProcessorSteps FileProcessorSteps; - + public SharedSteps(ScenarioContext scenarioContext, TestingContext testingContext) { ScenarioContext = scenarioContext; TestingContext = testingContext; this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient); - this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient,testingContext.DockerHelper.TestHostHttpClient, testingContext.DockerHelper.ProjectionManagementClient); + this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient,testingContext.DockerHelper.TestHostHttpClient, + testingContext.DockerHelper.ProjectionManagementClient, testingContext.DockerHelper.AgencyBankingClient); this.FileProcessorSteps = new FileProcessorSteps(testingContext.DockerHelper.FileProcessorClient); } @@ -175,7 +177,7 @@ public async Task GivenIHaveAssignedTheFollowingOperatorsToTheEstates(DataTable public async Task WhenICreateTheFollowingMerchants(DataTable table) { var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); - List<(EstateDetails estate, CreateMerchantRequest)> requests = table.Rows.ToCreateMerchantRequests(estates); + var requests = table.Rows.ToCreateMerchantRequests(estates); List verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); From ef04f5cf9709bd37920f229407474c049edeb0aa Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 16:41:02 +0100 Subject: [PATCH 3/7] Fix .NET 10 xUnit test runner --- Directory.Packages.props | 4 ++-- .../FileProcessor.BusinessLogic.Tests.csproj | 2 +- .../FileProcessor.FileAggregate.Tests.csproj | 2 +- .../FileProcessor.FileImportLogAggregate.Tests.csproj | 2 +- .../FileProcessor.FileProfileAggregate.Tests.csproj | 2 +- FileProcessor.Tests/FileProcessor.Tests.csproj | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4cadfd6..6489b81 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -56,7 +56,7 @@ - + - \ No newline at end of file + diff --git a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj index 1a14965..51862df 100644 --- a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj +++ b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj index 8319203..64adb94 100644 --- a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj +++ b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj index 78fe438..122f1f2 100644 --- a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj +++ b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj index c27c911..068d224 100644 --- a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj +++ b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.Tests/FileProcessor.Tests.csproj b/FileProcessor.Tests/FileProcessor.Tests.csproj index f968bae..4e0e8ef 100644 --- a/FileProcessor.Tests/FileProcessor.Tests.csproj +++ b/FileProcessor.Tests/FileProcessor.Tests.csproj @@ -12,7 +12,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -30,4 +30,4 @@ - \ No newline at end of file + From 23f0d474dd3e5ba4b2f5d2e9c8e38e57edf693c3 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 17:05:50 +0100 Subject: [PATCH 4/7] Migrate test workflows to MTP --- .github/workflows/codecoverage.yml | 70 +++++++------- .github/workflows/nightlybuild.yml | 81 ++++++++-------- .github/workflows/pullrequest.yml | 92 +++++++++++-------- Directory.Packages.props | 3 +- .../FileProcessor.BusinessLogic.Tests.csproj | 6 +- .../FileProcessor.FileAggregate.Tests.csproj | 6 +- ...cessor.FileImportLogAggregate.Tests.csproj | 6 +- ...rocessor.FileProfileAggregate.Tests.csproj | 6 +- .../FileProcessor.IntegrationTests.csproj | 3 + .../FileProcessor.Tests.csproj | 6 +- global.json | 5 + 11 files changed, 169 insertions(+), 115 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 68b73fb..a3bc8a8 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -2,46 +2,52 @@ name: Code Coverage on: push: - # branches to consider in the event; optional, defaults to all branches: - main workflow_dispatch: -jobs: +permissions: + contents: read + +jobs: build: - name: "Code Coverage" + name: Code Coverage env: - ASPNETCORE_ENVIRONMENT: "Production" + ASPNETCORE_ENVIRONMENT: Production runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 - - - name: Restore Nuget Packages - run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} - - - name: Build Code - run: dotnet build FileProcessor.sln --configuration Release - - - name: Run Unit Tests - run: | - echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" - dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" - dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" - dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" - - - name: Install LCOV merger - run: npm install -g lcov-result-merger - - - name: Merge LCOV reports - run: | - mkdir -p coverage - lcov-result-merger "*.info" > lcov.info - - - name: Upload merged coverage to Codacy - uses: codacy/codacy-coverage-reporter-action@v1 - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: ./lcov.info + - uses: actions/checkout@v6 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Restore Nuget Packages + run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} + + - name: Build Code + run: dotnet build FileProcessor.sln --configuration Release --no-restore + + - name: Run Unit Tests + run: | + echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" + dotnet run --project "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/businesslogic" + dotnet run --project "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileaggregate" + dotnet run --project "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileimportlogaggregate" + + - name: Merge Coverage Reports + uses: danielpalme/ReportGenerator-GitHub-Action@v5 + with: + reports: ./coverage/**/*.cobertura.xml + targetdir: ./coverage-report + reporttypes: Cobertura + + - name: Upload coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: ./coverage-report/Cobertura.xml diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml index 4dad0b9..029c05d 100644 --- a/.github/workflows/nightlybuild.yml +++ b/.github/workflows/nightlybuild.yml @@ -12,54 +12,59 @@ permissions: jobs: build: - name: "Nightly Build" + name: Nightly Build env: - ASPNETCORE_ENVIRONMENT: "Production" + ASPNETCORE_ENVIRONMENT: Production runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v6 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x - - name: Set Up Variables - run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV + - name: Set Up Variables + run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV - - name: Restore Nuget Packages - run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} + - name: Restore Nuget Packages + run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} - - name: Build Code - run: dotnet build FileProcessor.sln --configuration Release + - name: Build Code + run: dotnet build FileProcessor.sln --configuration Release --no-restore - - name: Run Unit Tests - run: | - echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" - dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" - dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" - dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov" + - name: Run Unit Tests + run: | + echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" + dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build + dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build + dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build - - name: Build Docker Image - run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest - - - name: Run Integration Tests - run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" + - name: Build Docker Image + run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest + + - name: Run Integration Tests + run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build - - uses: actions/upload-artifact@v4.4.0 - with: - name: tracelogs - path: /home/runner/trace/ + - uses: actions/upload-artifact@v4.4.0 + with: + name: tracelogs + path: /home/runner/trace/ - - name: Notify on nightly failure - if: ${{ failure() }} - uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - title: Investigate Nightly Build Failure - labels: nightlybuild - dedupe_key: nightlybuild - body: | - Repo: ${{ github.repository }} - Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - Commit: ${{ github.sha }} - Workflow: ${{ github.workflow }} - Job: ${{ github.job }} + - name: Notify on nightly failure + if: ${{ failure() }} + uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + title: Investigate Nightly Build Failure + labels: nightlybuild + dedupe_key: nightlybuild + body: | + Repo: ${{ github.repository }} + Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + Commit: ${{ github.sha }} + Workflow: ${{ github.workflow }} + Job: ${{ github.job }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index b0713f4..60c9426 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -7,57 +7,71 @@ on: jobs: build: - name: "Build and Test Pull Requests" + name: Build and Test Pull Requests env: - ASPNETCORE_ENVIRONMENT: "Production" + ASPNETCORE_ENVIRONMENT: Production runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v6 - - name: Echo vars - run: | - echo "CI is > ${CI}" - echo "HOME is > ${HOME}" + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x - - name: Restore Nuget Packages - run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} + - name: Echo vars + run: | + echo "CI is > ${CI}" + echo "HOME is > ${HOME}" - - name: Build Code - run: dotnet build FileProcessor.sln --configuration Release + - name: Restore Nuget Packages + run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} - - name: Run Unit Tests - run: | - echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" - dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=businesslogic-test-results.trx" - dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileaggregate-test-results.trx" - dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileimportlogaggregate-test-results.trx" + - name: Build Code + run: dotnet build FileProcessor.sln --configuration Release --no-restore + + - name: Run Unit Tests + run: | + echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" + dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename businesslogic-test-results.trx + dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileaggregate-test-results.trx + dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileimportlogaggregate-test-results.trx - - name: Build Docker Image - run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest - - - name: Run Integration Tests - run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx" - - - uses: actions/upload-artifact@v4.4.0 - with: - name: tracelogs - path: /home/runner/trace/ - - - name: Publish test results - uses: dorny/test-reporter@v1 - if: always() - with: + - name: Build Docker Image + run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest + + - name: Run Integration Tests + run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal -- --filter "Category=PRTest" --test-parameter "NUnit.TestOutputXml=TestResults" + + - uses: actions/upload-artifact@v4.4.0 + with: + name: tracelogs + path: /home/runner/trace/ + + - name: Publish test results + uses: dorny/test-reporter@v1 + if: always() + with: name: Unit Test Results path: '**/TestResults/*.trx' reporter: dotnet-trx fail-on-error: true - - - name: Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: + + - name: Publish integration test results + uses: dorny/test-reporter@v1 + if: always() + with: + name: Integration Test Results + path: '**/TestResults/*.xml' + reporter: nunit + fail-on-error: true + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: name: test-results - path: '**/TestResults/*.trx' - retention-days: 30 \ No newline at end of file + path: '**/TestResults/*' + retention-days: 30 diff --git a/Directory.Packages.props b/Directory.Packages.props index 6489b81..8987715 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,6 +23,7 @@ + @@ -56,7 +57,7 @@ - + diff --git a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj index 51862df..87a427c 100644 --- a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj +++ b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj @@ -2,6 +2,9 @@ net10.0 + Exe + true + true None false @@ -11,9 +14,10 @@ + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj index 64adb94..9476828 100644 --- a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj +++ b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj @@ -2,14 +2,18 @@ net10.0 + Exe + true + true None false + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj index 122f1f2..0deda4c 100644 --- a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj +++ b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj @@ -2,14 +2,18 @@ net10.0 + Exe + true + true None false + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj index 068d224..1429d19 100644 --- a/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj +++ b/FileProcessor.FileProfileAggregate.Tests/FileProcessor.FileProfileAggregate.Tests.csproj @@ -2,14 +2,18 @@ net10.0 + Exe + true + true Full false + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj b/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj index e6ce79e..1ec2b98 100644 --- a/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj +++ b/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj @@ -2,6 +2,9 @@ net10.0 + Exe + true + true false diff --git a/FileProcessor.Tests/FileProcessor.Tests.csproj b/FileProcessor.Tests/FileProcessor.Tests.csproj index 4e0e8ef..6c8e6e7 100644 --- a/FileProcessor.Tests/FileProcessor.Tests.csproj +++ b/FileProcessor.Tests/FileProcessor.Tests.csproj @@ -2,17 +2,21 @@ net10.0 + Exe + true + true None false + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/global.json b/global.json new file mode 100644 index 0000000..3140116 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} From 96ca132307b73f2b387b59331685bd8d8ab1cbe3 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 17:32:26 +0100 Subject: [PATCH 5/7] Fix NUnit report parser in PR workflow --- .github/workflows/pullrequest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 60c9426..40faafd 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -65,7 +65,7 @@ jobs: with: name: Integration Test Results path: '**/TestResults/*.xml' - reporter: nunit + reporter: dotnet-nunit fail-on-error: true - name: Upload test results From ac9400d85624eed92ff2254728e11ab4e10f6e2c Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 17:59:24 +0100 Subject: [PATCH 6/7] Fix NUnit output generation in PR workflow --- .github/workflows/pullrequest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 40faafd..0b776d2 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -43,7 +43,7 @@ jobs: run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest - name: Run Integration Tests - run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal -- --filter "Category=PRTest" --test-parameter "NUnit.TestOutputXml=TestResults" + run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --logger "nunit;LogFileName=integration-test-results.xml" -- --filter "Category=PRTest" - uses: actions/upload-artifact@v4.4.0 with: From d3d4df931376619f721445848b8347a2433f7cc1 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 18 Aug 2026 18:58:45 +0100 Subject: [PATCH 7/7] Fix integration test bootstrap --- .github/workflows/pullrequest.yml | 17 ++---- .../Common/DockerHelper.cs | 2 +- .../Common/GenericSteps.cs | 21 ++++++-- .../Steps/SharedSteps.cs | 54 ++++++++++++------- 4 files changed, 57 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 0b776d2..9ac31a4 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -38,12 +38,12 @@ jobs: dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename businesslogic-test-results.trx dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileaggregate-test-results.trx dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileimportlogaggregate-test-results.trx - + - name: Build Docker Image run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest - - - name: Run Integration Tests - run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --logger "nunit;LogFileName=integration-test-results.xml" -- --filter "Category=PRTest" + + - name: Run Integration Tests + run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal -- --filter "Category=PRTest" - uses: actions/upload-artifact@v4.4.0 with: @@ -59,15 +59,6 @@ jobs: reporter: dotnet-trx fail-on-error: true - - name: Publish integration test results - uses: dorny/test-reporter@v1 - if: always() - with: - name: Integration Test Results - path: '**/TestResults/*.xml' - reporter: dotnet-nunit - fail-on-error: true - - name: Upload test results uses: actions/upload-artifact@v4 if: always() diff --git a/FileProcessor.IntegrationTests/Common/DockerHelper.cs b/FileProcessor.IntegrationTests/Common/DockerHelper.cs index 71bf250..8896398 100644 --- a/FileProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/FileProcessor.IntegrationTests/Common/DockerHelper.cs @@ -76,7 +76,7 @@ public override ContainerBuilder SetupFileProcessorContainer() { { "AppSettings:FileProfilePollingWindowInSeconds", "5" } }; - this.AdditionalVariables.Add(ContainerType.FileProcessor, variables); + this.AdditionalVariables[ContainerType.FileProcessor] = variables; return base.SetupFileProcessorContainer(); } diff --git a/FileProcessor.IntegrationTests/Common/GenericSteps.cs b/FileProcessor.IntegrationTests/Common/GenericSteps.cs index 80d2d96..08c6427 100644 --- a/FileProcessor.IntegrationTests/Common/GenericSteps.cs +++ b/FileProcessor.IntegrationTests/Common/GenericSteps.cs @@ -36,9 +36,7 @@ public async Task StartSystem() logger.Initialise(LogManager.GetLogger(scenarioName), scenarioName); LogManager.AddHiddenAssembly(typeof(NlogLogger).Assembly); - DockerServices dockerServices = DockerServices.EventStore | DockerServices.FileProcessor | DockerServices.MessagingService | - DockerServices.SecurityService | DockerServices.SqlServer | DockerServices.TestHost | DockerServices.TransactionProcessor | - DockerServices.TestHost | DockerServices.CallbackHandler | DockerServices.TransactionProcessorAcl; + DockerServices dockerServices = this.GetDockerServicesForScenario(); this.TestingContext.DockerHelper = new DockerHelper(); this.TestingContext.DockerHelper.Logger = logger; @@ -60,6 +58,23 @@ public async Task StartSystem() this.TestingContext.Logger.LogInformation("Containers for Scenario Run Started"); } + private DockerServices GetDockerServicesForScenario() + { + String scenarioTitle = this.ScenarioContext.ScenarioInfo.Title; + + // File profile CRUD scenarios only need the API, auth service, event store, and SQL. + // The FileProcessor health check still depends on the TransactionProcessor service, but + // the rest of the transaction-processing stack is unnecessary for these scenarios. + if (scenarioTitle.Contains("file profile", StringComparison.OrdinalIgnoreCase)) + { + return DockerServices.EventStore | DockerServices.FileProcessor | DockerServices.SecurityService | + DockerServices.SqlServer | DockerServices.TransactionProcessor; + } + + return DockerServices.EventStore | DockerServices.FileProcessor | DockerServices.MessagingService | + DockerServices.SecurityService | DockerServices.SqlServer | DockerServices.TestHost | DockerServices.TransactionProcessor; + } + [AfterScenario] public async Task StopSystem(){ DockerServices shareDockerServices = DockerServices.None; diff --git a/FileProcessor.IntegrationTests/Steps/SharedSteps.cs b/FileProcessor.IntegrationTests/Steps/SharedSteps.cs index 86a06ca..2c83ebb 100644 --- a/FileProcessor.IntegrationTests/Steps/SharedSteps.cs +++ b/FileProcessor.IntegrationTests/Steps/SharedSteps.cs @@ -39,9 +39,9 @@ public class SharedSteps private readonly SecurityServiceSteps SecurityServiceSteps; - private readonly TransactionProcessorSteps TransactionProcessorSteps; + private TransactionProcessorSteps? TransactionProcessorSteps; - private readonly FileProcessorSteps FileProcessorSteps; + private FileProcessorSteps? FileProcessorSteps; public SharedSteps(ScenarioContext scenarioContext, TestingContext testingContext) @@ -49,15 +49,29 @@ public SharedSteps(ScenarioContext scenarioContext, ScenarioContext = scenarioContext; TestingContext = testingContext; this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient); - this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient,testingContext.DockerHelper.TestHostHttpClient, - testingContext.DockerHelper.ProjectionManagementClient, testingContext.DockerHelper.AgencyBankingClient); - this.FileProcessorSteps = new FileProcessorSteps(testingContext.DockerHelper.FileProcessorClient); + } + + private TransactionProcessorSteps GetTransactionProcessorSteps() + { + this.TransactionProcessorSteps ??= new TransactionProcessorSteps(this.TestingContext.DockerHelper.TransactionProcessorClient, + this.TestingContext.DockerHelper.TestHostHttpClient, + this.TestingContext.DockerHelper.ProjectionManagementClient, + this.TestingContext.DockerHelper.AgencyBankingClient); + + return this.TransactionProcessorSteps; + } + + private FileProcessorSteps GetFileProcessorSteps() + { + this.FileProcessorSteps ??= new FileProcessorSteps(this.TestingContext.DockerHelper.FileProcessorClient); + + return this.FileProcessorSteps; } [Given(@"I have a file named '(.*)' with the following contents")] public void GivenIHaveAFileNamedWithTheFollowingContents(string fileName, DataTable table){ String fileData = table.Rows.ToFileData(); - this.TestingContext.UploadFile = this.FileProcessorSteps.WriteDileToDisk(fileName, fileData); + this.TestingContext.UploadFile = this.GetFileProcessorSteps().WriteDileToDisk(fileName, fileData); } [Given(@"I upload this file for processing")] @@ -67,7 +81,7 @@ public async Task GivenIUploadThisFileForProcessing(DataTable table) Byte[] fileData = await File.ReadAllBytesAsync(filePath); (EstateDetails1, UploadFileRequest) uploadFileRequest = table.Rows.ToUploadFileRequest(this.TestingContext.Estates, fileData); - await this.FileProcessorSteps.GivenIUploadThisFileForProcessing(this.TestingContext.AccessToken, filePath, fileData, uploadFileRequest.Item1, uploadFileRequest.Item2); + await this.GetFileProcessorSteps().GivenIUploadThisFileForProcessing(this.TestingContext.AccessToken, filePath, fileData, uploadFileRequest.Item1, uploadFileRequest.Item2); } [Given(@"I upload this file for processing an error should be returned indicating the file is a duplicate")] @@ -76,12 +90,12 @@ public async Task GivenIUploadThisFileForProcessingAnErrorShouldBeReturnedIndica String filePath = TestingContext.UploadFile; Byte[] fileData = await File.ReadAllBytesAsync(filePath); (EstateDetails1, UploadFileRequest) uploadFileRequest = table.Rows.ToUploadFileRequest(this.TestingContext.Estates, fileData); - await this.FileProcessorSteps.GivenIUploadThisFileForProcessingAnErrorShouldBeReturnedIndicatingTheFileIsADuplicate(this.TestingContext.AccessToken, filePath, fileData, uploadFileRequest.Item2); + await this.GetFileProcessorSteps().GivenIUploadThisFileForProcessingAnErrorShouldBeReturnedIndicatingTheFileIsADuplicate(this.TestingContext.AccessToken, filePath, fileData, uploadFileRequest.Item2); } [When(@"I get the import log for estate '([^']*)' the date on the import log is '([^']*)'")] public async Task WhenIGetTheImportLogForEstateTheDateOnTheImportLogIs(string estateName, string expectedDateString){ - await this.FileProcessorSteps.WhenIGetTheImportLogForEstateTheDateOnTheImportLogIs(this.TestingContext.AccessToken, estateName, expectedDateString, this.TestingContext.Estates); + await this.GetFileProcessorSteps().WhenIGetTheImportLogForEstateTheDateOnTheImportLogIs(this.TestingContext.AccessToken, estateName, expectedDateString, this.TestingContext.Estates); } //[When(@"As merchant ""(.*)"" on Estate ""(.*)"" I get my transactions (.*) transaction should be returned")] @@ -115,7 +129,7 @@ public async Task WhenICreateTheFollowingEstates(DataTable table) { List requests = table.Rows.ToCreateEstateRequests(); - List verifiedEstates = await this.TransactionProcessorSteps.WhenICreateTheFollowingEstatesX(this.TestingContext.AccessToken, requests); + List verifiedEstates = await this.GetTransactionProcessorSteps().WhenICreateTheFollowingEstatesX(this.TestingContext.AccessToken, requests); foreach (EstateResponse verifiedEstate in verifiedEstates) { @@ -139,7 +153,7 @@ public async Task WhenIAssignTheFollowingOperatorToTheMerchants(DataTable table) var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, Guid, TransactionProcessor.DataTransferObjects.Requests.Merchant.AssignOperatorRequest)> requests = table.Rows.ToAssignOperatorRequests(estates); - List<(EstateDetails, TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantOperatorResponse)> results = await this.TransactionProcessorSteps.WhenIAssignTheFollowingOperatorToTheMerchants(this.TestingContext.AccessToken, requests); + List<(EstateDetails, TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantOperatorResponse)> results = await this.GetTransactionProcessorSteps().WhenIAssignTheFollowingOperatorToTheMerchants(this.TestingContext.AccessToken, requests); foreach ((EstateDetails, MerchantOperatorResponse) result in results) { @@ -154,7 +168,7 @@ public async Task WhenICreateTheFollowingOperators(DataTable table) var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails estate, CreateOperatorRequest request)> requests = table.Rows.ToCreateOperatorRequests(estates); - List<(Guid, EstateOperatorResponse)> results = await this.TransactionProcessorSteps.WhenICreateTheFollowingOperators(this.TestingContext.AccessToken, requests); + List<(Guid, EstateOperatorResponse)> results = await this.GetTransactionProcessorSteps().WhenICreateTheFollowingOperators(this.TestingContext.AccessToken, requests); foreach ((Guid, EstateOperatorResponse) result in results) { @@ -167,7 +181,7 @@ public async Task GivenIHaveAssignedTheFollowingOperatorsToTheEstates(DataTable { List<(EstateDetails estate, AssignOperatorRequest request)> requests = dataTable.Rows.ToAssignOperatorToEstateRequests(this.TestingContext.Estates.Select(s => s.EstateDetails).ToList()); - await this.TransactionProcessorSteps.GivenIHaveAssignedTheFollowingOperatorsToTheEstates(this.TestingContext.AccessToken, requests); + await this.GetTransactionProcessorSteps().GivenIHaveAssignedTheFollowingOperatorsToTheEstates(this.TestingContext.AccessToken, requests); // TODO Verify } @@ -179,7 +193,7 @@ public async Task WhenICreateTheFollowingMerchants(DataTable table) var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); var requests = table.Rows.ToCreateMerchantRequests(estates); - List verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); + List verifiedMerchants = await this.GetTransactionProcessorSteps().WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); foreach (TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantResponse verifiedMerchant in verifiedMerchants) { @@ -194,7 +208,7 @@ public async Task GivenICreateAContractWithTheFollowingValues(DataTable table) { var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, CreateContractRequest)> requests = table.Rows.ToCreateContractRequests(estates); - List responses = await this.TransactionProcessorSteps.GivenICreateAContractWithTheFollowingValues(this.TestingContext.AccessToken, requests); + List responses = await this.GetTransactionProcessorSteps().GivenICreateAContractWithTheFollowingValues(this.TestingContext.AccessToken, requests); foreach (ContractResponse contractResponse in responses) { EstateDetails1 estate = this.TestingContext.Estates.Single(e => e.EstateDetails.EstateId == contractResponse.EstateId); @@ -208,7 +222,7 @@ public async Task WhenICreateTheFollowingProducts(DataTable table) var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, TransactionProcessor.IntegrationTesting.Helpers.Contract, AddProductToContractRequest)> requests = table.Rows.ToAddProductToContractRequest(estates); - await this.TransactionProcessorSteps.WhenICreateTheFollowingProducts(this.TestingContext.AccessToken, requests); + await this.GetTransactionProcessorSteps().WhenICreateTheFollowingProducts(this.TestingContext.AccessToken, requests); } [When(@"I add the following Transaction Fees")] @@ -216,7 +230,7 @@ public async Task WhenIAddTheFollowingTransactionFees(DataTable table) { var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, TransactionProcessor.IntegrationTesting.Helpers.Contract, TransactionProcessor.IntegrationTesting.Helpers.Product, AddTransactionFeeForProductToContractRequest)> requests = table.Rows.ToAddTransactionFeeForProductToContractRequests(estates); - await this.TransactionProcessorSteps.WhenIAddTheFollowingTransactionFees(this.TestingContext.AccessToken, requests); + await this.GetTransactionProcessorSteps().WhenIAddTheFollowingTransactionFees(this.TestingContext.AccessToken, requests); } [Given(@"the following api resources exist")] @@ -253,7 +267,7 @@ public async Task GivenIHaveAssignedTheFollowingDevicesToTheMerchants(DataTable List estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, Guid, AddMerchantDeviceRequest)> requests = table.Rows.ToAddMerchantDeviceRequests(estates); - List<(EstateDetails, TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantResponse, String)> results = await this.TransactionProcessorSteps.GivenIHaveAssignedTheFollowingDevicesToTheMerchants(this.TestingContext.AccessToken, requests); + List<(EstateDetails, TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantResponse, String)> results = await this.GetTransactionProcessorSteps().GivenIHaveAssignedTheFollowingDevicesToTheMerchants(this.TestingContext.AccessToken, requests); foreach ((EstateDetails, MerchantResponse, String) result in results) { this.TestingContext.Logger.LogInformation($"Device {result.Item3} assigned to Merchant {result.Item2.MerchantName} Estate {result.Item1.EstateName}"); @@ -265,7 +279,7 @@ public async Task WhenIAddTheFollowingContractsToTheFollowingMerchants(DataTable { List estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails, Guid, Guid)> requests = table.Rows.ToAddContractToMerchantRequests(estates); - await this.TransactionProcessorSteps.WhenIAddTheFollowingContractsToTheFollowingMerchants(this.TestingContext.AccessToken, requests); + await this.GetTransactionProcessorSteps().WhenIAddTheFollowingContractsToTheFollowingMerchants(this.TestingContext.AccessToken, requests); } private async Task GetMerchantBalance(Guid merchantId) @@ -283,7 +297,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(DataTable table) foreach ((EstateDetails, Guid, MakeMerchantDepositRequest) request in requests){ Decimal previousMerchantBalance = await this.GetMerchantBalance(request.Item2); - await this.TransactionProcessorSteps.GivenIMakeTheFollowingManualMerchantDeposits(this.TestingContext.AccessToken, request); + await this.GetTransactionProcessorSteps().GivenIMakeTheFollowingManualMerchantDeposits(this.TestingContext.AccessToken, request); await Retry.For(async () => { Decimal currentMerchantBalance = await this.GetMerchantBalance(request.Item2);