Updated dependencies and project to C# 12 Added primary constructors and many other refactorings
This commit is contained in:
@ -6,25 +6,27 @@
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0"/>
|
||||
<PackageReference Include="NUnit" Version="3.14.0"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.9.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\pac-man-board-game\pac-man-board-game.csproj" />
|
||||
<ProjectReference Include="..\pac-man-board-game\pac-man-board-game.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -51,4 +51,26 @@ public class GameControllerTests
|
||||
else
|
||||
Assert.Fail("Result is not an ArraySegment<byte>");
|
||||
}
|
||||
|
||||
#region DoAction(ActionMessage message)
|
||||
|
||||
[Test]
|
||||
public void DoAction_NegativeAction()
|
||||
{
|
||||
const string data = "Nothing happens";
|
||||
var message = new ActionMessage { Action = (GameAction)(-1), Data = data };
|
||||
_controller.DoAction(message);
|
||||
Assert.That(message.Data, Is.EqualTo(data));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DoAction_OutOfBoundsAction()
|
||||
{
|
||||
const string data = "Nothing happens";
|
||||
var message = new ActionMessage { Action = (GameAction)100, Data = data };
|
||||
_controller.DoAction(message);
|
||||
Assert.That(message.Data, Is.EqualTo(data));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ using System.Text.Json;
|
||||
using BackendTests.TestUtils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using pacMan.DTOs;
|
||||
using pacMan.Exceptions;
|
||||
using pacMan.GameStuff;
|
||||
using pacMan.GameStuff.Items;
|
||||
@ -99,28 +100,6 @@ public class ActionServiceTests
|
||||
|
||||
#endregion
|
||||
|
||||
#region DoAction(ActionMessage message)
|
||||
|
||||
[Test]
|
||||
public void DoAction_NegativeAction()
|
||||
{
|
||||
const string data = "Nothing happens";
|
||||
var message = new ActionMessage { Action = (GameAction)(-1), Data = data };
|
||||
_service.DoAction(message);
|
||||
Assert.That(message.Data, Is.EqualTo(data));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DoAction_OutOfBoundsAction()
|
||||
{
|
||||
const string data = "Nothing happens";
|
||||
var message = new ActionMessage { Action = (GameAction)100, Data = data };
|
||||
_service.DoAction(message);
|
||||
Assert.That(message.Data, Is.EqualTo(data));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ready()
|
||||
|
||||
[Test]
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System.Net.WebSockets;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using pacMan.Interfaces;
|
||||
using pacMan.Services;
|
||||
using pacMan.Utils;
|
||||
|
||||
|
Reference in New Issue
Block a user