From 75fac95a97992cb80c4dc89432041f1471b4c383 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Thu, 9 Feb 2023 14:13:17 +0100 Subject: [PATCH 1/5] =?UTF-8?q?:white=5Fcheck=5Fmark:=20Correction=20du=20?= =?UTF-8?q?probl=C3=A8me=20de=20la=20m=C3=A9thode=20test=20Get()=20:=20tou?= =?UTF-8?q?t=20les=20tests=20actuels=20sont=20desormais=20fonctionnels=20!?= =?UTF-8?q?=20:test=5Ftube:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Api_UT/Api_UT.csproj | 1 + Sources/Api_UT/UnitTest1.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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] From b2258e63dfee6adbb43cd6ab73fb2a406ba462f0 Mon Sep 17 00:00:00 2001 From: Pierre FERREIRA Date: Thu, 9 Feb 2023 14:42:34 +0100 Subject: [PATCH 2/5] Ajout du .drone.yml Debut CI --- .drone.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c96db9b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +kind: pipeline +type: docker +name: EfCsLoL + +trigger: + event: + - push + +# steps: +# - name: build +# image: plugins/docker +# settings: +# sonar_host: +# from_secret: sonar_host +# sonar_token: +# from_secret: sonar_token \ No newline at end of file From 14f788b00c4210bed30152baa1b952c0590e890f Mon Sep 17 00:00:00 2001 From: Pierre FERREIRA Date: Thu, 9 Feb 2023 14:49:32 +0100 Subject: [PATCH 3/5] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20.drone.yml=20-?= =?UTF-8?q?=20test=20CI=20:green=5Fheart:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :green_heart: Test de la CI :green_heart: --- .drone.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index c96db9b..dd69926 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,11 +6,17 @@ trigger: event: - push -# steps: -# - name: build -# image: plugins/docker -# settings: -# sonar_host: -# from_secret: sonar_host -# sonar_token: -# from_secret: sonar_token \ No newline at end of file +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 From 3c853dc2dd45ff77707f31ca2bc2c8514d7174e5 Mon Sep 17 00:00:00 2001 From: Pierre FERREIRA Date: Thu, 9 Feb 2023 14:55:16 +0100 Subject: [PATCH 4/5] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index dd69926..5ddaf6a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ trigger: - push steps: -# docker image build +# docker image build - name: docker-build-and-push image: plugins/docker settings: From ac143c7ecf1d0cdd8224dd112686bdabfc276ff3 Mon Sep 17 00:00:00 2001 From: Pierre FERREIRA Date: Thu, 9 Feb 2023 15:00:04 +0100 Subject: [PATCH 5/5] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5ddaf6a..2e021ce 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,7 @@ steps: - name: docker-build-and-push image: plugins/docker settings: - dockerfile: Sources/Dockerfile + #dockerfile: Sources/Dockerfile context: Sources/ registry: hub.codefirst.iut.uca.fr repo: hub.codefirst.iut.uca.fr/corentin.richard/EntityFramework_ConsoDeServices_TP