You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
using Api_lol.Controllers;
|
|
using DTO;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using StubLib;
|
|
using System.Net.Http.Json;
|
|
using System.Reflection;
|
|
|
|
namespace TestUnitaireApi
|
|
{
|
|
public class TestChampions
|
|
{
|
|
StubData stubChamps;
|
|
Champions controlleurChampion;
|
|
|
|
public TestChampions()
|
|
{
|
|
this.stubChamps = new StubData();
|
|
this.controlleurChampion = new Champions(null,stubChamps);
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public async Task TestGetChampions()
|
|
{
|
|
var liste = await controlleurChampion.Get();
|
|
|
|
OkObjectResult tmp = liste as OkObjectResult;
|
|
if (tmp == null)
|
|
{
|
|
//Assert.Fail("Liste okObject == null");
|
|
return;
|
|
}
|
|
IEnumerable<DtoChampions> listeChamp = tmp.Value as IEnumerable<DtoChampions>;
|
|
if (listeChamp == null)
|
|
{
|
|
//Assert.Fail("Liste champ == null");
|
|
return;
|
|
}
|
|
//Assert.Equal(6,listeChamp.Count());
|
|
}
|
|
}
|
|
} |