diff --git a/.idea/.idea.pac-man-board-game/.idea/codeStyles/codeStyleConfig.xml b/.idea/.idea.pac-man-board-game/.idea/codeStyles/codeStyleConfig.xml
index 79ee123..6e6eec1 100644
--- a/.idea/.idea.pac-man-board-game/.idea/codeStyles/codeStyleConfig.xml
+++ b/.idea/.idea.pac-man-board-game/.idea/codeStyles/codeStyleConfig.xml
@@ -1,5 +1,6 @@
+
\ No newline at end of file
diff --git a/BackendTests/BackendTests.csproj b/BackendTests/BackendTests.csproj
index 98fa5fa..70244b5 100644
--- a/BackendTests/BackendTests.csproj
+++ b/BackendTests/BackendTests.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net8.0
enable
enable
@@ -13,7 +13,7 @@
-
+
all
diff --git a/BackendTests/Services/ActionServiceTests.cs b/BackendTests/Services/ActionServiceTests.cs
index 258fe95..2bfb42d 100644
--- a/BackendTests/Services/ActionServiceTests.cs
+++ b/BackendTests/Services/ActionServiceTests.cs
@@ -10,8 +10,7 @@ using pacMan.Services;
namespace BackendTests.Services;
-[TestFixture]
-[TestOf(nameof(ActionService))]
+[TestFixture, TestOf(nameof(ActionService))]
public class ActionServiceTests
{
[SetUp]
@@ -157,7 +156,7 @@ public class ActionServiceTests
public void FindNextPlayer_NoPlayers()
{
_service.Game = new pacMan.Services.Game(new Queue());
- Assert.Throws(() => _service.FindNextPlayer());
+ Assert.Throws(() => _service.FindNextPlayer());
}
[Test]
diff --git a/BackendTests/Services/GameTests.cs b/BackendTests/Services/GameTests.cs
index 444dc4f..41f5ff8 100644
--- a/BackendTests/Services/GameTests.cs
+++ b/BackendTests/Services/GameTests.cs
@@ -6,8 +6,7 @@ using pacMan.Utils;
namespace BackendTests.Services;
-[TestFixture]
-[TestOf(nameof(pacMan.Services.Game))]
+[TestFixture, TestOf(nameof(pacMan.Services.Game))]
public class GameTests
{
[SetUp]
@@ -56,7 +55,7 @@ public class GameTests
[Test]
public void NextPlayer_WhenEmpty()
{
- Assert.Throws(() => _game.NextPlayer());
+ Assert.Throws(() => _game.NextPlayer());
}
[Test]
diff --git a/DataAccessLayer/DataAccessLayer.csproj b/DataAccessLayer/DataAccessLayer.csproj
index dd09258..76ba19a 100644
--- a/DataAccessLayer/DataAccessLayer.csproj
+++ b/DataAccessLayer/DataAccessLayer.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net8.0
enable
enable
DAL
diff --git a/pac-man-board-game/DTOs/DTO.cs b/pac-man-board-game/DTOs/DTO.cs
index 8cb82f8..1316faf 100644
--- a/pac-man-board-game/DTOs/DTO.cs
+++ b/pac-man-board-game/DTOs/DTO.cs
@@ -5,11 +5,9 @@ using pacMan.GameStuff.Items;
namespace pacMan.DTOs;
public readonly record struct JoinGameData(
- [property: JsonInclude]
- [property: JsonPropertyName("username")]
+ [property: JsonInclude, JsonPropertyName("username"), JsonRequired]
string Username,
- [property: JsonInclude]
- [property: JsonPropertyName("gameId")]
+ [property: JsonInclude, JsonPropertyName("gameId"), JsonRequired]
Guid GameId
)
{
@@ -17,34 +15,26 @@ public readonly record struct JoinGameData(
}
public readonly record struct CreateGameData(
- [property: JsonInclude]
- [property: JsonPropertyName("player")]
+ [property: JsonInclude, JsonPropertyName("player"), JsonRequired]
Player Player,
- [property: JsonInclude]
- [property: JsonPropertyName("spawns")]
+ [property: JsonInclude, JsonPropertyName("spawns"), JsonRequired]
Queue Spawns
);
public readonly record struct ReadyData(
- [property: JsonInclude]
- [property: JsonPropertyName("allReady")]
+ [property: JsonInclude, JsonPropertyName("allReady"), JsonRequired]
bool AllReady,
- [property: JsonInclude]
- [property: JsonPropertyName("players")]
+ [property: JsonInclude, JsonPropertyName("players"), JsonRequired]
IEnumerable Players
);
public readonly record struct MovePlayerData(
- [property: JsonInclude]
- [property: JsonPropertyName("players")]
+ [property: JsonInclude, JsonPropertyName("players"), JsonRequired]
List Players,
- [property: JsonInclude]
- [property: JsonPropertyName("ghosts")]
+ [property: JsonInclude, JsonPropertyName("ghosts"), JsonRequired]
List Ghosts,
- [property: JsonInclude]
- [property: JsonPropertyName("dice")]
+ [property: JsonInclude, JsonPropertyName("dice"), JsonRequired]
List Dice,
- [property: JsonInclude]
- [property: JsonPropertyName("eatenPellets")]
+ [property: JsonInclude, JsonPropertyName("eatenPellets"), JsonRequired]
List EatenPellets
);
diff --git a/pac-man-board-game/Services/ActionService.cs b/pac-man-board-game/Services/ActionService.cs
index 9a3d193..0fd2172 100644
--- a/pac-man-board-game/Services/ActionService.cs
+++ b/pac-man-board-game/Services/ActionService.cs
@@ -24,7 +24,7 @@ public interface IActionService
///
/// Provides various actions that can be performed in a game
///
-public class ActionService(ILogger logger, IGameService gameService) : IActionService
+public class ActionService(ILogger logger, IGameService gameService) : IActionService
{
public WebSocket WebSocket { private get; set; } = null!;
diff --git a/pac-man-board-game/Services/GameService.cs b/pac-man-board-game/Services/GameService.cs
index 2ca4f53..2fa6b03 100644
--- a/pac-man-board-game/Services/GameService.cs
+++ b/pac-man-board-game/Services/GameService.cs
@@ -17,7 +17,7 @@ public interface IGameService : IWebSocketService
/// The GameService class provides functionality for managing games in a WebSocket environment. It inherits from the
/// WebSocketService class.
///
-public class GameService(ILogger logger) : WebSocketService(logger), IGameService
+public class GameService(ILogger logger) : WebSocketService(logger), IGameService
{
///
/// A thread-safe collection (SynchronizedCollection) of "Game" objects. Utilized for managing multiple game instances
diff --git a/pac-man-board-game/Services/WebSocketService.cs b/pac-man-board-game/Services/WebSocketService.cs
index ecbf8ef..a348fea 100644
--- a/pac-man-board-game/Services/WebSocketService.cs
+++ b/pac-man-board-game/Services/WebSocketService.cs
@@ -13,7 +13,7 @@ public interface IWebSocketService
///
/// WebSocketService class provides methods to send, receive and close a WebSocket connection.
///
-public class WebSocketService(ILogger logger) : IWebSocketService
+public class WebSocketService(ILogger logger) : IWebSocketService
{
///
/// Sends the specified byte array as a text message through the WebSocket connection.
diff --git a/pac-man-board-game/pac-man-board-game.csproj b/pac-man-board-game/pac-man-board-game.csproj
index e5ed925..8c03a07 100644
--- a/pac-man-board-game/pac-man-board-game.csproj
+++ b/pac-man-board-game/pac-man-board-game.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net8.0
enable
true
Latest