ajout d'un peu de couverture de code
All checks were successful
Main Build Process / Build & Test (pull_request) Successful in 1m56s
check main state / build (8.0.x) (push) Successful in 1m17s
Main Build Process / Build & Test (push) Successful in 2m15s

This commit was merged in pull request #11.
This commit is contained in:
2024-08-29 22:20:28 +02:00
parent 3cb1973fd1
commit b5a6b1c653
7 changed files with 81 additions and 11 deletions

View 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());
}
}

View File

@@ -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" />