From 2a8d19902023f5192ad4caf24f9871b5b918cb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Tue, 16 Mar 2021 09:23:12 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20tests=20EP=20en=20?= =?UTF-8?q?cours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/EpInformationApiTests.cs | 4 ++-- .../Services/EpDetailsServiceTests.cs | 1 + .../Services/EpInformationTests.cs | 20 +++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/EPAServeur.Tests/Controllers/EpInformationApiTests.cs b/EPAServeur.Tests/Controllers/EpInformationApiTests.cs index 6da91da..3c6e637 100644 --- a/EPAServeur.Tests/Controllers/EpInformationApiTests.cs +++ b/EPAServeur.Tests/Controllers/EpInformationApiTests.cs @@ -61,7 +61,7 @@ namespace EPAServeur.Tests.Controllers public async Task GetEpEnCours() { EpApiController epApiController = new EpApiController(epInformationService, logger); - Task task = epApiController.GetEPEnCours(new List() { 1, 2 }, true, 1, 15, "", "", null, null); + Task task = epApiController.GetEPEnCours(new List() { 1, 2 }, true, 1, 15, "", true, "", null, null); OkObjectResult result = task.Result as OkObjectResult; Assert.AreEqual(200, result.StatusCode); Assert.IsInstanceOf>(result.Value); @@ -71,7 +71,7 @@ namespace EPAServeur.Tests.Controllers public async Task GetEpEnCoursCount() { EpApiController epApiController = new EpApiController(epInformationService, logger); - Task task = epApiController.GetEPEnCoursCount(new List() { 1, 2 }, "", null, null); + Task task = epApiController.GetEPEnCoursCount(new List() { 1, 2 }, "", true, null, null); OkObjectResult result = task.Result as OkObjectResult; Assert.AreEqual(200, result.StatusCode); Assert.IsInstanceOf(result.Value); diff --git a/EPAServeur.Tests/Services/EpDetailsServiceTests.cs b/EPAServeur.Tests/Services/EpDetailsServiceTests.cs index 16a3628..361c8a9 100644 --- a/EPAServeur.Tests/Services/EpDetailsServiceTests.cs +++ b/EPAServeur.Tests/Services/EpDetailsServiceTests.cs @@ -15,6 +15,7 @@ using System.Threading.Tasks; namespace EPAServeur.Tests.Services { + [TestFixture] public class EpDetailsServiceTests { #region variables diff --git a/EPAServeur.Tests/Services/EpInformationTests.cs b/EPAServeur.Tests/Services/EpInformationTests.cs index 70dbcaf..4d89e34 100644 --- a/EPAServeur.Tests/Services/EpInformationTests.cs +++ b/EPAServeur.Tests/Services/EpInformationTests.cs @@ -63,8 +63,8 @@ namespace EPAServeur.Tests.Services { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List{ idBUs }, true, 1, 15, "", "", null, null); - int count = await epInformationService.GetEPEnCoursCount(new List { idBUs }, "", null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List{ idBUs }, true, 1, 15, "", true,"", null, null); + int count = await epInformationService.GetEPEnCoursCount(new List { idBUs }, "", true, null, null); Assert.AreEqual(count, nbElements); Assert.AreEqual(count, epInformationDTOs.Count()); foreach(EpInformationDTO ep in epInformationDTOs) @@ -79,8 +79,8 @@ namespace EPAServeur.Tests.Services { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1,2 }, true, 1, 15, "", "", null, null); - int count = await epInformationService.GetEPEnCoursCount(new List { 1, 2 }, "", null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1,2 }, true, 1, 15, "", true, "", null, null); + int count = await epInformationService.GetEPEnCoursCount(new List { 1, 2 }, "", true, null, null); Assert.AreEqual(count, 6); Assert.AreEqual(count, epInformationDTOs.Count()); long? bu; @@ -104,7 +104,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_TriColonneASC(string tri) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", tri, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, tri, null, null); EpInformationDTO ep1, ep2; int compare = 0; for(int i = 0; i < epInformationDTOs.Count()-1; ++i) @@ -157,7 +157,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_TriColonneDESC(string tri) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, false, 1, 15, "", tri, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, false, 1, 15, "", true, tri, null, null); EpInformationDTO ep1, ep2; int compare = 0; for (int i = 0; i < epInformationDTOs.Count() - 1; ++i) @@ -206,7 +206,7 @@ namespace EPAServeur.Tests.Services DateTime date = new DateTime(a, m, j); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", "", date, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", date, null); Assert.AreEqual(epInformationDTOs.Count(), count); foreach(EpInformationDTO ep in epInformationDTOs) { @@ -222,7 +222,7 @@ namespace EPAServeur.Tests.Services { DateTime date = new DateTime(a, m, j); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", "", null, date); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", null, date); Assert.AreEqual(epInformationDTOs.Count(), count); foreach (EpInformationDTO ep in epInformationDTOs) { @@ -242,7 +242,7 @@ namespace EPAServeur.Tests.Services DateTime date2 = new DateTime(a2, m2, j2); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", "", date1, date2); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", date1, date2); Assert.AreEqual(epInformationDTOs.Count(), count); foreach (EpInformationDTO ep in epInformationDTOs) { @@ -263,7 +263,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_texte(string texte, int count) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, texte, "", null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, texte, true, "", null, null); Assert.AreEqual(count, epInformationDTOs.Count()); foreach (EpInformationDTO ep in epInformationDTOs) {