Rename WebApi project to Vegasco.Server.Api
All checks were successful
continuous-integration/drone/push Build is passing

And update all references including comments etc.
This commit is contained in:
2025-06-12 18:22:37 +02:00
parent 9d71c86474
commit a1999bfe41
71 changed files with 177 additions and 224 deletions

View File

@@ -1,7 +1,7 @@
using Bogus;
using Vegasco.WebApi.Cars;
using Vegasco.Server.Api.Cars;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
internal class CarFaker
{

View File

@@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Cars;
namespace Vegasco.Server.Api.Tests.Integration.Cars;
[Collection(SharedTestCollection.Name)]
public class CreateCarTests : IAsyncLifetime

View File

@@ -2,10 +2,10 @@
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Cars;
namespace Vegasco.Server.Api.Tests.Integration.Cars;
[Collection(SharedTestCollection.Name)]
public class DeleteCarTests : IAsyncLifetime

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.Server.Api.Cars;
namespace WebApi.Tests.Integration.Cars;
namespace Vegasco.Server.Api.Tests.Integration.Cars;
[Collection(SharedTestCollection.Name)]
public class GetCarTests : IAsyncLifetime

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.Server.Api.Cars;
namespace WebApi.Tests.Integration.Cars;
namespace Vegasco.Server.Api.Tests.Integration.Cars;
[Collection(SharedTestCollection.Name)]
public class GetCarsTests : IAsyncLifetime

View File

@@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Cars;
namespace Vegasco.Server.Api.Tests.Integration.Cars;
[Collection(SharedTestCollection.Name)]
public class UpdateCarTests : IAsyncLifetime

View File

@@ -1,7 +1,7 @@
using Bogus;
using Vegasco.WebApi.Consumptions;
using Vegasco.Server.Api.Consumptions;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
internal class ConsumptionFaker
{

View File

@@ -3,11 +3,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Consumptions;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Consumptions;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration.Consumptions;
[Collection(SharedTestCollection.Name)]
public class CreateConsumptionTests : IAsyncLifetime

View File

@@ -2,11 +2,11 @@
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Consumptions;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Consumptions;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration.Consumptions;
[Collection(SharedTestCollection.Name)]
public class DeleteConsumptionTests : IAsyncLifetime

View File

@@ -2,11 +2,11 @@
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Consumptions;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Consumptions;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration.Consumptions;
[Collection(SharedTestCollection.Name)]
public class GetConsumptionTests : IAsyncLifetime

View File

@@ -2,11 +2,11 @@
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Consumptions;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Consumptions;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration.Consumptions;
[Collection(SharedTestCollection.Name)]
public class GetConsumptionsTests : IAsyncLifetime

View File

@@ -3,11 +3,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System.Net;
using System.Net.Http.Json;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Consumptions;
using Vegasco.WebApi.Persistence;
using Vegasco.Server.Api.Cars;
using Vegasco.Server.Api.Consumptions;
using Vegasco.Server.Api.Persistence;
namespace WebApi.Tests.Integration.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration.Consumptions;
[Collection(SharedTestCollection.Name)]
public class UpdateConsumptionTests : IAsyncLifetime

View File

@@ -1,6 +1,7 @@
using FluentAssertions;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
internal static class FluentAssertionConfiguration
{
private const int DateTimeComparisonPrecision = 100;

View File

@@ -1,9 +1,9 @@
using System.Net.Http.Json;
using FluentAssertions;
using FluentAssertions.Extensions;
using Vegasco.WebApi.Info;
using Vegasco.Server.Api.Info;
namespace WebApi.Tests.Integration.Info;
namespace Vegasco.Server.Api.Tests.Integration.Info;
[Collection(SharedTestCollection.Name)]
public class GetServerInfoTests

View File

@@ -2,7 +2,7 @@
using Respawn;
using System.Data.Common;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
internal sealed class PostgresRespawner : IDisposable
{
private readonly DbConnection _connection;

View File

@@ -1,4 +1,4 @@
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
[CollectionDefinition(Name)]
public class SharedTestCollection : ICollectionFixture<WebAppFactory>

View File

@@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Authorization.Policy;
using Microsoft.AspNetCore.Http;
using System.Security.Claims;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
public sealed class TestUserAlwaysAuthorizedPolicyEvaluator : IPolicyEvaluator
{

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
@@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="8.3.0" />
<PackageReference Include="FluentAssertions" Version="[7.2.0,8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
@@ -32,7 +32,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Vegasco.Server.AppHost.Shared\Vegasco.Server.AppHost.Shared.csproj" />
<ProjectReference Include="..\..\src\WebApi\WebApi.csproj" />
<ProjectReference Include="..\..\src\Vegasco.Server.Api\Vegasco.Server.Api.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -7,11 +7,11 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Testcontainers.PostgreSql;
using Vegasco.WebApi.Common;
using Vegasco.Server.Api.Common;
namespace WebApi.Tests.Integration;
namespace Vegasco.Server.Api.Tests.Integration;
public sealed class WebAppFactory : WebApplicationFactory<IWebApiMarker>, IAsyncLifetime
public sealed class WebAppFactory : WebApplicationFactory<IApiMarker>, IAsyncLifetime
{
private readonly PostgreSqlContainer _database = new PostgreSqlBuilder()
.WithImage(DockerImage)
@@ -38,7 +38,7 @@ public sealed class WebAppFactory : WebApplicationFactory<IWebApiMarker>, IAsync
{
IEnumerable<KeyValuePair<string, string?>> customConfig =
[
new KeyValuePair<string, string?>($"ConnectionStrings:{Vegasco.Server.AppHost.Shared.Constants.Database.Name}", _database.GetConnectionString()),
new KeyValuePair<string, string?>($"ConnectionStrings:{AppHost.Shared.Constants.Database.Name}", _database.GetConnectionString()),
new KeyValuePair<string, string?>("JWT:ValidAudience", "https://localhost"),
new KeyValuePair<string, string?>("JWT:MetadataUrl", "https://localhost"),
new KeyValuePair<string, string?>("JWT:NameClaimType", null),

View File

@@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using NSubstitute;
using System.Security.Claims;
using Vegasco.WebApi.Authentication;
using Vegasco.Server.Api.Authentication;
namespace WebApi.Tests.Unit.Authentication;
namespace Vegasco.Server.Api.Tests.Unit.Authentication;
public sealed class UserAccessorTests
{
private readonly UserAccessor _sut;

View File

@@ -1,8 +1,8 @@
using FluentAssertions;
using FluentValidation.Results;
using Vegasco.WebApi.Cars;
using Vegasco.Server.Api.Cars;
namespace WebApi.Tests.Unit.Cars;
namespace Vegasco.Server.Api.Tests.Unit.Cars;
public sealed class CreateCarRequestValidatorTests
{

View File

@@ -1,8 +1,8 @@
using FluentAssertions;
using FluentValidation.Results;
using Vegasco.WebApi.Cars;
using Vegasco.Server.Api.Cars;
namespace WebApi.Tests.Unit.Cars;
namespace Vegasco.Server.Api.Tests.Unit.Cars;
public sealed class UpdateCarRequestValidatorTests
{

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using FluentValidation.Results;
using NSubstitute;
using Vegasco.WebApi.Consumptions;
using Vegasco.Server.Api.Consumptions;
namespace WebApi.Tests.Unit.Consumptions;
namespace Vegasco.Server.Api.Tests.Unit.Consumptions;
public class CreateConsumptionRequestValidatorTests
{
private readonly CreateConsumption.Validator _sut;

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using FluentValidation.Results;
using NSubstitute;
using Vegasco.WebApi.Consumptions;
using Vegasco.Server.Api.Consumptions;
namespace WebApi.Tests.Unit.Consumptions;
namespace Vegasco.Server.Api.Tests.Unit.Consumptions;
public class UpdateConsumptionRequestValidatorTests
{

View File

@@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\WebApi\WebApi.csproj" />
<ProjectReference Include="..\..\src\Vegasco.Server.Api\Vegasco.Server.Api.csproj" />
</ItemGroup>
<ItemGroup>