From fda294875aa041c02ec37767b113e3317ba264e1 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Fri, 17 Jul 2026 12:49:04 +0200 Subject: [PATCH 01/13] feat: update dotnet to `v10.0` - set language version to `default` --- Dockerfile | 4 ++-- README.md | 2 +- .../Dataport.Terminfinder.BusinessLayer.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.BusinessLayer.csproj | 4 ++-- .../Dataport.Terminfinder.BusinessObject.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.BusinessObject.csproj | 4 ++-- .../Dataport.Terminfinder.Common.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.Common.csproj | 4 ++-- ...Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.DeleteAppointments.Tool.csproj | 4 ++-- .../Dataport.Terminfinder.Repository.Migrate.csproj | 2 +- .../Dataport.Terminfinder.Repository.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.Repository.csproj | 4 ++-- .../Dataport.Terminfinder.WebAPI.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.WebAPI.csproj | 4 ++-- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14a8e1c..ed29c87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG MCR_REGISTRY=mcr.microsoft.com -FROM ${MCR_REGISTRY}/dotnet/sdk:8.0 AS build +FROM ${MCR_REGISTRY}/dotnet/sdk:10.0 AS build WORKDIR /app COPY src ./ @@ -16,7 +16,7 @@ RUN groupadd --gid "${GROUP_ID}" "${USERNAME}" && \ RUN dotnet publish -o publish -c Debug #RUN dotnet publish "Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj" -c Release -o /app/publish /p:UseAppHost=false -FROM ${MCR_REGISTRY}/dotnet/aspnet:8.0 +FROM ${MCR_REGISTRY}/dotnet/aspnet:10.0 WORKDIR /app #EXPOSE 80 diff --git a/README.md b/README.md index 24b4c93..898520e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Copyright © 2022-2024 Dataport AöR * PostgreSql Database ## Requirements -* Microsoft dotnet 8, [ASP.NET Core Runtime 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) +* Microsoft dotnet 10, [ASP.NET Core Runtime 10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) * Database [PostgreSQL](https://www.postgresql.org/) ## Database diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj index ee5b4c5..ca0e9c3 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj @@ -1,12 +1,12 @@  - net8.0 + net10.0 enable false Portable {8E57A52E-327B-45F6-A19E-97FF379586D5} - 12 + default diff --git a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj index 8aca638..8268715 100644 --- a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj @@ -1,13 +1,13 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.BusinessLayer Dataport.Terminfinder.BusinessLayer Portable {B8152437-534A-4732-81C0-AEEF53A79D69} - 12 + default diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj index cb751d6..64545e3 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj @@ -1,12 +1,12 @@  - net8.0 + net10.0 enable false Portable {D8A42831-89E7-4D75-B9A6-9C949A84C46D} - 12 + default diff --git a/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj b/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj index 4f0b833..a8434d7 100644 --- a/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj +++ b/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj @@ -1,13 +1,13 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.BusinessObject Dataport.Terminfinder.BusinessObject Portable {EF3E18F3-A3ED-48F2-B006-2D24FB2C7C14} - 12 + default diff --git a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj index 3f4631b..abd8d6e 100644 --- a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj +++ b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj @@ -1,12 +1,12 @@  - net8.0 + net10.0 enable false Portable {D5D97A5B-B33E-4ED9-BF4E-549C3A265978} - 12 + default diff --git a/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj b/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj index 2f3466c..24986e8 100644 --- a/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj +++ b/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj @@ -1,13 +1,13 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.Common Dataport.Terminfinder.Common Portable {5CF17597-DF2A-4FD2-A725-33E7E41B0A86} - 12 + default diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj index e3ac25a..0630261 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj @@ -1,13 +1,13 @@  - net8.0 + net10.0 enable false Portable Dataport.Terminfinder.Console.DeleteAppointments.Tool.Tests {7CBEE738-07EE-4592-84DB-192E30AE7B31} - 12 + default diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj index 89e67c0..4c8eb33 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.DeleteAppointments Dataport.Terminfinder.Console.DeleteAppointments.Tool.Program @@ -12,7 +12,7 @@ Exe true {572E043B-91FA-48E0-AC5F-5A73945E953F} - 12 + default diff --git a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj index 31eebdb..b1322e3 100644 --- a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj +++ b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable Linux diff --git a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj index 0d64132..802f445 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj +++ b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj @@ -1,12 +1,12 @@  - net8.0 + net10.0 enable false Portable {20BB21C0-FC32-47B8-8668-CBA6064AB4B8} - 12 + default diff --git a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj index b07b8a3..7c05b8e 100644 --- a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj +++ b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj @@ -1,13 +1,13 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.Repository Dataport.Terminfinder.Repository Portable {C0ADC4D5-5A72-46CE-B424-5251437E0924} - 12 + default diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj index 9c6175d..8da381a 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj @@ -1,12 +1,12 @@  - net8.0 + net10.0 enable false Portable {F67BC847-C0FB-4642-8086-CB7FDC53DEF8} - 12 + default diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index 0c1bbd2..703dbd9 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable Dataport.Terminfinder.WebAPI Dataport.Terminfinder.WebAPI @@ -10,7 +10,7 @@ {1B884327-0051-4502-A301-D0EB71FC2EEB} Exe true - 12 + default From 23e47e7832bf3788d8cb177a10e88720450e32f7 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 08:40:16 +0200 Subject: [PATCH 02/13] build: update `log4net` to `v3.3.2` --- .../Dataport.Terminfinder.DeleteAppointments.Tool.csproj | 2 +- .../Dataport.Terminfinder.WebAPI.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj index 4c8eb33..8e4edf0 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index 703dbd9..afb4b1d 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -37,7 +37,7 @@ - + From fe0f71bfe68b770ee139ab4f677355e80553e112 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 10:46:01 +0200 Subject: [PATCH 03/13] build: update Microsoft packages to `v10` - remove unused `Microsoft.VisualStudio.Web.CodeGeneration.Design` --- .../Dataport.Terminfinder.BusinessLayer.csproj | 4 ++-- ...rminfinder.DeleteAppointments.Tool.Tests.csproj | 2 +- ...ort.Terminfinder.DeleteAppointments.Tool.csproj | 14 +++++++------- ...Dataport.Terminfinder.Repository.Migrate.csproj | 4 ++-- .../Dataport.Terminfinder.Repository.Tests.csproj | 2 +- .../Dataport.Terminfinder.Repository.csproj | 4 ++-- .../Dataport.Terminfinder.WebAPI.Tests.csproj | 2 +- .../Dataport.Terminfinder.WebAPI.csproj | 7 +++---- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj index 8268715..19de9d0 100644 --- a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj @@ -26,8 +26,8 @@ - - + + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj index 0630261..6c47146 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj @@ -27,7 +27,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj index 8e4edf0..2e3a501 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj @@ -44,14 +44,14 @@ - - - - + + + + - - - + + + diff --git a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj index b1322e3..b2f74e1 100644 --- a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj +++ b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj index 802f445..b93539f 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj +++ b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj @@ -28,7 +28,7 @@ - + diff --git a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj index 7c05b8e..918d01d 100644 --- a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj +++ b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj @@ -25,8 +25,8 @@ - - + + diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj index 8da381a..5bb99e1 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj @@ -27,7 +27,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index afb4b1d..f201da1 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -39,17 +39,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - From fa58bf53e1508864e8adb26264add07f1601b53e Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 13:50:33 +0200 Subject: [PATCH 04/13] build: update testing packages - apply migration to `ThrowsExactly`, `ThrowsException` is removed in `v4` --- .../AppointmentBusinessLayerTests.cs | 7 ++-- ...rt.Terminfinder.BusinessLayer.Tests.csproj | 6 +-- .../Security/BcryptWrapperTests.cs | 7 ++-- ...t.Terminfinder.BusinessObject.Tests.csproj | 6 +-- .../JsonSerializer/DateConverterTests.cs | 2 +- .../EnsureMaximumElementsAttributeTests.cs | 2 +- .../EnsureMinimumElementsAttributeTests.cs | 2 +- .../Validators/PasswordValidatorTests.cs | 2 +- .../Dataport.Terminfinder.Common.Tests.csproj | 6 +-- ...inder.DeleteAppointments.Tool.Tests.csproj | 6 +-- .../DeleteAppointmentsTests.cs | 7 ++-- .../AppointmentRepositoryTests.cs | 10 ++--- .../CustomerRepositoryTests.cs | 2 +- ...aport.Terminfinder.Repository.Tests.csproj | 6 +-- .../Controllers/AdminControllerTests.cs | 16 ++++---- .../Controllers/ApiControllerBaseTests.cs | 14 +++---- .../Controllers/AppointmentControllerTests.cs | 38 +++++++++---------- .../Controllers/ParticipantControllerTests.cs | 16 ++++---- .../SuggestedDateControllerTests.cs | 12 +++--- .../Controllers/VotingControllerTests.cs | 24 ++++++------ .../Dataport.Terminfinder.WebAPI.Tests.csproj | 6 +-- .../BasicAuthenticationEncoderTests.cs | 8 ++-- 22 files changed, 101 insertions(+), 104 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs b/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs index a98b40d..44e4044 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs @@ -4,7 +4,6 @@ using Dataport.Terminfinder.Repository; using JetBrains.Annotations; using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Dataport.Terminfinder.BusinessLayer.Tests; @@ -689,7 +688,7 @@ public void VerifyAppointmentPassword_NotProtected_ThrowsException() var sut = CreateSut(mockAppointmentRepo.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.VerifyAppointmentPassword(ExpectedCustomerId, ExpectedAppointmentId, ExpectedPassword)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -727,7 +726,7 @@ public void VerifyAppointmentPasswordByAdminId_NotProtected_ThrowsException() var sut = CreateSut(mockAppointmentRepo.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.VerifyAppointmentPasswordByAdminId(ExpectedCustomerId, ExpectedAdminId, ExpectedPassword)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -1039,7 +1038,7 @@ public void SetAppointmentStatusType_NotProtected_ThrowsException() var sut = CreateSut(mockAppointmentRepo.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.SetAppointmentStatusType(ExpectedCustomerId, ExpectedAdminId, AppointmentStatusType.Undefined)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj index ca0e9c3..7fc5ab5 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj @@ -27,10 +27,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/BcryptWrapperTests.cs b/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/BcryptWrapperTests.cs index 80ef182..d768b71 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/BcryptWrapperTests.cs +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/BcryptWrapperTests.cs @@ -1,6 +1,5 @@ using Dataport.Terminfinder.BusinessLayer.Security; using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Dataport.Terminfinder.BusinessLayer.Tests.Security; @@ -26,7 +25,7 @@ public void Initialize() public void HashPassword_null_throwException() { var sut = CreateSut(saltGenerator); - Assert.ThrowsException(() => sut.HashPassword(null)); + Assert.ThrowsExactly(() => sut.HashPassword(null)); } [TestMethod] @@ -42,14 +41,14 @@ public void HashPassword_anyPassword_createdBcryptHash() public void HashPassword_passwordIsNullHashIsNotNull_throwException() { var sut = CreateSut(saltGenerator); - Assert.ThrowsException(() => sut.Verify(null, string.Empty)); + Assert.ThrowsExactly(() => sut.Verify(null, string.Empty)); } [TestMethod] public void HashPassword_passwordIsNotNullPasswordIsNull_throwException() { var sut = CreateSut(saltGenerator); - Assert.ThrowsException(() => sut.Verify(string.Empty, null)); + Assert.ThrowsExactly(() => sut.Verify(string.Empty, null)); } [TestMethod] diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj index 64545e3..eefc706 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj @@ -26,9 +26,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/JsonSerializer/DateConverterTests.cs b/src/Dataport.Terminfinder.BusinessObject.Tests/JsonSerializer/DateConverterTests.cs index 9c1f695..9f6d791 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/JsonSerializer/DateConverterTests.cs +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/JsonSerializer/DateConverterTests.cs @@ -62,7 +62,7 @@ public void ReadJson_NonValidDateValueAsString_deserializedDateValue_false() var dt = "99.99.2015"; var sut = new DateConverter(); - Assert.ThrowsException(() => + Assert.ThrowsExactly(() => { using var sr = new StringReader($"\"{dt}\""); using var jsonReader = new JsonTextReader(sr); diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMaximumElementsAttributeTests.cs b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMaximumElementsAttributeTests.cs index ccd13c8..748f1fb 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMaximumElementsAttributeTests.cs +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMaximumElementsAttributeTests.cs @@ -26,7 +26,7 @@ public IEnumerable Validate(ValidationContext validationContex [TestMethod] public void Constructor_MaxElementsValueIsTooGreat_throwException() { - Assert.ThrowsException(() => new EnsureMaximumElementsAttribute() + Assert.ThrowsExactly(() => new EnsureMaximumElementsAttribute() { ErrorMessage = ExectedEnsureMaximumElementsAttributeErrorMessage, MaxElements = 10001 diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMinimumElementsAttributeTests.cs b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMinimumElementsAttributeTests.cs index 281a656..6f5a68a 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMinimumElementsAttributeTests.cs +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/EnsureMinimumElementsAttributeTests.cs @@ -26,7 +26,7 @@ public IEnumerable Validate(ValidationContext validationContex [TestMethod] public void Constructor_MinElementsValueIsTooSmall_throwException() { - Assert.ThrowsException(() => new EnsureMinimumElementsAttribute + Assert.ThrowsExactly(() => new EnsureMinimumElementsAttribute { ErrorMessage = ExectedEnsureMinimumElementsAttributeErrorMessage, MinElements = 0 diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/PasswordValidatorTests.cs b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/PasswordValidatorTests.cs index a01fa55..505769b 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/PasswordValidatorTests.cs +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Validators/PasswordValidatorTests.cs @@ -245,6 +245,6 @@ public void IsValid_InvalidPasswordNoSpecialCharacter_false() [TestMethod] public void IsValid_null_throwException() { - Assert.ThrowsException(() => PasswordValidator.IsValid(null)); + Assert.ThrowsExactly(() => PasswordValidator.IsValid(null)); } } \ No newline at end of file diff --git a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj index abd8d6e..bf5e28f 100644 --- a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj +++ b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj @@ -26,9 +26,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj index 6c47146..c9de92d 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj @@ -28,10 +28,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/DeleteAppointmentsTests.cs b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/DeleteAppointmentsTests.cs index 20d56ce..06f99a2 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/DeleteAppointmentsTests.cs +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/DeleteAppointmentsTests.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using System.Diagnostics.CodeAnalysis; @@ -36,7 +35,7 @@ public void DeleteExpiredAppointments_ConnectionStringIsEmpty_ApplicationExcepti var deleteExpiredAppointments = new DeleteAppointmentsService(mockRepository.Object, _logger); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => deleteExpiredAppointments.DeleteExpiredAppointments(connectionString, customerId, deleteExpiredAppointmentsAfterDays, _dateTimeGeneratorServiceFake)); Assert.AreEqual(expectedErrorMessage, exception.Message); @@ -56,7 +55,7 @@ public void DeleteExpiredAppointments_deleteExpiredAppointmentsAfterDaysGreaterT var deleteExpiredAppointments = new DeleteAppointmentsService(mockRepository.Object, _logger); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => deleteExpiredAppointments.DeleteExpiredAppointments(connectionString, customerId, deleteExpiredAppointmentsAfterDays, _dateTimeGeneratorServiceFake)); Assert.AreEqual(expectedErrorMessage, exception.Message); @@ -77,7 +76,7 @@ public void DeleteExpiredAppointments_customerIdIsEmpty_ApplicationException() var deleteExpiredAppointments = new DeleteAppointmentsService(mockRepository.Object, _logger); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => deleteExpiredAppointments.DeleteExpiredAppointments(connectionString, customerId, deleteExpiredAppointmentsAfterDays, _dateTimeGeneratorServiceFake)); Assert.AreEqual(expectedErrorMessage, exception.Message); diff --git a/src/Dataport.Terminfinder.Repository.Tests/AppointmentRepositoryTests.cs b/src/Dataport.Terminfinder.Repository.Tests/AppointmentRepositoryTests.cs index 084a012..97b6a2a 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/AppointmentRepositoryTests.cs +++ b/src/Dataport.Terminfinder.Repository.Tests/AppointmentRepositoryTests.cs @@ -336,7 +336,7 @@ public void GetAppointmentPassword_AppointmentDoesNotExists_ThrowException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.GetAppointmentPassword(ExpectedCustomerId, unknownAppointmentId)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -365,7 +365,7 @@ public void GetAppointmentPasswordByAdmin_AppointmentDoesNotExists_ThrowExceptio var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.GetAppointmentPasswordByAdmin(ExpectedCustomerId, unknownAdminId)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -413,7 +413,7 @@ public void GetAppointmentStatusTypeByAdmin_AppointmentStatusDeleted_False() // act fetch var sut = CreateSut(mockAppointmentsSet); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.GetAppointmentStatusTypeByAdmin(ExpectedCustomerId, ExpectedAdminId)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -426,7 +426,7 @@ public void GetAppointmentStatusTypeByAdmin_AppointmentDoesNotExists_ThrowsExcep var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.GetAppointmentStatusTypeByAdmin(Guid.Empty, Guid.Empty)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -443,7 +443,7 @@ public void SetAppointmentStatusTypeByAdmin_AppointmentDoesNotExists_ThrowsExcep var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.SetAppointmentStatusTypeByAdmin(Guid.Empty, Guid.Empty, nameof(AppointmentStatusType.Paused))); Assert.AreEqual(expectedExceptionMessage, exception.Message); } diff --git a/src/Dataport.Terminfinder.Repository.Tests/CustomerRepositoryTests.cs b/src/Dataport.Terminfinder.Repository.Tests/CustomerRepositoryTests.cs index 457a1e6..f2470a1 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/CustomerRepositoryTests.cs +++ b/src/Dataport.Terminfinder.Repository.Tests/CustomerRepositoryTests.cs @@ -44,7 +44,7 @@ public void GetCustomer_GuidIsEmpty_ArgumentNullException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => sut.GetCustomer(Guid.Empty)); + var exception = Assert.ThrowsExactly(() => sut.GetCustomer(Guid.Empty)); Assert.AreEqual(expectedExceptionMessage, exception.Message); } diff --git a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj index b93539f..b041fa8 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj +++ b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj @@ -29,10 +29,10 @@ - + - - + + diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AdminControllerTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AdminControllerTests.cs index 69baa70..4bab1b6 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AdminControllerTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AdminControllerTests.cs @@ -55,7 +55,7 @@ public void GetAppointment_AdminIdIsEmpty() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => sut.Get(ExpectedCustomerId.ToString(), string.Empty)); + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), string.Empty)); Assert.AreEqual(ErrorType.AdminIdNotValid, exception.ErrorCode); } @@ -68,7 +68,7 @@ public void GetAppointment_NotFound() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), Guid.NewGuid().ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); } @@ -98,7 +98,7 @@ public void GetAppointment_verificationFailed_Unauthorized() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAdminId.ToString())); Assert.AreEqual(ErrorType.AuthorizationFailed, exception.ErrorCode); } @@ -208,10 +208,10 @@ public void GetProtection_GuidsAreInvalid_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.GetProtection(ExpectedInvalidGuidString, ExpectedAdminId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAdminId = Assert.ThrowsException(() => + var exceptionAdminId = Assert.ThrowsExactly(() => sut.GetProtection(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AdminIdNotValid, exceptionAdminId.ErrorCode); } @@ -272,7 +272,7 @@ public void SetStatus_AppointmentIsNull_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => sut.SetStatus(ExpectedCustomerId.ToString(), + var exception = Assert.ThrowsExactly(() => sut.SetStatus(ExpectedCustomerId.ToString(), ExpectedAdminId.ToString(), ExpectedAppointmentStatusType.ToString())); Assert.AreEqual(ErrorType.AppointmentStatusTypeNotAllowed, exception.ErrorCode); } @@ -285,7 +285,7 @@ public void SetStatus_GuidsInvalid_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.SetStatus(ExpectedInvalidGuidString, ExpectedInvalidGuidString, string.Empty)); Assert.AreEqual(ErrorType.CustomerIdNotValid, exception.ErrorCode); } @@ -402,7 +402,7 @@ public void GetPasswordVerification_GuidsInvalid_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.GetPasswordVerification(ExpectedInvalidGuidString, ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.CustomerIdNotValid, exception.ErrorCode); } diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ApiControllerBaseTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ApiControllerBaseTests.cs index 777367e..0ab1f93 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ApiControllerBaseTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ApiControllerBaseTests.cs @@ -16,7 +16,7 @@ public void BuildAdditionalErrorMessageFromModelState_ModelStateIsValid_ThrowsEx sut.ControllerContext = new ControllerContext { HttpContext = new DefaultHttpContext() }; sut.ModelState.Clear(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicBuildAdditionalErrorMessageFromModelState()); Assert.AreEqual(expectedExceptionMessage, exception.Message); } @@ -29,7 +29,7 @@ public void ValidateCustomerRequest_CustomerIdIsInvalid_ThrowsException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateCustomerRequest(invalidCustomerId, mockAppointmentBusinessLayer.Object)); Assert.AreEqual(ErrorType.CustomerIdNotFound, exception.ErrorCode); } @@ -39,7 +39,7 @@ public void ValidateCustomerRequest_AppointmentBusinessLayerIsNull_ThrowsExcepti { var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateCustomerRequest(ExpectedCustomerId, null)); Assert.AreEqual(ErrorType.CustomerIdNotFound, exception.ErrorCode); } @@ -52,7 +52,7 @@ public void ValidateCustomerRequest_CustomerWithIdDoesNotExist_ThrowsException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateCustomerRequest(ExpectedCustomerId, mockAppointmentBusinessLayer.Object)); Assert.AreEqual(ErrorType.CustomerIdNotFound, exception.ErrorCode); } @@ -66,7 +66,7 @@ public void ValidateAppointmentRequest_AppointmentIdIsInvalid_ThrowsException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateAppointmentRequest(ExpectedCustomerId, invalidAppointmentId, mockAppointmentBusinessLayer.Object)); Assert.AreEqual(ErrorType.AppointmentIdNotFound, exception.ErrorCode); @@ -86,7 +86,7 @@ public void ValidateAppointmentRequest_AdminIdIsInvalid_ThrowsException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateAppointmentRequest(ExpectedCustomerId, ExpectedAppointmentId, invalidAdminId, mockAppointmentBusinessLayer.Object)); Assert.AreEqual(ErrorType.AppointmentIdNotFound, exception.ErrorCode); @@ -105,7 +105,7 @@ public void ValidateAppointmentRequest_AppointmentDoesNotExist_ThrowsException() var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.PublicValidateAppointmentRequest(ExpectedCustomerId, ExpectedAppointmentId, ExpectedAdminId, mockAppointmentBusinessLayer.Object)); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AppointmentControllerTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AppointmentControllerTests.cs index dabafe2..19adff8 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AppointmentControllerTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/AppointmentControllerTests.cs @@ -68,7 +68,7 @@ public void GetAppointment_AppointmentId_NotFound() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), Guid.NewGuid().ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); } @@ -93,7 +93,7 @@ public void GetAppointment_AppointmentIdIsEmpty() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), string.Empty)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exception.ErrorCode); } @@ -114,7 +114,7 @@ public void GetAppointment_noUserCredentialSubmittedButTheyAreRequired_Unauthori var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.PasswordRequired, exception.ErrorCode); } @@ -143,7 +143,7 @@ public void GetAppointment_verificationFailed_Unauthorized() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.AuthorizationFailed, exception.ErrorCode); } @@ -169,7 +169,7 @@ public void GetAppointment_verificationFailedPasswordCanNotBeDecoded_BadRequest( var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.DecodingPasswordFailed, exception.ErrorCode); } @@ -211,10 +211,10 @@ public void GetAppointment_GuidsAreInvalid_ThrowsException() { var sut = CreateSut(); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.Get(ExpectedInvalidGuidString, ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); } @@ -229,7 +229,7 @@ public void GetAppointment_AppointmentIsNull_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); } @@ -317,7 +317,7 @@ public void AddAppointment_WithAppointmentId_FailedNotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Post(appointment, ExpectedCustomerId.ToString())); Assert.AreEqual(ErrorType.IdsMustBeEmpty, exception.ErrorCode); } @@ -335,7 +335,7 @@ public void AddAppointment_WithAdminId_FailedNotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Post(appointment, ExpectedCustomerId.ToString())); Assert.AreEqual(ErrorType.IdsMustBeEmpty, exception.ErrorCode); } @@ -353,7 +353,7 @@ public void AddAppointment_ParticipantCountExceedsLimit_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Post(new Appointment(), ExpectedCustomerId.ToString())); Assert.AreEqual(ErrorType.MaximumElementsOfParticipantsAreExceeded, exception.ErrorCode); } @@ -376,7 +376,7 @@ public void AddAppointment_SuggestedDateCountExceedsLimit_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Post(new Appointment(), ExpectedCustomerId.ToString())); Assert.AreEqual(ErrorType.MaximumElementsOfSuggestedDatesAreExceeded, exception.ErrorCode); } @@ -404,7 +404,7 @@ public void AddAppointment_SuggestedDateCountSubceedsLimit_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Post(new Appointment(), ExpectedCustomerId.ToString())); Assert.AreEqual(ErrorType.MinimumElementsOfSuggestedDatesAreNotExceeded, exception.ErrorCode); } @@ -435,7 +435,7 @@ public void AddAppointment_verificationFailed_Unauthorized() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(new Appointment { AppointmentId = ExpectedAppointmentId, @@ -458,7 +458,7 @@ public void UpdateAppointment_CustomerIdIsInvalid_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object, mockRequestContext.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(appointment, ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.CustomerIdNotValid, exception.ErrorCode); } @@ -524,10 +524,10 @@ public void GetProtection_GuidsAreInvalid_ThrowsException() { var sut = CreateSut(); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.GetProtection(ExpectedInvalidGuidString, ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.GetProtection(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); } @@ -635,10 +635,10 @@ public void GetPasswordVerification_GuidsAreInvalid_ThrowsException() var mockBusinessLayer = new Mock(); var sut = CreateSut(mockBusinessLayer.Object); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.GetPasswordVerification(ExpectedInvalidGuidString, ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.GetPasswordVerification(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); } diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ParticipantControllerTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ParticipantControllerTests.cs index abbb405..3580ec4 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ParticipantControllerTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/ParticipantControllerTests.cs @@ -51,7 +51,7 @@ public void DeleteParticipants_Participants_NoInput() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), expectedParticipantId.ToString())); Assert.AreEqual(ErrorType.NoInput, exception.ErrorCode); @@ -77,7 +77,7 @@ public void DeleteParticipants_Participants_NotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.ParticipantNotFound, exception.ErrorCode); @@ -102,7 +102,7 @@ public void DeleteParticipants_AppointmentIsPaused_NotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); @@ -128,7 +128,7 @@ public void DeleteParticipants_AppointmentIsPasswordProtectedNoPasswordSubmitted var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.PasswordRequired, exception.ErrorCode); @@ -140,13 +140,13 @@ public void DeleteParticipants_GuidsAreInvalid_ThrowsException() var mockBusinessLayer = new Mock(); var sut = CreateSut(mockBusinessLayer.Object); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.Delete(ExpectedInvalidGuidString, ExpectedAppointmentId.ToString(), ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString, ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); - var exceptionParticipantId = Assert.ThrowsException(() => + var exceptionParticipantId = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.ParticipantIdNotValid, exceptionParticipantId.ErrorCode); } @@ -167,7 +167,7 @@ public void DeleteParticipants_ParticipantsAreInvalid_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedParticipantId.ToString())); Assert.AreEqual(ErrorType.ParticipantNotValid, exception.ErrorCode); diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/SuggestedDateControllerTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/SuggestedDateControllerTests.cs index 34910cf..e53b097 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/SuggestedDateControllerTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/SuggestedDateControllerTests.cs @@ -56,7 +56,7 @@ public void DeleteSuggestedDates_SuggestedDates_NoInput() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => sut.Delete(ExpectedCustomerId.ToString(), + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), expectedSuggestedDateId.ToString())); Assert.AreEqual(ErrorType.NoInput, exception.ErrorCode); } @@ -76,7 +76,7 @@ public void DeleteSuggestedDates_SuggestedDates_NotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => sut.Delete(ExpectedCustomerId.ToString(), + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedSuggestedDateId.ToString())); Assert.AreEqual(ErrorType.SuggestedDateNotFound, exception.ErrorCode); } @@ -98,7 +98,7 @@ public void DeleteSuggestedDates_AppointmentIsPasswordProtectedNoPasswordSubmitt var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => sut.Delete(ExpectedCustomerId.ToString(), + var exception = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), ExpectedSuggestedDateId.ToString())); Assert.AreEqual(ErrorType.PasswordRequired, exception.ErrorCode); } @@ -110,13 +110,13 @@ public void DeleteSuggestedDates_GuidsAreInvalid_ThrowsException() var sut = CreateSut(); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.Delete(invalidGuidString, ExpectedAppointmentId.ToString(), ExpectedSuggestedDateId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), invalidGuidString, ExpectedSuggestedDateId.ToString())); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); - var exceptionSuggestedDateId = Assert.ThrowsException(() => + var exceptionSuggestedDateId = Assert.ThrowsExactly(() => sut.Delete(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString(), invalidGuidString)); Assert.AreEqual(ErrorType.SuggestedDateIdNotValid, exceptionSuggestedDateId.ErrorCode); } diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/VotingControllerTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/VotingControllerTests.cs index 3522417..8f01723 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/VotingControllerTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Controllers/VotingControllerTests.cs @@ -21,7 +21,7 @@ public void Get_AppointmentIsPasswordProtectedAndNoPasswordSubmitted_Unauthorize var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.PasswordRequired, exception.ErrorCode); } @@ -31,10 +31,10 @@ public void Get_GuidsAreInvalid_ThrowsException() { var sut = CreateSut(); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.Get(ExpectedInvalidGuidString, ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); } @@ -51,7 +51,7 @@ public void Get_ParticipantsIsNull_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Get(ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); } @@ -72,7 +72,7 @@ public void Put_AppointmentIsPasswordProtectedAndNoPasswordSubmitted_Unauthorize var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put([null], ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.PasswordRequired, exception.ErrorCode); } @@ -92,7 +92,7 @@ public void Put_AppointmentStatusIsPaused_NotFound() var sut = CreateSut(mockBusinessLayer.Object); // Act - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put([null], ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.AppointmentNotFound, exception.ErrorCode); } @@ -158,7 +158,7 @@ public void Put_ParticipantsIsNull_ThrowsException() { var sut = CreateSut(); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(null, ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.NoInput, exception.ErrorCode); } @@ -170,10 +170,10 @@ public void Put_GuidsAreInvalid_ThrowsException() var sut = CreateSut(); - var exceptionCustomerId = Assert.ThrowsException(() => + var exceptionCustomerId = Assert.ThrowsExactly(() => sut.Put(participants, ExpectedInvalidGuidString, ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.CustomerIdNotValid, exceptionCustomerId.ErrorCode); - var exceptionAppointmentId = Assert.ThrowsException(() => + var exceptionAppointmentId = Assert.ThrowsExactly(() => sut.Put(participants, ExpectedCustomerId.ToString(), ExpectedInvalidGuidString)); Assert.AreEqual(ErrorType.AppointmentIdNotValid, exceptionAppointmentId.ErrorCode); } @@ -190,7 +190,7 @@ public void Put_ParticipantsAreInvalid_ThrowsException() mockBusinessLayer.Setup(x => x.ExistsAppointmentIsStarted(It.IsAny(), It.IsAny())).Returns(true); var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(participants, ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.ParticipantNotValid, exception.ErrorCode); } @@ -229,7 +229,7 @@ public void Put_ModelIsInvalid_ThrowsException() }); var sut = CreateSut(mockBusinessLayer.Object, objectModelValidator.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(participants, ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.AppointmentNotValid, exception.ErrorCode); } @@ -261,7 +261,7 @@ public void Put_ParticipantCountExceedsLimit_ThrowsException() var sut = CreateSut(mockBusinessLayer.Object); - var exception = Assert.ThrowsException(() => + var exception = Assert.ThrowsExactly(() => sut.Put(participants, ExpectedCustomerId.ToString(), ExpectedAppointmentId.ToString())); Assert.AreEqual(ErrorType.MaximumElementsOfParticipantsAreExceeded, exception.ErrorCode); } diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj index 5bb99e1..3c4ddc8 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj @@ -28,10 +28,10 @@ - + - - + + diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/RequestContext/BasicAuthenticationEncoderTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/RequestContext/BasicAuthenticationEncoderTests.cs index ac1f1df..5cf746c 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/RequestContext/BasicAuthenticationEncoderTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/RequestContext/BasicAuthenticationEncoderTests.cs @@ -40,28 +40,28 @@ public void Decode_validBasicAuthenticationPayloadValuePasswordIsEmpty_resultCon [TestMethod] public void Decode_invalidBasicAuthenticationPayloadValueNoBasicAtBeginning_throwException() { - Assert.ThrowsException(() => + Assert.ThrowsExactly(() => BasicAuthenticationValueEncoder.Decode(" dXNlcm5hbWU6UDQkJHcwcmQ=")); } [TestMethod] public void Decode_invalidBasicAuthenticationPayloadValueNoColonInEncodedBasicAuthValue_throwException() { - Assert.ThrowsException(() => + Assert.ThrowsExactly(() => BasicAuthenticationValueEncoder.Decode("Basic dXNlcm5hbWVQNCQkdzByZA==")); } [TestMethod] public void Decode_invalidBasicAuthenticationPayloadValueInvalidEncodedBasicAuthValue_throwException() { - Assert.ThrowsException(() => + Assert.ThrowsExactly(() => BasicAuthenticationValueEncoder.Decode("Basic aaaaaaa")); } [TestMethod] public void Decode_null_throwException() { - Assert.ThrowsException(() => BasicAuthenticationValueEncoder.Decode(null)); + Assert.ThrowsExactly(() => BasicAuthenticationValueEncoder.Decode(null)); } [TestMethod] From 696b6894b575ef3047749b14f7f65708ea885d05 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 14:17:24 +0200 Subject: [PATCH 05/13] test: use `HostBuilder` instead of `WebHostBuilder` https://aka.ms/aspnet/deprecate/004 --- .../AdminControllerIntegrationTests.cs | 28 +++++++++- .../AppControllerIntegrationTests.cs | 30 ++++++++-- .../AppointmentControllerIntegrationTests.cs | 28 +++++++++- .../CustomerControllerIntegrationTests.cs | 28 +++++++++- .../ErrorHandlingMiddlewareTests.cs | 56 +++++++++++++------ .../ParticipantControllerIntegrationTests.cs | 28 +++++++++- ...SuggestedDateControllerIntegrationTests.cs | 28 +++++++++- .../VotingControllerIntegrationTests.cs | 28 +++++++++- 8 files changed, 214 insertions(+), 40 deletions(-) diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AdminControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AdminControllerIntegrationTests.cs index 2172f7c..5d85426 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AdminControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AdminControllerIntegrationTests.cs @@ -8,14 +8,36 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests; public class AdminControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppControllerIntegrationTests.cs index 483e671..ab68fa3 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppControllerIntegrationTests.cs @@ -5,13 +5,35 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests; public class AppControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] @@ -39,4 +61,4 @@ public async Task GetAppInfo_Okay() Assert.AreEqual(expectedAppInfo.BuildDate, dto.BuildDate); Assert.AreEqual(expectedAppInfo.VersionNumber, dto.VersionNumber); } -} +} \ No newline at end of file diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs index bec2f4a..6294e3c 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs @@ -9,14 +9,36 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests; public class AppointmentControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/CustomerControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/CustomerControllerIntegrationTests.cs index 90db39e..21352f1 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/CustomerControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/CustomerControllerIntegrationTests.cs @@ -5,14 +5,36 @@ public class CustomerControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ErrorHandling/ErrorHandlingMiddlewareTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ErrorHandling/ErrorHandlingMiddlewareTests.cs index 8188baf..5555142 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ErrorHandling/ErrorHandlingMiddlewareTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ErrorHandling/ErrorHandlingMiddlewareTests.cs @@ -7,31 +7,45 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests.ErrorHandling; public class ErrorHandlingMiddlewareTests : BaseIntegrationTests { private TestServer _server; + private IHost _host; private HttpClient _client; [TestInitialize] - public void Setup() + public async Task Setup() { var mockLocalizer = new Mock>(); var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder() - .UseStartup() - .UseConfiguration(config) - .ConfigureServices(services => - { - services.AddSingleton(mockLocalizer.Object); - }) - .Configure(app => - { - app.UseMiddleware(); - app.Map("/conflict", cfg => + _host = new HostBuilder() + .ConfigureWebHost(builder => { - cfg.Run(_ => throw new ConflictException(ErrorType.GeneralError)); - }); - }); + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config) + .ConfigureServices(services => + { + services.AddSingleton(mockLocalizer.Object); + } + ) + .Configure(app => + { + app.UseMiddleware(); + app.Map( + "/conflict", + cfg => + { + cfg.Run(_ => throw new ConflictException(ErrorType.GeneralError)); + } + ); + } + ); + } + ) + .Build(); - _server = new TestServer(builder); + await _host.StartAsync(); + _server = _host.GetTestServer(); _client = _server.CreateClient(); } @@ -44,9 +58,15 @@ public async Task Conflict_ReturnsExpectedException() } [TestCleanup] - public void Cleanup() + public async Task Cleanup() { + if (_server != null) + { + await _host.StopAsync(); + _server.Dispose(); + } + + _host?.Dispose(); _client.Dispose(); - _server.Dispose(); } } \ No newline at end of file diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ParticipantControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ParticipantControllerIntegrationTests.cs index cb38f23..5abe61d 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ParticipantControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/ParticipantControllerIntegrationTests.cs @@ -9,14 +9,36 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests; public class ParticipantControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs index 254de1b..7d3bfcc 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs @@ -5,14 +5,36 @@ public class SuggestedDateControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs index 0f9d9fe..d5f3d73 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs @@ -8,14 +8,36 @@ namespace Dataport.Terminfinder.WebAPI.Tests.IntegrationTests; public class VotingControllerIntegrationTests : BaseIntegrationTests { private TestServer _testServer; + private IHost _host; private static readonly Guid ExpectedCustomerId = new("E1E81104-3944-4588-A48E-B64BDE473E1A"); [TestInitialize] - public void Initialize() + public async Task Initialize() { var config = GetConfigurationBuilder(); - var builder = new WebHostBuilder().UseStartup().UseConfiguration(config); - _testServer = new TestServer(builder); + _host = new HostBuilder() + .ConfigureWebHost(builder => + { + builder + .UseTestServer() + .UseStartup() + .UseConfiguration(config); + } + ) + .Build(); + await _host.StartAsync(); + _testServer = _host.GetTestServer(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_testServer != null) + { + await _host.StopAsync(); + _testServer.Dispose(); + } + _host?.Dispose(); } [TestMethod] From 38b2bb5e5787db13418a20e2944fe5ec7bd0b461 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 14:59:38 +0200 Subject: [PATCH 06/13] test: remove null assertion on nun-nullables --- .../AppointmentBusinessLayerTests.cs | 3 +-- .../AppointmentControllerIntegrationTests.cs | 10 ---------- .../IntegrationTests/BaseIntegrationTests.cs | 1 - .../VotingControllerIntegrationTests.cs | 4 ---- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs b/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs index 44e4044..b9734b0 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/AppointmentBusinessLayerTests.cs @@ -1023,8 +1023,7 @@ public void SetAppointmentStatusType_ChangeStatusType_DeletedToStarted_Exception var sut = CreateSut(mockAppointmentRepo.Object, mockCustomerRepo.Object, mockBcryptWrapper.Object); var appointmentObject = sut.SetAppointmentStatusType(ExpectedCustomerId, ExpectedAdminId, newStatusType); - Assert.IsTrue(appointmentObject == null); - Assert.IsFalse(appointmentObject != null); + Assert.IsNull(appointmentObject); } [TestMethod] diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs index 6294e3c..fc4f228 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/AppointmentControllerIntegrationTests.cs @@ -61,7 +61,6 @@ public async Task AddAppointment() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); //--- get the appointment var appointmentId= dto.AppointmentId; @@ -157,7 +156,6 @@ public async Task UpdateAppointment() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); var appointmentId = dto.AppointmentId; var adminId = dto.AdminId; @@ -211,7 +209,6 @@ public async Task UpdateAppointment() Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(dto3); Assert.IsInstanceOfType(dto3, typeof(Appointment)); - Assert.IsNotNull(dto3.AppointmentId); Assert.AreEqual(dto.AppointmentId, dto3.AppointmentId); Assert.AreEqual(dto.AdminId, dto3.AdminId); @@ -433,7 +430,6 @@ public async Task AddAppointment_WithPassword_Unauthorized() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); //--- get the appointment var appointmentId = dto.AppointmentId; @@ -508,8 +504,6 @@ public async Task AddAppointment_WithPassword() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); - Assert.IsNotNull(dto.AdminId); //--- get the appointment var appointmentId = dto.AppointmentId; @@ -566,8 +560,6 @@ public async Task GetProtection_appointmentExistsAndAppointmentIsProtectedByPass Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); - Assert.IsNotNull(dto.AdminId); var appointmentId = dto.AppointmentId; @@ -607,8 +599,6 @@ public async Task GetPasswordVerification() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); - Assert.IsNotNull(dto.AdminId); var appointmentId = dto.AppointmentId; var adminId = dto.AdminId; diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/BaseIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/BaseIntegrationTests.cs index 34bf995..30dc7d3 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/BaseIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/BaseIntegrationTests.cs @@ -87,7 +87,6 @@ protected static async Task CreateTestAppointmentInDatabase( Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); return dto; } diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs index d5f3d73..c5b85e6 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/VotingControllerIntegrationTests.cs @@ -70,7 +70,6 @@ public async Task AddAndUpdateParticipant_And_Votings() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); //--- get the appointment var appointmentId = dto.AppointmentId; @@ -216,7 +215,6 @@ public async Task AppointmentIsPasswordProtectedAndNoPasswordSubmitted_Unauthori Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); // Act Get voting response = await client.GetAsync($"votings/{ExpectedCustomerId}/{dto.AppointmentId}"); @@ -248,7 +246,6 @@ public async Task Put_AppointmentIsPasswordProtectedAndNoPasswordSubmitted_Unaut Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); var participants = appointment.Participants ?? new List(); participants.Add(new Participant @@ -291,7 +288,6 @@ public async Task Put_AppointmentStatusIsPaused_NotFound() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(dto); Assert.IsInstanceOfType(dto, typeof(Appointment)); - Assert.IsNotNull(dto.AppointmentId); var participants = appointment.Participants ?? new List(); participants.Add(new Participant From 1753a07517fffca3b1e99adeba2a0ec0e45a1722 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 15:00:13 +0200 Subject: [PATCH 07/13] refactor: optimize imports --- .../BusinessLayerBaseTests.cs | 1 - .../Security/SaltGeneratorTests.cs | 1 - .../AppConfigBusinessLayer.cs | 4 ++-- .../Extension/EnumerableExtensionsTests.cs | 1 - .../Extension/StringExtensionsTests.cs | 1 - src/Dataport.Terminfinder.Repository/DataContext.cs | 4 ++-- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/BusinessLayerBaseTests.cs b/src/Dataport.Terminfinder.BusinessLayer.Tests/BusinessLayerBaseTests.cs index 1c3d8ca..8134f3c 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/BusinessLayerBaseTests.cs +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/BusinessLayerBaseTests.cs @@ -2,7 +2,6 @@ using Dataport.Terminfinder.Repository; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Dataport.Terminfinder.BusinessLayer.Tests; diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/SaltGeneratorTests.cs b/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/SaltGeneratorTests.cs index c3ae77d..f51314c 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/SaltGeneratorTests.cs +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/Security/SaltGeneratorTests.cs @@ -1,6 +1,5 @@ using Dataport.Terminfinder.BusinessLayer.Security; using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace Dataport.Terminfinder.BusinessLayer.Tests.Security; diff --git a/src/Dataport.Terminfinder.BusinessLayer/AppConfigBusinessLayer.cs b/src/Dataport.Terminfinder.BusinessLayer/AppConfigBusinessLayer.cs index b235494..5d13ba9 100644 --- a/src/Dataport.Terminfinder.BusinessLayer/AppConfigBusinessLayer.cs +++ b/src/Dataport.Terminfinder.BusinessLayer/AppConfigBusinessLayer.cs @@ -1,5 +1,5 @@ -using Dataport.Terminfinder.Repository; -using Dataport.Terminfinder.BusinessObject; +using Dataport.Terminfinder.BusinessObject; +using Dataport.Terminfinder.Repository; namespace Dataport.Terminfinder.BusinessLayer; diff --git a/src/Dataport.Terminfinder.Common.Tests/Extension/EnumerableExtensionsTests.cs b/src/Dataport.Terminfinder.Common.Tests/Extension/EnumerableExtensionsTests.cs index 4a36d9c..8284ae9 100644 --- a/src/Dataport.Terminfinder.Common.Tests/Extension/EnumerableExtensionsTests.cs +++ b/src/Dataport.Terminfinder.Common.Tests/Extension/EnumerableExtensionsTests.cs @@ -1,5 +1,4 @@ using Dataport.Terminfinder.Common.Extension; -using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections; namespace Dataport.Terminfinder.Common.Tests.Extension; diff --git a/src/Dataport.Terminfinder.Common.Tests/Extension/StringExtensionsTests.cs b/src/Dataport.Terminfinder.Common.Tests/Extension/StringExtensionsTests.cs index 2dcd8e4..b5028d5 100644 --- a/src/Dataport.Terminfinder.Common.Tests/Extension/StringExtensionsTests.cs +++ b/src/Dataport.Terminfinder.Common.Tests/Extension/StringExtensionsTests.cs @@ -1,5 +1,4 @@ using Dataport.Terminfinder.Common.Extension; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Dataport.Terminfinder.Common.Tests.Extension; diff --git a/src/Dataport.Terminfinder.Repository/DataContext.cs b/src/Dataport.Terminfinder.Repository/DataContext.cs index 8dfe17b..193c4b0 100644 --- a/src/Dataport.Terminfinder.Repository/DataContext.cs +++ b/src/Dataport.Terminfinder.Repository/DataContext.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using Dataport.Terminfinder.BusinessObject; +using Dataport.Terminfinder.BusinessObject; +using Microsoft.EntityFrameworkCore; namespace Dataport.Terminfinder.Repository; From e8dc05d5965f59533b4c7e1a200d0d5c46d7b831 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 15:00:29 +0200 Subject: [PATCH 08/13] fix: namespace --- src/Dataport.Terminfinder.Repository.Migrate/Enum/ErrorType.cs | 2 +- src/Dataport.Terminfinder.Repository.Migrate/MigrateDatabase.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dataport.Terminfinder.Repository.Migrate/Enum/ErrorType.cs b/src/Dataport.Terminfinder.Repository.Migrate/Enum/ErrorType.cs index f584727..88a5252 100644 --- a/src/Dataport.Terminfinder.Repository.Migrate/Enum/ErrorType.cs +++ b/src/Dataport.Terminfinder.Repository.Migrate/Enum/ErrorType.cs @@ -1,4 +1,4 @@ -namespace Dataport.Terminfinder.Console.DeleteAppointments.Tool.Enum; +namespace Dataport.Terminfinder.Repository.Migrate.Enum; /// /// Error numbers diff --git a/src/Dataport.Terminfinder.Repository.Migrate/MigrateDatabase.cs b/src/Dataport.Terminfinder.Repository.Migrate/MigrateDatabase.cs index 1fb415b..2d7be2a 100644 --- a/src/Dataport.Terminfinder.Repository.Migrate/MigrateDatabase.cs +++ b/src/Dataport.Terminfinder.Repository.Migrate/MigrateDatabase.cs @@ -1,4 +1,4 @@ -using Dataport.Terminfinder.Console.DeleteAppointments.Tool.Enum; +using Dataport.Terminfinder.Repository.Migrate.Enum; using Dataport.Terminfinder.Repository.Setup; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; From 2130d3c316e1bbb9ba2030f7672fbd70a89f2e14 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 15:00:41 +0200 Subject: [PATCH 09/13] test: fix assertion --- .../IntegrationTests/SuggestedDateControllerIntegrationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs index 7d3bfcc..e3bbdc8 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs +++ b/src/Dataport.Terminfinder.WebAPI.Tests/IntegrationTests/SuggestedDateControllerIntegrationTests.cs @@ -133,6 +133,6 @@ public async Task AddSuggestedDateDescription_GetSuggestedDate_ValueMatches() // assert var resultDescription = result.SuggestedDates.First(s => s.Description == expectedDescription).Description; Assert.IsNotNull(resultDescription); - Assert.AreEqual(expectedDescription, expectedDescription); + Assert.AreEqual(expectedDescription, resultDescription); } } From 1920112c8e220b2e21d1d94104e9fa29a72dab68 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 15:51:10 +0200 Subject: [PATCH 10/13] build: update packages --- .../Dataport.Terminfinder.BusinessLayer.Tests.csproj | 6 +++--- .../Dataport.Terminfinder.BusinessLayer.csproj | 2 +- .../Dataport.Terminfinder.BusinessObject.Tests.csproj | 6 +++--- .../Dataport.Terminfinder.BusinessObject.csproj | 2 +- .../Dataport.Terminfinder.Common.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.Common.csproj | 2 +- ...port.Terminfinder.DeleteAppointments.Tool.Tests.csproj | 4 ++-- .../Dataport.Terminfinder.DeleteAppointments.Tool.csproj | 2 +- .../Dataport.Terminfinder.Repository.Tests.csproj | 6 +++--- .../Dataport.Terminfinder.Repository.csproj | 2 +- .../Dataport.Terminfinder.WebAPI.Tests.csproj | 6 +++--- .../Dataport.Terminfinder.WebAPI.csproj | 8 ++++---- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj index 7fc5ab5..3a97fa2 100644 --- a/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer.Tests/Dataport.Terminfinder.BusinessLayer.Tests.csproj @@ -18,15 +18,15 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj index 19de9d0..2db68d1 100644 --- a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj index eefc706..e2220d0 100644 --- a/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj +++ b/src/Dataport.Terminfinder.BusinessObject.Tests/Dataport.Terminfinder.BusinessObject.Tests.csproj @@ -18,18 +18,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj b/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj index a8434d7..5582f3e 100644 --- a/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj +++ b/src/Dataport.Terminfinder.BusinessObject/Dataport.Terminfinder.BusinessObject.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj index bf5e28f..3f48d2c 100644 --- a/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj +++ b/src/Dataport.Terminfinder.Common.Tests/Dataport.Terminfinder.Common.Tests.csproj @@ -18,11 +18,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj b/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj index 24986e8..e447498 100644 --- a/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj +++ b/src/Dataport.Terminfinder.Common/Dataport.Terminfinder.Common.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj index c9de92d..411f6f1 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool.Tests/Dataport.Terminfinder.DeleteAppointments.Tool.Tests.csproj @@ -19,11 +19,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj index 2e3a501..b7c9381 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj @@ -42,7 +42,7 @@ - + diff --git a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj index b041fa8..5210d5a 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj +++ b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj @@ -18,15 +18,15 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj index 918d01d..04091ec 100644 --- a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj +++ b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj index 3c4ddc8..1b3017c 100644 --- a/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj +++ b/src/Dataport.Terminfinder.WebAPI.Tests/Dataport.Terminfinder.WebAPI.Tests.csproj @@ -18,15 +18,15 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index f201da1..f0cdf85 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -36,12 +36,12 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -49,7 +49,7 @@ - + From 34f77fd8d782f145af08b32818ff45b77ffd4a85 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Mon, 20 Jul 2026 15:52:52 +0200 Subject: [PATCH 11/13] build: update swagger packages to `v10` & migrate dependent code - remove dead url https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/docs/migrating-to-v10.md --- .../Dataport.Terminfinder.WebAPI.csproj | 14 +++++++------- src/Dataport.Terminfinder.WebAPI/Startup.cs | 2 +- .../Swagger/BasicAuthOperationFilter.cs | 2 +- .../Swagger/EnumTypesSchemaFilter.cs | 14 ++++++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index f0cdf85..065f11c 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -48,14 +48,14 @@ - + - - - - - - + + + + + + diff --git a/src/Dataport.Terminfinder.WebAPI/Startup.cs b/src/Dataport.Terminfinder.WebAPI/Startup.cs index fd2a44a..c1b562a 100644 --- a/src/Dataport.Terminfinder.WebAPI/Startup.cs +++ b/src/Dataport.Terminfinder.WebAPI/Startup.cs @@ -15,7 +15,7 @@ using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Newtonsoft.Json.Converters; using System.Diagnostics.CodeAnalysis; using System.Globalization; diff --git a/src/Dataport.Terminfinder.WebAPI/Swagger/BasicAuthOperationFilter.cs b/src/Dataport.Terminfinder.WebAPI/Swagger/BasicAuthOperationFilter.cs index bc5e9fa..f2f684f 100644 --- a/src/Dataport.Terminfinder.WebAPI/Swagger/BasicAuthOperationFilter.cs +++ b/src/Dataport.Terminfinder.WebAPI/Swagger/BasicAuthOperationFilter.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.Filters; using Swashbuckle.AspNetCore.SwaggerGen; using System.Diagnostics.CodeAnalysis; diff --git a/src/Dataport.Terminfinder.WebAPI/Swagger/EnumTypesSchemaFilter.cs b/src/Dataport.Terminfinder.WebAPI/Swagger/EnumTypesSchemaFilter.cs index f1016f8..144aad3 100644 --- a/src/Dataport.Terminfinder.WebAPI/Swagger/EnumTypesSchemaFilter.cs +++ b/src/Dataport.Terminfinder.WebAPI/Swagger/EnumTypesSchemaFilter.cs @@ -1,5 +1,4 @@ -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; using System.Diagnostics.CodeAnalysis; using System.Text; @@ -7,7 +6,6 @@ namespace Dataport.Terminfinder.WebAPI.Swagger; - // s. https://www.codeproject.com/Articles/5300099/Description-of-the-Enumeration-Members-in-Swashbuc /// /// Swagger documentation for EnumTypes /// @@ -29,21 +27,21 @@ public EnumTypesSchemaFilter(string xmlPath) } /// - public void Apply(OpenApiSchema schema, SchemaFilterContext context) + public void Apply(IOpenApiSchema schema, SchemaFilterContext context) { if (_xmlComments == null) { return; } - if (schema.Enum.Count > 0 && context.Type is { IsEnum: true }) + if (schema is OpenApiSchema { Enum.Count: > 0 } openApiSchema && context.Type is { IsEnum: true }) { - var sb = new StringBuilder(schema.Description); + var sb = new StringBuilder(openApiSchema.Description); sb.Append("

