merge
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
baf7343420
@ -1,41 +0,0 @@
|
||||
using API_LoL.Controllers;
|
||||
using DTO;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Model;
|
||||
using StubLib;
|
||||
|
||||
namespace Api_UT
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
public async Task TestGet()
|
||||
{
|
||||
List<ChampionDTO> list = new List<ChampionDTO> {new ChampionDTO("Akali","",""), new ChampionDTO("Aatrox", "", ""), new ChampionDTO("Ahri", "", ""), new ChampionDTO("Akshan", "", ""), new ChampionDTO("Bard", "", ""), new ChampionDTO("Alistar", "", "") };
|
||||
ChampionsController api = new ChampionsController(new StubData());
|
||||
IActionResult a = await api.Get();
|
||||
|
||||
/// utilisation du nuggets fluentAssertion
|
||||
//Assert.IsNotNull(a);
|
||||
a.Should().NotBeNull();
|
||||
//Assert.AreEqual(list,((OkObjectResult)a).Value);
|
||||
var aObject = a as OkObjectResult;
|
||||
aObject.Should().NotBeNull();
|
||||
var championresult = aObject.Value as IEnumerable<ChampionDTO>;
|
||||
list.Should().BeEquivalentTo(championresult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TestPostValid()
|
||||
{
|
||||
ChampionsController api = new ChampionsController(new StubData());
|
||||
IActionResult a = await api.Post(new ChampionDTO("nom","bio","icon"));
|
||||
Assert.IsNotNull(a);
|
||||
ChampionDTO champ = new ChampionDTO("nom", "bio", "icon");
|
||||
//Assert.AreEqual<ChampionDTO>(champ,((CreatedAtActionResult)a).Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in new issue