diff --git a/Documentation/img/Architecture du projet.png b/Documentation/img/Architecture du projet.png new file mode 100644 index 0000000..44a5cac Binary files /dev/null and b/Documentation/img/Architecture du projet.png differ diff --git a/Sources/API/Controllers/ChampionController.cs b/Sources/API/Controllers/ChampionController.cs index 7b5fb5c..a4ec251 100644 --- a/Sources/API/Controllers/ChampionController.cs +++ b/Sources/API/Controllers/ChampionController.cs @@ -29,6 +29,14 @@ namespace API.Controllers this.dataManager = datamanager; } +/* public championHttpManager(HttpClient client) + { + _client = client; + client.BaseAddress = new Uri("à chopper dans lauchSettings.json propriété du projet"); + } +*/ + + /**** Méthodes GET ****/ [HttpGet] public async Task> Get() { @@ -58,10 +66,6 @@ namespace API.Controllers .ToArray()); } - - - - static async Task GetJsonData() { using var client = new HttpClient(); @@ -92,35 +96,32 @@ namespace API.Controllers } } + /* public async Task> getJson() + { + var champions = await _client.GetFromJsonAsync>(); + var reponse = await _cleint.GetAscyn("api/champion"); + return champions; + }*/ + /**** Méthodes POST ****/ - /*[HttpPost] + +/* [HttpPost] public async Task post([FromBody] ChampionDto champion) { return CreatedAtAction(nameof(GetById), new { id = 1 }, await dataManager.ChampionsMgr.AddItem(champion.ToModel)); } - public championHttpManager(HttpClient client) - { - _client = client; - client.BaseAddress = new Uri("à chopper dans lauchSettings.json propriété du projet"); - } - - - - public async Task> getChampion() - { - var champions = await _client.GetFromJsonAsync>(); - var reponse = await _cleint.GetAscyn("api/champion") ; - return champions; - } - public async void addchampion(ChampionDto champion) { _clientLpostAsJsonAscync(ApiChampion, champion); - } - */ + }*/ + + + /**** Méthodes DELETE ****/ + + /**** Méthodes PUT ****/ } } diff --git a/Sources/TestProject1/UnitTest1.cs b/Sources/TestProject1/UnitTest1.cs index dc88d86..31b1209 100644 --- a/Sources/TestProject1/UnitTest1.cs +++ b/Sources/TestProject1/UnitTest1.cs @@ -1,6 +1,7 @@ using API.Controllers; using API.Dto; using Microsoft.AspNetCore.Mvc; +using StubLib; using System.Collections.Generic; namespace TestProject1 @@ -13,7 +14,7 @@ namespace TestProject1 } - [Test] + /*[Test] public void TestGET() { //Arrange @@ -26,10 +27,10 @@ namespace TestProject1 //vérifie que c’est un ok 200 et un objet Assert.IsNotNull(objectResult); - var champions = objectResult?.value as IEnumerable; + var champions = objectResult?.Value as IEnumerable; Assert.IsNotNull(champions); - Assert.AreEqual(champions.count(), (await stubData.championsMgr.getItems(0, 5)).Count()); + Assert.AreEqual(champions.Count(), (await StubData.championsMgr.getItems(0, 5)).Count()); } [Test] @@ -48,10 +49,10 @@ namespace TestProject1 var objectResult = championResult as CreatedAtActionResult; Assert.IsNotNull(objectResult); - var champions = objectResult?.value as ChampionDto; + var champions = objectResult?.Value as ChampionDto; Assert.IsNotNull(champions); - } + }*/ }