Introduce `RecClientTestBase` to streamline integration tests for `ReCClient`. This abstract class uses `WebApplicationFactory` to create a test server for `ReC.API` and configures a `ServiceProvider` with necessary services. It includes helper methods for creating scoped `ReCClient` instances and ensures proper resource cleanup via `IDisposable`. Update `ReC.Tests.csproj` to include: - `Microsoft.AspNetCore.Mvc.Testing` package for integration testing. - Project references to `ReC.API` and `ReC.Client` for testing purposes. These changes establish a reusable and maintainable testing infrastructure.
37 lines
1.4 KiB
XML
37 lines
1.4 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net8.0</TargetFramework>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<Nullable>enable</Nullable>
|
|
|
|
<IsPackable>false</IsPackable>
|
|
<IsTestProject>true</IsTestProject>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
|
<PackageReference Include="MediatR" Version="14.0.0" />
|
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
|
|
<PackageReference Include="Moq" Version="4.20.72" />
|
|
<PackageReference Include="NUnit" Version="3.14.0" />
|
|
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
|
|
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\..\src\ReC.API\ReC.API.csproj" />
|
|
<ProjectReference Include="..\..\src\ReC.Application\ReC.Application.csproj" />
|
|
<ProjectReference Include="..\..\src\ReC.Client\ReC.Client.csproj" />
|
|
<ProjectReference Include="..\..\src\ReC.Infrastructure\ReC.Infrastructure.csproj" />
|
|
<ProjectReference Include="..\..\src\ReC.Domain\ReC.Domain.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Using Include="NUnit.Framework" />
|
|
</ItemGroup>
|
|
|
|
</Project>
|