diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2e021ce --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +kind: pipeline +type: docker +name: EfCsLoL + +trigger: + event: + - push + +steps: +# docker image build + - name: docker-build-and-push + image: plugins/docker + settings: + #dockerfile: Sources/Dockerfile + context: Sources/ + registry: hub.codefirst.iut.uca.fr + repo: hub.codefirst.iut.uca.fr/corentin.richard/EntityFramework_ConsoDeServices_TP + + username: + from_secret: SECRET_REGISTRY_USERNAME + password: + from_secret: SECRET_REGISTRY_PASSWORD \ No newline at end of file diff --git a/Sources/Api_UT/Api_UT.csproj b/Sources/Api_UT/Api_UT.csproj index 06ae488..efdc9e5 100644 --- a/Sources/Api_UT/Api_UT.csproj +++ b/Sources/Api_UT/Api_UT.csproj @@ -9,6 +9,7 @@ + diff --git a/Sources/Api_UT/UnitTest1.cs b/Sources/Api_UT/UnitTest1.cs index 3b74199..de78d2b 100644 --- a/Sources/Api_UT/UnitTest1.cs +++ b/Sources/Api_UT/UnitTest1.cs @@ -1,5 +1,6 @@ using API_LoL.Controllers; using DTO; +using FluentAssertions; using Microsoft.AspNetCore.Mvc; using Model; using StubLib; @@ -15,8 +16,15 @@ namespace Api_UT List list = new List {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(); - Assert.IsNotNull(a); - Assert.AreEqual(list,((OkObjectResult)a).Value); + + /// 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; + list.Should().BeEquivalentTo(championresult); } [TestMethod]