Creation de la solution et de la classe Match
This commit was merged in pull request #2.
This commit is contained in:
1
src/LittleTown.Core.Tests/GlobalUsings.cs
Normal file
1
src/LittleTown.Core.Tests/GlobalUsings.cs
Normal file
@@ -0,0 +1 @@
|
||||
global using Xunit;
|
||||
29
src/LittleTown.Core.Tests/LittleTown.Core.Tests.csproj
Normal file
29
src/LittleTown.Core.Tests/LittleTown.Core.Tests.csproj
Normal 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>
|
||||
18
src/LittleTown.Core.Tests/MatchTesting.cs
Normal file
18
src/LittleTown.Core.Tests/MatchTesting.cs
Normal 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); });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user