From 73e5e9b81f6e3b37b524290394b43914d599dfd1 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Mon, 17 Aug 2026 18:40:58 +0100 Subject: [PATCH 1/3] nuget updates --- .../Common/DockerHelper.cs | 17 ++++++- .../Shared/SharedSteps.cs | 4 +- Directory.Packages.props | 48 +++++++++---------- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/CallbackHandler.IntegrationTests/Common/DockerHelper.cs b/CallbackHandler.IntegrationTests/Common/DockerHelper.cs index 9cbd432..d25c904 100644 --- a/CallbackHandler.IntegrationTests/Common/DockerHelper.cs +++ b/CallbackHandler.IntegrationTests/Common/DockerHelper.cs @@ -2,6 +2,7 @@ using SecurityService.Client; using Shared.IntegrationTesting; using Shared.Serialisation; +using TestHosts.Clients; using TransactionProcessor.Client; namespace CallbackHandler.IntegrationTests.Common; @@ -15,6 +16,9 @@ public DockerHelper() { public ISecurityServiceClient SecurityServiceClient; public ITransactionProcessorClient TransactionProcessorClient; public EventStoreProjectionManagementClient ProjectionManagementClient; + + public IAgencyBankingClient AgencyBankingClient; + public HttpClient TestHostHttpClient; public override async Task CreateSubscriptions() { @@ -53,7 +57,7 @@ public override async Task StartContainersForScenarioRun(String scenarioName, // Setup the base address resolvers String SecurityServiceBaseAddressResolver(String api) => $"https://127.0.0.1:{this.SecurityServicePort}"; 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, @@ -70,6 +74,7 @@ public override async Task StartContainersForScenarioRun(String scenarioName, this.ProjectionManagementClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings()); 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); } String Serialise(Object arg) @@ -81,4 +86,14 @@ 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)); + } } \ No newline at end of file diff --git a/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs b/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs index 840c2e6..e78c7c0 100644 --- a/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs +++ b/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs @@ -37,7 +37,7 @@ public SharedSteps(ScenarioContext scenarioContext, this.TestingContext = testingContext; this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient); this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient, testingContext.DockerHelper.TestHostHttpClient, - testingContext.DockerHelper.ProjectionManagementClient); + testingContext.DockerHelper.ProjectionManagementClient, testingContext.DockerHelper.AgencyBankingClient); } @@ -166,7 +166,7 @@ public async Task WhenICreateTheFollowingEstates(DataTable table) [When(@"I create the following merchants")] public async Task WhenICreateTheFollowingMerchants(DataTable table) { - List<(EstateDetails estate, CreateMerchantRequest)> requests = table.Rows.ToCreateMerchantRequests(this.TestingContext.Estates); + List<(EstateDetails estate, CreateMerchantRequest, Boolean EnableAgencyBanking)> requests = table.Rows.ToCreateMerchantRequests(this.TestingContext.Estates); List verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); diff --git a/Directory.Packages.props b/Directory.Packages.props index 167083e..f90e1f8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,12 +5,12 @@ - - - + + + - - + + @@ -19,29 +19,29 @@ - - - - - - - - - + + + + + + + + + - + - - + + - - + + - - - - + + + + - + \ No newline at end of file From a171005488d09aac48118b8bf2ce3dc40459de5d Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Mon, 17 Aug 2026 18:56:27 +0100 Subject: [PATCH 2/3] Fix MTP test reporting --- .github/workflows/pullrequest.yml | 25 ++++++++++++++++--- .../CallbackHander.Testing.csproj | 2 +- ...CallbackHandler.BusinessLogic.Tests.csproj | 4 ++- ...dler.CallbackMessageAggregate.Tests.csproj | 4 ++- .../CallbackHandler.IntegrationTests.csproj | 2 ++ .../Integration.runsettings | 6 +++++ .../CallbackHandler.Tests.csproj | 4 ++- Directory.Build.props | 5 ++++ Directory.Packages.props | 6 ++--- global.json | 5 ++++ 10 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 CallbackHandler.IntegrationTests/Integration.runsettings create mode 100644 Directory.Build.props create mode 100644 global.json diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index edf117f..1a29f23 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -25,15 +25,15 @@ jobs: - name: Run Unit Tests run: | echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" - dotnet test "CallbackHandler.BusinessLogic.Tests\CallbackHandler.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=businesslogic-test-results.trx" - dotnet test "CallbackHandler.CallbackMessageAggregate.Tests\CallbackHandler.CallbackMessageAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=callbackmessageaggregate-test-results.trx" - dotnet test "CallbackHandler.Tests\CallbackHandler.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=callbackhandler-test-results.trx" + dotnet test "CallbackHandler.BusinessLogic.Tests\CallbackHandler.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx + dotnet test "CallbackHandler.CallbackMessageAggregate.Tests\CallbackHandler.CallbackMessageAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx + dotnet test "CallbackHandler.Tests\CallbackHandler.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx - name: Build Docker Image run: docker build . --file CallbackHandler/Dockerfile --tag callbackhandler:latest - name: Run Integration Tests - run: dotnet test "CallbackHandler.IntegrationTests\CallbackHandler.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx" + run: dotnet test "CallbackHandler.IntegrationTests\CallbackHandler.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "CallbackHandler.IntegrationTests/Integration.runsettings" - uses: actions/upload-artifact@v4.4.0 with: @@ -57,3 +57,20 @@ jobs: path: '**/TestResults/*.trx' retention-days: 30 + - name: Publish integration test results + uses: dorny/test-reporter@v1 + if: always() + with: + name: Integration Test Results + path: 'TestResults/CallbackHandler.IntegrationTests.xml' + reporter: dotnet-nunit + fail-on-error: true + + - name: Upload integration test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: integration-test-results + path: 'TestResults/CallbackHandler.IntegrationTests.xml' + retention-days: 30 + diff --git a/CallbackHander.Testing/CallbackHander.Testing.csproj b/CallbackHander.Testing/CallbackHander.Testing.csproj index ddf37cb..87c2d1d 100644 --- a/CallbackHander.Testing/CallbackHander.Testing.csproj +++ b/CallbackHander.Testing/CallbackHander.Testing.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj b/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj index ca9b30b..d8f459e 100644 --- a/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj +++ b/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj @@ -3,6 +3,8 @@ net10.0 None + Exe + true false @@ -11,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj b/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj index 418030a..273d1de 100644 --- a/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj +++ b/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj @@ -3,6 +3,8 @@ net10.0 None + Exe + true false @@ -10,7 +12,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj b/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj index d259970..dad7fb3 100644 --- a/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj +++ b/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj @@ -4,6 +4,8 @@ net10.0 enable enable + true + Exe false diff --git a/CallbackHandler.IntegrationTests/Integration.runsettings b/CallbackHandler.IntegrationTests/Integration.runsettings new file mode 100644 index 0000000..3cc0787 --- /dev/null +++ b/CallbackHandler.IntegrationTests/Integration.runsettings @@ -0,0 +1,6 @@ + + + TestResults + UseResultDirectory + + diff --git a/CallbackHandler.Tests/CallbackHandler.Tests.csproj b/CallbackHandler.Tests/CallbackHandler.Tests.csproj index c36ee0a..7171196 100644 --- a/CallbackHandler.Tests/CallbackHandler.Tests.csproj +++ b/CallbackHandler.Tests/CallbackHandler.Tests.csproj @@ -2,6 +2,8 @@ net10.0 + Exe + true false @@ -12,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..dc58e4e --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + true + + diff --git a/Directory.Packages.props b/Directory.Packages.props index f90e1f8..662ba0e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ - + @@ -42,6 +42,6 @@ - + - \ No newline at end of file + 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 89172d872fc64b4a781107bd15cc8e3c2595665b Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Mon, 17 Aug 2026 19:00:58 +0100 Subject: [PATCH 3/3] Fix Linux test paths in CI workflow --- .github/workflows/pullrequest.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 1a29f23..9c646e4 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -25,15 +25,15 @@ jobs: - name: Run Unit Tests run: | echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" - dotnet test "CallbackHandler.BusinessLogic.Tests\CallbackHandler.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx - dotnet test "CallbackHandler.CallbackMessageAggregate.Tests\CallbackHandler.CallbackMessageAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx - dotnet test "CallbackHandler.Tests\CallbackHandler.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx + dotnet test "CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx + dotnet test "CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx + dotnet test "CallbackHandler.Tests/CallbackHandler.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx - name: Build Docker Image run: docker build . --file CallbackHandler/Dockerfile --tag callbackhandler:latest - name: Run Integration Tests - run: dotnet test "CallbackHandler.IntegrationTests\CallbackHandler.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "CallbackHandler.IntegrationTests/Integration.runsettings" + run: dotnet test "CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "CallbackHandler.IntegrationTests/Integration.runsettings" - uses: actions/upload-artifact@v4.4.0 with: