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.
This commit is contained in:
@@ -1,46 +1,43 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="FluentValidation" Version="12.1.1" />
|
<PackageVersion Include="FluentValidation" Version="12.1.1" />
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.10" />
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="10.0.10" />
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.11" />
|
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.11" />
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.10" />
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.10" />
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.10" />
|
||||||
<PackageVersion
|
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="10.0.10" />
|
||||||
Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore"
|
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.10" />
|
||||||
Version="10.0.9"
|
<!-- Держим 2.x: Microsoft.AspNetCore.OpenApi 10.0.10 сам зависит от Microsoft.OpenApi >=2.0.0
|
||||||
/>
|
(nuspec) и его Roslyn source generator (XmlCommentGenerator) скомпилирован под 2.x API —
|
||||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.9" />
|
3.x меняет IOpenApiMediaType.Example на read-only и ломает генерацию (CS0200). -->
|
||||||
<PackageVersion Include="Microsoft.OpenApi" Version="2.9.0" />
|
<PackageVersion Include="Microsoft.OpenApi" Version="2.11.0" />
|
||||||
<PackageVersion Include="Scalar.AspNetCore" Version="2.16.7" />
|
<PackageVersion Include="Scalar.AspNetCore" Version="2.16.16" />
|
||||||
<PackageVersion Include="Serilog.AspNetCore" Version="10.0.0" />
|
<PackageVersion Include="Serilog.AspNetCore" Version="10.0.0" />
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.10" />
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.9">
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.10">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageVersion>
|
</PackageVersion>
|
||||||
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.2" />
|
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
||||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.9" />
|
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.10" />
|
||||||
<PackageVersion
|
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.10" />
|
||||||
Include="Microsoft.Extensions.DependencyInjection.Abstractions"
|
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.21.0" />
|
||||||
Version="10.0.9"
|
<PackageVersion Include="Telegram.Bot" Version="22.10.2" />
|
||||||
/>
|
<PackageVersion Include="ThreeXui.Net" Version="1.0.2" />
|
||||||
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.19.1" />
|
<!-- Тестирование (M8) -->
|
||||||
<PackageVersion Include="Telegram.Bot" Version="22.10.1" />
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
|
||||||
<PackageVersion Include="ThreeXui.Net" Version="1.0.2" />
|
<PackageVersion Include="xunit" Version="2.9.3" />
|
||||||
<!-- Тестирование (M8) -->
|
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
|
||||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
<PackageVersion Include="NSubstitute" Version="6.0.0" />
|
||||||
<PackageVersion Include="xunit" Version="2.9.3" />
|
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.10" />
|
||||||
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
|
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.13.0" />
|
||||||
<PackageVersion Include="NSubstitute" Version="5.3.0" />
|
<!-- InMemory, не Sqlite/Npgsql — модель использует Postgres-специфичные типы (uuid[], jsonb),
|
||||||
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.9" />
|
не имеющие реляционных аналогов; InMemory игнорирует HasColumnType и не требует их маппинга. -->
|
||||||
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.2.0" />
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.10" />
|
||||||
<!-- InMemory, не Sqlite/Npgsql — модель использует Postgres-специфичные типы (uuid[], jsonb),
|
</ItemGroup>
|
||||||
не имеющие реляционных аналогов; InMemory игнорирует HasColumnType и не требует их маппинга. -->
|
</Project>
|
||||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
+1
-1
@@ -74,7 +74,7 @@ public class GrantBillingGiftCommandHandlerTests
|
|||||||
.Received(1)
|
.Received(1)
|
||||||
.NotifyUserAsync(
|
.NotifyUserAsync(
|
||||||
userId,
|
userId,
|
||||||
Arg.Is<string>(m => m.Contains("30")),
|
Arg.Is<string>(m => m!.Contains("30")),
|
||||||
Arg.Any<string?>(),
|
Arg.Any<string?>(),
|
||||||
Arg.Any<CancellationToken>()
|
Arg.Any<CancellationToken>()
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ public class RejectPaymentRequestCommandHandlerTests
|
|||||||
.Received(1)
|
.Received(1)
|
||||||
.NotifyUserAsync(
|
.NotifyUserAsync(
|
||||||
userId,
|
userId,
|
||||||
Arg.Is<string>(m => m.Contains("Платёж не найден")),
|
Arg.Is<string>(m => m!.Contains("Платёж не найден")),
|
||||||
Arg.Any<string?>(),
|
Arg.Any<string?>(),
|
||||||
Arg.Any<CancellationToken>()
|
Arg.Any<CancellationToken>()
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -118,7 +118,7 @@ public class BlockUserCommandHandlerTests
|
|||||||
await _gateway
|
await _gateway
|
||||||
.Received(1)
|
.Received(1)
|
||||||
.UpdateClientAsync(
|
.UpdateClientAsync(
|
||||||
Arg.Is<Node>(n => n.Id == node.Id),
|
Arg.Is<Node>(n => n!.Id == node.Id),
|
||||||
inbound.RemoteInboundId,
|
inbound.RemoteInboundId,
|
||||||
config.ClientExternalId,
|
config.ClientExternalId,
|
||||||
config.Protocol,
|
config.Protocol,
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ public class DeleteUserCommandHandlerTests
|
|||||||
await _gateway
|
await _gateway
|
||||||
.Received(1)
|
.Received(1)
|
||||||
.RemoveClientAsync(
|
.RemoveClientAsync(
|
||||||
Arg.Is<Node>(n => n.Id == node.Id),
|
Arg.Is<Node>(n => n!.Id == node.Id),
|
||||||
inbound.RemoteInboundId,
|
inbound.RemoteInboundId,
|
||||||
"external-id",
|
"external-id",
|
||||||
config.Protocol,
|
config.Protocol,
|
||||||
|
|||||||
+1
-2
@@ -20,8 +20,7 @@ public sealed class PnvPanelWebApplicationFactory : WebApplicationFactory<Progra
|
|||||||
public const string AdminUserName = "test-admin";
|
public const string AdminUserName = "test-admin";
|
||||||
public const string AdminPassword = "TestAdmin123!";
|
public const string AdminPassword = "TestAdmin123!";
|
||||||
|
|
||||||
private readonly PostgreSqlContainer _postgres = new PostgreSqlBuilder()
|
private readonly PostgreSqlContainer _postgres = new PostgreSqlBuilder("postgres:17-alpine")
|
||||||
.WithImage("postgres:17-alpine")
|
|
||||||
.WithDatabase("pnvpanel")
|
.WithDatabase("pnvpanel")
|
||||||
.WithUsername("pnvpanel")
|
.WithUsername("pnvpanel")
|
||||||
.WithPassword("pnvpanel")
|
.WithPassword("pnvpanel")
|
||||||
|
|||||||
Reference in New Issue
Block a user