ajout d'un peu de couverture de code
This commit was merged in pull request #11.
This commit is contained in:
21
src/LittleTown.Core.Tests/ExceptionTesting.cs
Normal file
21
src/LittleTown.Core.Tests/ExceptionTesting.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using AutoMapper.Internal;
|
||||
using LittleTown.Core.Exceptions;
|
||||
using LittleTown.StaticDataAcces;
|
||||
|
||||
namespace LittleTown.Core.Tests;
|
||||
|
||||
public class ExceptionTesting
|
||||
{
|
||||
[Fact]
|
||||
public void ExceptionForStaticData()
|
||||
{
|
||||
StaticDataGetter getter = new StaticDataGetter("null", "null", "null");
|
||||
|
||||
|
||||
Assert.Throws<JsonException>(() => getter.GetBoard(1));
|
||||
Assert.Throws<JsonException>(() => getter.GetObjectives());
|
||||
Assert.Throws<JsonException>(() => getter.GetBuildings());
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="Microsoft.CodeCoverage" Version="17.11.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
|
||||
Reference in New Issue
Block a user