From f1c1ee9751a75e0d7a3b5710ae7aa76581ea4cf6 Mon Sep 17 00:00:00 2001 From: Rick Su <35659961+ricksu978@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:36:24 +1100 Subject: [PATCH] nuget and .net8 upgrade --- .../src/Application/Common/GameEventBus.cs | 1 - .../Application/Common/IGameEventHandler.cs | 4 +-- .../src/Application/Common/IPresenter.cs | 4 +-- src/BackEnd/src/Application/Common/Policy.cs | 1 - src/BackEnd/src/Application/GlobalUsing.cs | 1 + .../Application/UseCases/CreateGameUseCase.cs | 1 - .../Application/UseCases/GetGameUseCase.cs | 1 - .../Application/UseCases/StartGameUseCase.cs | 1 - .../Wsa.Gaas.Werewolf.Application.csproj | 6 ++--- .../Domain/Wsa.Gaas.Werewolf.Domain.csproj | 13 +--------- ...a.Gaas.Werewolf.EntityFrameworkCore.csproj | 8 +++--- .../src/InterfaceAdapter/WebApi/Program.cs | 3 +-- .../WebApi/Wsa.Gaas.Werewolf.WebApi.csproj | 12 ++++----- .../EntityFrameworkCoreTest/RepositoryTest.cs | 7 +++++- .../Wsa.Gaas.Werewolf.WebApiTests.csproj | 25 ++++++++----------- 15 files changed, 34 insertions(+), 54 deletions(-) diff --git a/src/BackEnd/src/Application/Common/GameEventBus.cs b/src/BackEnd/src/Application/Common/GameEventBus.cs index abc4f77..18ffa5d 100644 --- a/src/BackEnd/src/Application/Common/GameEventBus.cs +++ b/src/BackEnd/src/Application/Common/GameEventBus.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using Wsa.Gaas.Werewolf.Domain.Common; namespace Wsa.Gaas.Werewolf.Application.Common; public class GameEventBus diff --git a/src/BackEnd/src/Application/Common/IGameEventHandler.cs b/src/BackEnd/src/Application/Common/IGameEventHandler.cs index 46a0da4..cf3ea31 100644 --- a/src/BackEnd/src/Application/Common/IGameEventHandler.cs +++ b/src/BackEnd/src/Application/Common/IGameEventHandler.cs @@ -1,6 +1,4 @@ -using Wsa.Gaas.Werewolf.Domain.Common; - -namespace Wsa.Gaas.Werewolf.Application.Common; +namespace Wsa.Gaas.Werewolf.Application.Common; public interface IGameEventHandler { Task Handle(GameEvent events, CancellationToken cancellationToken = default); diff --git a/src/BackEnd/src/Application/Common/IPresenter.cs b/src/BackEnd/src/Application/Common/IPresenter.cs index b71c60b..f4c8486 100644 --- a/src/BackEnd/src/Application/Common/IPresenter.cs +++ b/src/BackEnd/src/Application/Common/IPresenter.cs @@ -1,6 +1,4 @@ -using Wsa.Gaas.Werewolf.Domain.Common; - -namespace Wsa.Gaas.Werewolf.Application.Common; +namespace Wsa.Gaas.Werewolf.Application.Common; public interface IPresenter where TGameEvent : GameEvent { diff --git a/src/BackEnd/src/Application/Common/Policy.cs b/src/BackEnd/src/Application/Common/Policy.cs index 8a3fafb..1294ff2 100644 --- a/src/BackEnd/src/Application/Common/Policy.cs +++ b/src/BackEnd/src/Application/Common/Policy.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using Wsa.Gaas.Werewolf.Application.Options; -using Wsa.Gaas.Werewolf.Domain.Common; namespace Wsa.Gaas.Werewolf.Application.Common; internal abstract class Policy : IGameEventHandler diff --git a/src/BackEnd/src/Application/GlobalUsing.cs b/src/BackEnd/src/Application/GlobalUsing.cs index 5649e93..02ed2d6 100644 --- a/src/BackEnd/src/Application/GlobalUsing.cs +++ b/src/BackEnd/src/Application/GlobalUsing.cs @@ -1,3 +1,4 @@ global using Wsa.Gaas.Werewolf.Application.Common; +global using Wsa.Gaas.Werewolf.Domain.Common; global using Wsa.Gaas.Werewolf.Domain.Events; global using Wsa.Gaas.Werewolf.Domain.Exceptions; diff --git a/src/BackEnd/src/Application/UseCases/CreateGameUseCase.cs b/src/BackEnd/src/Application/UseCases/CreateGameUseCase.cs index ce905c7..7e04495 100644 --- a/src/BackEnd/src/Application/UseCases/CreateGameUseCase.cs +++ b/src/BackEnd/src/Application/UseCases/CreateGameUseCase.cs @@ -1,5 +1,4 @@ using Wsa.Gaas.Werewolf.Application.Dtos; -using Wsa.Gaas.Werewolf.Domain.Common; using Wsa.Gaas.Werewolf.Domain.Objects; namespace Wsa.Gaas.Werewolf.Application.UseCases; diff --git a/src/BackEnd/src/Application/UseCases/GetGameUseCase.cs b/src/BackEnd/src/Application/UseCases/GetGameUseCase.cs index 4130f86..25fd7ad 100644 --- a/src/BackEnd/src/Application/UseCases/GetGameUseCase.cs +++ b/src/BackEnd/src/Application/UseCases/GetGameUseCase.cs @@ -1,5 +1,4 @@ using Wsa.Gaas.Werewolf.Application.Dtos; -using Wsa.Gaas.Werewolf.Domain.Common; using Wsa.Gaas.Werewolf.Domain.Objects; namespace Wsa.Gaas.Werewolf.Application.UseCases; diff --git a/src/BackEnd/src/Application/UseCases/StartGameUseCase.cs b/src/BackEnd/src/Application/UseCases/StartGameUseCase.cs index ae305e5..6ec6b8a 100644 --- a/src/BackEnd/src/Application/UseCases/StartGameUseCase.cs +++ b/src/BackEnd/src/Application/UseCases/StartGameUseCase.cs @@ -1,5 +1,4 @@ using Wsa.Gaas.Werewolf.Application.Dtos; -using Wsa.Gaas.Werewolf.Domain.Common; using Wsa.Gaas.Werewolf.Domain.Objects; namespace Wsa.Gaas.Werewolf.Application.UseCases; diff --git a/src/BackEnd/src/Application/Wsa.Gaas.Werewolf.Application.csproj b/src/BackEnd/src/Application/Wsa.Gaas.Werewolf.Application.csproj index f9b2e87..62ff1db 100644 --- a/src/BackEnd/src/Application/Wsa.Gaas.Werewolf.Application.csproj +++ b/src/BackEnd/src/Application/Wsa.Gaas.Werewolf.Application.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable @@ -11,8 +11,8 @@ - - + + diff --git a/src/BackEnd/src/Domain/Wsa.Gaas.Werewolf.Domain.csproj b/src/BackEnd/src/Domain/Wsa.Gaas.Werewolf.Domain.csproj index df7089f..69c4685 100644 --- a/src/BackEnd/src/Domain/Wsa.Gaas.Werewolf.Domain.csproj +++ b/src/BackEnd/src/Domain/Wsa.Gaas.Werewolf.Domain.csproj @@ -1,22 +1,11 @@  - net7.0 + net8.0 enable enable - - - - - - - - - - - diff --git a/src/BackEnd/src/InterfaceAdapter/EntityFrameworkCore/Wsa.Gaas.Werewolf.EntityFrameworkCore.csproj b/src/BackEnd/src/InterfaceAdapter/EntityFrameworkCore/Wsa.Gaas.Werewolf.EntityFrameworkCore.csproj index 16fa159..d245619 100644 --- a/src/BackEnd/src/InterfaceAdapter/EntityFrameworkCore/Wsa.Gaas.Werewolf.EntityFrameworkCore.csproj +++ b/src/BackEnd/src/InterfaceAdapter/EntityFrameworkCore/Wsa.Gaas.Werewolf.EntityFrameworkCore.csproj @@ -1,15 +1,15 @@  - net7.0 + net8.0 enable enable - - - + + + diff --git a/src/BackEnd/src/InterfaceAdapter/WebApi/Program.cs b/src/BackEnd/src/InterfaceAdapter/WebApi/Program.cs index 04eeb79..12a1fc9 100644 --- a/src/BackEnd/src/InterfaceAdapter/WebApi/Program.cs +++ b/src/BackEnd/src/InterfaceAdapter/WebApi/Program.cs @@ -1,6 +1,5 @@ global using Wsa.Gaas.Werewolf.Application.UseCases; using FastEndpoints; -using FastEndpoints.Swagger; using System.Text.Json.Serialization; using Wsa.Gaas.Werewolf.Application; using Wsa.Gaas.Werewolf.Application.Common; @@ -36,6 +35,6 @@ // Swagger app.UseOpenApi(); -app.UseSwaggerUi3(c => c.ConfigureDefaults()); +//app.UseSwaggerUi3(c => c.ConfigureDefaults()); app.Run(); diff --git a/src/BackEnd/src/InterfaceAdapter/WebApi/Wsa.Gaas.Werewolf.WebApi.csproj b/src/BackEnd/src/InterfaceAdapter/WebApi/Wsa.Gaas.Werewolf.WebApi.csproj index f1efd9b..7f5baef 100644 --- a/src/BackEnd/src/InterfaceAdapter/WebApi/Wsa.Gaas.Werewolf.WebApi.csproj +++ b/src/BackEnd/src/InterfaceAdapter/WebApi/Wsa.Gaas.Werewolf.WebApi.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable @@ -11,11 +11,11 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BackEnd/test/WebApiTests/TDD/EntityFrameworkCoreTest/RepositoryTest.cs b/src/BackEnd/test/WebApiTests/TDD/EntityFrameworkCoreTest/RepositoryTest.cs index a19b122..386f843 100644 --- a/src/BackEnd/test/WebApiTests/TDD/EntityFrameworkCoreTest/RepositoryTest.cs +++ b/src/BackEnd/test/WebApiTests/TDD/EntityFrameworkCoreTest/RepositoryTest.cs @@ -17,6 +17,11 @@ public void OneTimeSetUp() var repository = GetRepository(); repository.Initialize(); } + [OneTimeTearDown] + public void OneTimeTearDown() + { + _provider.Dispose(); + } private IRepository GetRepository() { @@ -32,7 +37,7 @@ public async Task SaveTest() var game = new Game(); repository.Save(game); - game.StartGame(new ulong[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }); + game.StartGame([1, 2, 3, 4, 5, 6, 7, 8, 9]); repository.Save(game); game.CurrentSpeakingPlayerId = game.Players.First(x => x.UserId == 3).Id; diff --git a/src/BackEnd/test/WebApiTests/Wsa.Gaas.Werewolf.WebApiTests.csproj b/src/BackEnd/test/WebApiTests/Wsa.Gaas.Werewolf.WebApiTests.csproj index 106d0fc..ba97cf7 100644 --- a/src/BackEnd/test/WebApiTests/Wsa.Gaas.Werewolf.WebApiTests.csproj +++ b/src/BackEnd/test/WebApiTests/Wsa.Gaas.Werewolf.WebApiTests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable @@ -9,15 +9,15 @@ - - - - - - - + + + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -26,7 +26,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -36,9 +36,4 @@ - - - - -