From f825ae0792658300d1a3bb333f023cb06f4b1b37 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:53:57 +0000 Subject: [PATCH 01/11] Add Aspire AppHost project to Chapter 2 Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- .../Src/Directory.Packages.props | 3 +++ .../Src/Fitnet.AppHost/Fitnet.AppHost.csproj | 23 +++++++++++++++++++ .../Src/Fitnet.AppHost/Program.cs | 17 ++++++++++++++ .../Properties/launchSettings.json | 17 ++++++++++++++ .../Src/Fitnet.AppHost/appsettings.json | 9 ++++++++ Chapter-2-modules-separation/Src/Fitnet.slnx | 1 + 6 files changed, 70 insertions(+) create mode 100644 Chapter-2-modules-separation/Src/Fitnet.AppHost/Fitnet.AppHost.csproj create mode 100644 Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs create mode 100644 Chapter-2-modules-separation/Src/Fitnet.AppHost/Properties/launchSettings.json create mode 100644 Chapter-2-modules-separation/Src/Fitnet.AppHost/appsettings.json diff --git a/Chapter-2-modules-separation/Src/Directory.Packages.props b/Chapter-2-modules-separation/Src/Directory.Packages.props index 6f76a4a9..ed74deb1 100644 --- a/Chapter-2-modules-separation/Src/Directory.Packages.props +++ b/Chapter-2-modules-separation/Src/Directory.Packages.props @@ -3,10 +3,13 @@ true + + + diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Fitnet.AppHost.csproj b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Fitnet.AppHost.csproj new file mode 100644 index 00000000..80427197 --- /dev/null +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Fitnet.AppHost.csproj @@ -0,0 +1,23 @@ + + + + + Exe + enable + enable + true + a3ef42d8-8e72-4dd1-a8a7-cd43e2c575e8 + + + + + + + + + + + + + + diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs new file mode 100644 index 00000000..55fd18d3 --- /dev/null +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs @@ -0,0 +1,17 @@ +using Projects; + +var builder = DistributedApplication.CreateBuilder(args); +var postgres = builder.AddPostgres("postgres") + .WithImage("postgres", "14.3") + .WithPgAdmin(); + +var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet"); +builder.AddProject("fitnet") + .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") + .WithReference(fitnetDatabase, "Passes__ConnectionStrings") + .WithReference(fitnetDatabase, "Contracts__ConnectionStrings") + .WithReference(fitnetDatabase, "Reports__ConnectionStrings") + .WithReference(fitnetDatabase, "Offers__ConnectionStrings") + .WaitFor(postgres); + +await builder.Build().RunAsync(); diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Properties/launchSettings.json b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Properties/launchSettings.json new file mode 100644 index 00000000..7fad3943 --- /dev/null +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Properties/launchSettings.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:17106;http://localhost:15108", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21130", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22190" + } + } + } +} diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/appsettings.json b/Chapter-2-modules-separation/Src/Fitnet.AppHost/appsettings.json new file mode 100644 index 00000000..31c092aa --- /dev/null +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.Dcp": "Warning" + } + } +} diff --git a/Chapter-2-modules-separation/Src/Fitnet.slnx b/Chapter-2-modules-separation/Src/Fitnet.slnx index d152a3c9..322b8d88 100644 --- a/Chapter-2-modules-separation/Src/Fitnet.slnx +++ b/Chapter-2-modules-separation/Src/Fitnet.slnx @@ -42,5 +42,6 @@ + \ No newline at end of file From 0cd5f0a3a4b21ed21eeeaa29093d28e8fdd7db93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:54:48 +0000 Subject: [PATCH 02/11] Remove Docker Compose and related files Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- Chapter-2-modules-separation/Src/Dockerfile | 21 ------------- .../Src/Fitnet/.dockerignore | 25 ---------------- .../Src/docker-compose.yml | 30 ------------------- 3 files changed, 76 deletions(-) delete mode 100644 Chapter-2-modules-separation/Src/Dockerfile delete mode 100644 Chapter-2-modules-separation/Src/Fitnet/.dockerignore delete mode 100644 Chapter-2-modules-separation/Src/docker-compose.yml diff --git a/Chapter-2-modules-separation/Src/Dockerfile b/Chapter-2-modules-separation/Src/Dockerfile deleted file mode 100644 index c7eab40d..00000000 --- a/Chapter-2-modules-separation/Src/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build -WORKDIR /src -COPY Directory.Build.props ./ -COPY ["Fitnet/Fitnet.csproj", "Fitnet/"] -RUN dotnet restore "Fitnet/Fitnet.csproj" -COPY . . -WORKDIR "/src/Fitnet" -RUN dotnet build "Fitnet.csproj" -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish "Fitnet.csproj" -c Release -o /app/publish - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "EvolutionaryArchitecture.Fitnet.dll"] \ No newline at end of file diff --git a/Chapter-2-modules-separation/Src/Fitnet/.dockerignore b/Chapter-2-modules-separation/Src/Fitnet/.dockerignore deleted file mode 100644 index cd967fc3..00000000 --- a/Chapter-2-modules-separation/Src/Fitnet/.dockerignore +++ /dev/null @@ -1,25 +0,0 @@ -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/.idea -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/azds.yaml -**/bin -**/charts -**/docker-compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md \ No newline at end of file diff --git a/Chapter-2-modules-separation/Src/docker-compose.yml b/Chapter-2-modules-separation/Src/docker-compose.yml deleted file mode 100644 index 170f04ef..00000000 --- a/Chapter-2-modules-separation/Src/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: '3.9' - -services: - fitnet: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://+:80 - - Passes__ConnectionStrings__Primary=Host=postgres;Database=fitnet;Username=postgres;Password=mysecretpassword - - Contracts__ConnectionStrings__Primary=Host=postgres;Database=fitnet;Username=postgres;Password=mysecretpassword - - Reports__ConnectionStrings__Primary=Host=postgres;Database=fitnet;Username=postgres;Password=mysecretpassword - - Offers__ConnectionStrings__Primary=Host=postgres;Database=fitnet;Username=postgres;Password=mysecretpassword - build: . - ports: - - "8080:80" - depends_on: - postgres: - condition: service_healthy - - postgres: - image: postgres:14.3 - container_name: postgres - ports: - - 5432:5432 - environment: - - POSTGRES_PASSWORD=mysecretpassword - healthcheck: - test: [ "CMD-SHELL", "pg_isready -U postgres" ] - interval: 10s - timeout: 5s - retries: 5 From b6cf73841fede7ee8ed9c9c78f5c85a4da52cfa5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 18:02:14 +0000 Subject: [PATCH 03/11] Update README to reflect Aspire usage instead of Docker Compose Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- Chapter-2-modules-separation/README.adoc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Chapter-2-modules-separation/README.adoc b/Chapter-2-modules-separation/README.adoc index da2abe6e..c40a9278 100644 --- a/Chapter-2-modules-separation/README.adoc +++ b/Chapter-2-modules-separation/README.adoc @@ -138,17 +138,16 @@ to download it from the official Microsoft website. === Run locally -The Fitnet application requires Docker to run properly. +The Fitnet application uses .NET Aspire for orchestration. -There are only 3 steps you need to start the application: +There are only 2 steps you need to start the application: 1. Make sure that you are in `/Src` directory. -2. Run `docker-compose build` to build the image of the application. -3. Run `docker-compose up` to start the application. In the meantime it will also start Postgres inside container. +2. Run `dotnet run --project Fitnet.AppHost` to start the application. This will automatically start PostgreSQL container and the Fitnet application, providing an observability dashboard. -The application runs on port `:8080`. Please navigate to http://localhost:8080 in your browser or http://localhost:8080/swagger/index.html to explore the API. +The application runs on a dynamically assigned port. Check the Aspire dashboard (which will open automatically in your browser) to see the application URL and access the Swagger UI. -That's it! You should now be able to run the application using either one of the above. :thumbsup: +That's it! You should now be able to run the application. The Aspire dashboard provides real-time monitoring and links to all services. :thumbsup: === How to run Integration Tests? To run the integration tests go to a module integration tests (`SelectedModule.IntegrationTests`) and run using either the command: From 36a5ae9dfe5aa848eab7a0e53231d87c2a9de483 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:41:57 +0000 Subject: [PATCH 04/11] Update documentation to match Chapter 1 format Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- Chapter-2-modules-separation/README.adoc | 27 +++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Chapter-2-modules-separation/README.adoc b/Chapter-2-modules-separation/README.adoc index c40a9278..daa15cfa 100644 --- a/Chapter-2-modules-separation/README.adoc +++ b/Chapter-2-modules-separation/README.adoc @@ -138,24 +138,21 @@ to download it from the official Microsoft website. === Run locally -The Fitnet application uses .NET Aspire for orchestration. +The Fitnet application uses .NET Aspire for local development. -There are only 2 steps you need to start the application: +To run the application locally, follow these steps: -1. Make sure that you are in `/Src` directory. -2. Run `dotnet run --project Fitnet.AppHost` to start the application. This will automatically start PostgreSQL container and the Fitnet application, providing an observability dashboard. +1. **Ensure Docker is running** on your machine. +2. **Navigate to the solution root directory** in your terminal. +3. **Run the AppHost project using the following command:** -The application runs on a dynamically assigned port. Check the Aspire dashboard (which will open automatically in your browser) to see the application URL and access the Swagger UI. +=== How to run Integration Tests? +To run the integration tests for the project located in the `Fitnet.IntegrationTests` project, you can use either the command: -That's it! You should now be able to run the application. The Aspire dashboard provides real-time monitoring and links to all services. :thumbsup: +`dotnet test` + +or the `IDE test explorer`. + +These tests are written using `xUnit` and require `Docker` to be running as they use `test containers` package to run PostgresSQL in a Docker container during testing. -=== How to run Integration Tests? -To run the integration tests go to a module integration tests (`SelectedModule.IntegrationTests`) and run using either the command: -[source,shell] ----- -dotnet test ----- -or the `IDE test Explorer`. - -These tests are written using `xUnit` and require `Docker` to be running as they use `test containers` package to run PostgresSQL in a Docker container during testing. Therefore, make sure to have `Docker` running before executing the integration tests. From cbc29feaaae7b369e92b214c11952e1bfa47b42d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:48:00 +0000 Subject: [PATCH 05/11] Fix formatting errors in migration files Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- .../Migrations/20230601184153_MakeSignedAtColumnNullable.cs | 2 +- .../Database/Migrations/20230601184328_AddCustomerIdColumn.cs | 2 +- ...0624171216_ContractsAddColumnsToSupportContractExpiration.cs | 2 +- .../Database/Migrations/20230503180337_CreateOfferTable.cs | 2 +- .../Database/Migrations/20230503180338_CreatePassesTable.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs index 8b35b64c..571ebd8b 100644 --- a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs +++ b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs @@ -1,7 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; -using System; + using Microsoft.EntityFrameworkCore.Migrations; [ExcludeFromCodeCoverage] diff --git a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs index cf6a802e..97062368 100644 --- a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs +++ b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs @@ -1,7 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; -using System; + using Microsoft.EntityFrameworkCore.Migrations; [ExcludeFromCodeCoverage] diff --git a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs index 30e31b28..6b90e659 100644 --- a/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs +++ b/Chapter-2-modules-separation/Src/Contracts/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs @@ -1,7 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; -using System; + using Microsoft.EntityFrameworkCore.Migrations; [ExcludeFromCodeCoverage] diff --git a/Chapter-2-modules-separation/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOfferTable.cs b/Chapter-2-modules-separation/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOfferTable.cs index d295823d..73e7f712 100644 --- a/Chapter-2-modules-separation/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOfferTable.cs +++ b/Chapter-2-modules-separation/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOfferTable.cs @@ -1,7 +1,7 @@ #nullable disable namespace SuperSimpleArchitecture.Fitnet.Migrations.OffersPersistenceMigrations; -using System; + using System.Diagnostics.CodeAnalysis; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-2-modules-separation/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs b/Chapter-2-modules-separation/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs index 2f854018..2facfb9a 100644 --- a/Chapter-2-modules-separation/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs +++ b/Chapter-2-modules-separation/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs @@ -1,7 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Passes.DataAccess.Database; -using System; + using Microsoft.EntityFrameworkCore.Migrations; [ExcludeFromCodeCoverage] From 26df9bc19bad585ce28d0097add5a72ec49b67de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:46:32 +0000 Subject: [PATCH 06/11] Initial plan From 0885d938fb5fd92bef2ce70726c079f311b5179b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 07:37:02 +0000 Subject: [PATCH 07/11] Fix connection string path for Aspire in Chapter 2 Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com> --- .../Src/Fitnet.AppHost/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs index 55fd18d3..e0aa2863 100644 --- a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs @@ -8,10 +8,10 @@ var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet"); builder.AddProject("fitnet") .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") - .WithReference(fitnetDatabase, "Passes__ConnectionStrings") - .WithReference(fitnetDatabase, "Contracts__ConnectionStrings") - .WithReference(fitnetDatabase, "Reports__ConnectionStrings") - .WithReference(fitnetDatabase, "Offers__ConnectionStrings") + .WithReference(fitnetDatabase, "Modules__Passes__ConnectionStrings__Primary") + .WithReference(fitnetDatabase, "Modules__Contracts__ConnectionStrings__Primary") + .WithReference(fitnetDatabase, "Modules__Reports__ConnectionStrings__Primary") + .WithReference(fitnetDatabase, "Modules__Offers__ConnectionStrings__Primary") .WaitFor(postgres); await builder.Build().RunAsync(); From 719b7ad186b3b8bc7fa61cb8d6b1e7be567576a5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:46:32 +0000 Subject: [PATCH 08/11] Initial plan From 93e960ea3e1444f5dcd8aaa513d2e7e1ad1b9d6f Mon Sep 17 00:00:00 2001 From: kamilbaczek Date: Mon, 15 Dec 2025 20:56:50 +0100 Subject: [PATCH 09/11] fix: fixed connection strings --- .../Fitnet.UnitTests/GlobalExceptionHandlerTests.cs | 1 + .../Src/Fitnet.AppHost/Program.cs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Chapter-1-initial-architecture/Src/Fitnet.UnitTests/GlobalExceptionHandlerTests.cs b/Chapter-1-initial-architecture/Src/Fitnet.UnitTests/GlobalExceptionHandlerTests.cs index 1b9bc546..22f0c1b0 100644 --- a/Chapter-1-initial-architecture/Src/Fitnet.UnitTests/GlobalExceptionHandlerTests.cs +++ b/Chapter-1-initial-architecture/Src/Fitnet.UnitTests/GlobalExceptionHandlerTests.cs @@ -61,6 +61,7 @@ private async Task GetExceptionResponseMessage() using var streamReader = new StreamReader(_context.Response.Body); var responseBody = await streamReader.ReadToEndAsync(); var problemDetails = JsonConvert.DeserializeObject(responseBody); + return problemDetails!; } } diff --git a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs index e0aa2863..c616513b 100644 --- a/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs +++ b/Chapter-2-modules-separation/Src/Fitnet.AppHost/Program.cs @@ -4,14 +4,14 @@ var postgres = builder.AddPostgres("postgres") .WithImage("postgres", "14.3") .WithPgAdmin(); +var db = postgres.AddDatabase("fitnetsdb", "fitnet"); -var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet"); builder.AddProject("fitnet") .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") - .WithReference(fitnetDatabase, "Modules__Passes__ConnectionStrings__Primary") - .WithReference(fitnetDatabase, "Modules__Contracts__ConnectionStrings__Primary") - .WithReference(fitnetDatabase, "Modules__Reports__ConnectionStrings__Primary") - .WithReference(fitnetDatabase, "Modules__Offers__ConnectionStrings__Primary") + .WithEnvironment("Passes__ConnectionStrings__Primary", db) + .WithEnvironment("Contracts__ConnectionStrings__Primary", db) + .WithEnvironment("Reports__ConnectionStrings__Primary", db) + .WithEnvironment("Offers__ConnectionStrings__Primary", db) .WaitFor(postgres); await builder.Build().RunAsync(); From d25b2a9d615e2870b78617c47e3b5a3b8544184e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20B=C4=85czek?= <74410956+kamilbaczek@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:01:50 +0100 Subject: [PATCH 10/11] test(report): enhance report verification with parameterized data (#233) --- ...assRegistrationDateRanges=13.verified.txt} | 0 .../GenerateNewPassesPerMonthReportTests.cs | 19 +++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) rename Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/{GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data.verified.txt => GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data_passRegistrationDateRanges=13.verified.txt} (100%) diff --git a/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data.verified.txt b/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data_passRegistrationDateRanges=13.verified.txt similarity index 100% rename from Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data.verified.txt rename to Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.Given_valid_generate_new_report_request_Then_should_return_correct_data_passRegistrationDateRanges=13.verified.txt diff --git a/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs b/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs index f714e98c..6c118c77 100644 --- a/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs +++ b/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Reports/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs @@ -1,6 +1,5 @@ namespace EvolutionaryArchitecture.Fitnet.IntegrationTests.Reports.GenerateNewPassesPerMonthReport; -using System; using Common.TestEngine.Configuration; using Common.TestEngine.IntegrationEvents.Handlers; using Common.TestEngine.Time; @@ -25,6 +24,14 @@ public GenerateNewPassesPerMonthReportTests(WebApplicationFactory appli _applicationHttpClient = _applicationInMemoryFactory.CreateClient(); } + public ValueTask InitializeAsync() => ValueTask.CompletedTask; + + public async ValueTask DisposeAsync() + { + _applicationHttpClient.Dispose(); + await _applicationInMemoryFactory.DisposeAsync(); + } + [Theory] [ClassData(typeof(ReportTestCases))] internal async Task Given_valid_generate_new_report_request_Then_should_return_correct_data( @@ -39,7 +46,7 @@ internal async Task Given_valid_generate_new_report_request_Then_should_return_c // Assert getReportResult.StatusCode.ShouldBe(HttpStatusCode.OK); var reportData = await getReportResult.Content.ReadFromJsonAsync(TestContext.Current.CancellationToken); - await Verify(reportData); + await Verify(reportData).UseParameters(passRegistrationDateRanges.Count); } private async Task RegisterPasses(List reportTestData) @@ -58,12 +65,4 @@ private async Task RegisterPass(DateTimeOffset from, DateTimeOffset to) var @event = ContractSignedEventFaker.Create(from, to); await integrationEventHandler.Handle(@event, CancellationToken.None); } - - public ValueTask InitializeAsync() => ValueTask.CompletedTask; - - public async ValueTask DisposeAsync() - { - _applicationHttpClient.Dispose(); - await _applicationInMemoryFactory.DisposeAsync(); - } } From f3962d518e0c91bf444fa13e238b8be7a47d7a84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:46:32 +0000 Subject: [PATCH 11/11] Initial plan