From 6b449dbfb534418fbc05dc1dc858489551897ce4 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Thu, 23 Jul 2026 00:48:57 +0300 Subject: [PATCH] Update package versions and improve null safety in tests - Updated various package versions in `Directory.Packages.props` to the latest compatible releases, enhancing overall stability and security. - Modified test assertions in `GrantBillingGiftCommandHandlerTests`, `RejectPaymentRequestCommandHandlerTests`, `BlockUserCommandHandlerTests`, and `DeleteUserCommandHandlerTests` to use null-safe checks, ensuring robustness against potential null reference exceptions. - Updated PostgreSqlContainer initialization in `PnvPanelWebApplicationFactory` for improved clarity and maintainability. --- backend/Directory.Packages.props | 89 +++++++++---------- .../GrantBillingGiftCommandHandlerTests.cs | 2 +- ...RejectPaymentRequestCommandHandlerTests.cs | 2 +- .../Users/BlockUserCommandHandlerTests.cs | 2 +- .../Users/DeleteUserCommandHandlerTests.cs | 2 +- .../PnvPanelWebApplicationFactory.cs | 3 +- 6 files changed, 48 insertions(+), 52 deletions(-) diff --git a/backend/Directory.Packages.props b/backend/Directory.Packages.props index 1ad7929..64504a9 100644 --- a/backend/Directory.Packages.props +++ b/backend/Directory.Packages.props @@ -1,46 +1,43 @@ - - - true - - - - - - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - - - - - - - + + + true + + + + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/tests/PnvPanel.Application.Tests/Admin/Billing/GrantBillingGiftCommandHandlerTests.cs b/backend/tests/PnvPanel.Application.Tests/Admin/Billing/GrantBillingGiftCommandHandlerTests.cs index 5322ff9..fc6ec30 100644 --- a/backend/tests/PnvPanel.Application.Tests/Admin/Billing/GrantBillingGiftCommandHandlerTests.cs +++ b/backend/tests/PnvPanel.Application.Tests/Admin/Billing/GrantBillingGiftCommandHandlerTests.cs @@ -74,7 +74,7 @@ public class GrantBillingGiftCommandHandlerTests .Received(1) .NotifyUserAsync( userId, - Arg.Is(m => m.Contains("30")), + Arg.Is(m => m!.Contains("30")), Arg.Any(), Arg.Any() ); diff --git a/backend/tests/PnvPanel.Application.Tests/Admin/Billing/RejectPaymentRequestCommandHandlerTests.cs b/backend/tests/PnvPanel.Application.Tests/Admin/Billing/RejectPaymentRequestCommandHandlerTests.cs index 8d48f73..7d90575 100644 --- a/backend/tests/PnvPanel.Application.Tests/Admin/Billing/RejectPaymentRequestCommandHandlerTests.cs +++ b/backend/tests/PnvPanel.Application.Tests/Admin/Billing/RejectPaymentRequestCommandHandlerTests.cs @@ -71,7 +71,7 @@ public class RejectPaymentRequestCommandHandlerTests .Received(1) .NotifyUserAsync( userId, - Arg.Is(m => m.Contains("Платёж не найден")), + Arg.Is(m => m!.Contains("Платёж не найден")), Arg.Any(), Arg.Any() ); diff --git a/backend/tests/PnvPanel.Application.Tests/Admin/Users/BlockUserCommandHandlerTests.cs b/backend/tests/PnvPanel.Application.Tests/Admin/Users/BlockUserCommandHandlerTests.cs index 0a00b2e..207a39c 100644 --- a/backend/tests/PnvPanel.Application.Tests/Admin/Users/BlockUserCommandHandlerTests.cs +++ b/backend/tests/PnvPanel.Application.Tests/Admin/Users/BlockUserCommandHandlerTests.cs @@ -118,7 +118,7 @@ public class BlockUserCommandHandlerTests await _gateway .Received(1) .UpdateClientAsync( - Arg.Is(n => n.Id == node.Id), + Arg.Is(n => n!.Id == node.Id), inbound.RemoteInboundId, config.ClientExternalId, config.Protocol, diff --git a/backend/tests/PnvPanel.Application.Tests/Admin/Users/DeleteUserCommandHandlerTests.cs b/backend/tests/PnvPanel.Application.Tests/Admin/Users/DeleteUserCommandHandlerTests.cs index 5ca34e3..f7f2fa7 100644 --- a/backend/tests/PnvPanel.Application.Tests/Admin/Users/DeleteUserCommandHandlerTests.cs +++ b/backend/tests/PnvPanel.Application.Tests/Admin/Users/DeleteUserCommandHandlerTests.cs @@ -99,7 +99,7 @@ public class DeleteUserCommandHandlerTests await _gateway .Received(1) .RemoveClientAsync( - Arg.Is(n => n.Id == node.Id), + Arg.Is(n => n!.Id == node.Id), inbound.RemoteInboundId, "external-id", config.Protocol, diff --git a/backend/tests/PnvPanel.IntegrationTests/TestSupport/PnvPanelWebApplicationFactory.cs b/backend/tests/PnvPanel.IntegrationTests/TestSupport/PnvPanelWebApplicationFactory.cs index 13185f5..a1f873a 100644 --- a/backend/tests/PnvPanel.IntegrationTests/TestSupport/PnvPanelWebApplicationFactory.cs +++ b/backend/tests/PnvPanel.IntegrationTests/TestSupport/PnvPanelWebApplicationFactory.cs @@ -20,8 +20,7 @@ public sealed class PnvPanelWebApplicationFactory : WebApplicationFactory