Creation de la solution et de la classe Match

This commit was merged in pull request #2.
This commit is contained in:
2024-05-20 22:50:42 +02:00
parent 0b1fd87037
commit 9567423195
10 changed files with 138 additions and 1 deletions

View File

@@ -0,0 +1 @@
global using Xunit;

View File

@@ -0,0 +1,29 @@
<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="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LittleTown.Core\LittleTown.Core.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
namespace LittleTown.Core.Tests;
public class MatchTesting
{
[Fact]
public void EnforcePlayerCountInMatchCreation()
{
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(1); });
Match match2Player = new Match(2);
Match match3Player = new Match(3);
Match match4Player = new Match(4);
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(5); });
}
}