Members:

    "); var fullTypeName = context.Type.FullName; - foreach (var enumMemberName in schema.Enum.OfType().Select(v => v.Value)) + foreach (var enumMemberName in openApiSchema.Enum.Select(v => v.AsValue())) { var fullEnumMemberName = $"F:{fullTypeName}.{enumMemberName}"; @@ -69,7 +67,7 @@ public void Apply(OpenApiSchema schema, SchemaFilterContext context) sb.Append("
"); - schema.Description = sb.ToString(); + openApiSchema.Description = sb.ToString(); } } } \ No newline at end of file From 145b872e91f6babe1c7b845400d42a459a3383d7 Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Wed, 22 Jul 2026 11:20:33 +0200 Subject: [PATCH 12/13] build: update `EntityFramework`, `Npgsql` & relevant packages to `v10` --- .../Dataport.Terminfinder.BusinessLayer.csproj | 4 ++-- .../Dataport.Terminfinder.DeleteAppointments.Tool.csproj | 2 +- .../Dataport.Terminfinder.Repository.Migrate.csproj | 2 +- .../Dataport.Terminfinder.Repository.Tests.csproj | 2 +- .../Dataport.Terminfinder.Repository.csproj | 4 ++-- .../Dataport.Terminfinder.WebAPI.csproj | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj index 2db68d1..6fcb543 100644 --- a/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj +++ b/src/Dataport.Terminfinder.BusinessLayer/Dataport.Terminfinder.BusinessLayer.csproj @@ -25,10 +25,10 @@ - + - + diff --git a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj index b7c9381..2dff0a3 100644 --- a/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj +++ b/src/Dataport.Terminfinder.DeleteAppointments.Tool/Dataport.Terminfinder.DeleteAppointments.Tool.csproj @@ -52,7 +52,7 @@ - + diff --git a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj index b2f74e1..c3d5f23 100644 --- a/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj +++ b/src/Dataport.Terminfinder.Repository.Migrate/Dataport.Terminfinder.Repository.Migrate.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj index 5210d5a..a0b0308 100644 --- a/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj +++ b/src/Dataport.Terminfinder.Repository.Tests/Dataport.Terminfinder.Repository.Tests.csproj @@ -27,7 +27,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive
- + diff --git a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj index 04091ec..99f800b 100644 --- a/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj +++ b/src/Dataport.Terminfinder.Repository/Dataport.Terminfinder.Repository.csproj @@ -24,10 +24,10 @@ - + - + diff --git a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj index 065f11c..7e31996 100644 --- a/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj +++ b/src/Dataport.Terminfinder.WebAPI/Dataport.Terminfinder.WebAPI.csproj @@ -35,14 +35,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 75ba262731a21935a978859d5f500f156868d65e Mon Sep 17 00:00:00 2001 From: gruenbbe Date: Wed, 22 Jul 2026 11:37:51 +0200 Subject: [PATCH 13/13] chore: update copyright --- src/Dataport.Terminfinder.WebAPI/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dataport.Terminfinder.WebAPI/Startup.cs b/src/Dataport.Terminfinder.WebAPI/Startup.cs index c1b562a..e829997 100644 --- a/src/Dataport.Terminfinder.WebAPI/Startup.cs +++ b/src/Dataport.Terminfinder.WebAPI/Startup.cs @@ -34,7 +34,7 @@ public class Startup private static readonly string ContactUrl = "https://www.dataport.de"; private static readonly string ContactEmail = "dataportdabstimmbox@dataport.de"; private static readonly string ContactName = "dataport"; - private static readonly string LicenseText = "EUPL-1.2 Copyright © 2022-2023 Dataport AöR"; + private static readonly string LicenseText = "EUPL-1.2 Copyright © 2022-2026 Dataport AöR"; private static readonly string LicenseUri = "https://opensource.org/licenses/EUPL-1.2"; private static readonly string OpenApiTitle = "Terminfinder API";