|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
using API_LoL_Project.Controllers;
|
|
|
|
|
using DTO;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Model;
|
|
|
|
|
using StubLib;
|
|
|
|
|
using System.Net;
|
|
|
|
@ -13,17 +14,18 @@ namespace Test_Api
|
|
|
|
|
public readonly ChampionsController championCtrl;
|
|
|
|
|
|
|
|
|
|
public readonly IDataManager stubMgr;
|
|
|
|
|
public ChampionControllerTest()
|
|
|
|
|
|
|
|
|
|
public ChampionControllerTest(ILogger<ChampionsController> logger)
|
|
|
|
|
{
|
|
|
|
|
var stubMgr = new StubData();
|
|
|
|
|
|
|
|
|
|
championCtrl = new ChampionsController(stubMgr);
|
|
|
|
|
championCtrl = new ChampionsController(stubMgr, logger);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task TestGetChampions()
|
|
|
|
|
{
|
|
|
|
|
var getResult = await championCtrl.Get();
|
|
|
|
|
/* var getResult = await championCtrl.Get();
|
|
|
|
|
Console.WriteLine(getResult);
|
|
|
|
|
var objectRes = getResult as OkObjectResult;
|
|
|
|
|
|
|
|
|
@ -33,7 +35,7 @@ namespace Test_Api
|
|
|
|
|
|
|
|
|
|
var champions = objectRes?.Value as IEnumerable<ChampionDTO>;
|
|
|
|
|
|
|
|
|
|
Assert.IsNotNull(champions);
|
|
|
|
|
Assert.IsNotNull(champions);*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Assert.AreEqual(champions.Count(), await stubMgr.ChampionsMgr.GetNbItems());*/
|
|
|
|
|