From d08a86bb9bc93872f78a648796b7bd1d0b0cbd22 Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Wed, 3 Feb 2021 08:54:41 +0100 Subject: [PATCH] Remplacement du DTO FormationDTO par FormationDetailsDTO --- .../Services/FormationServiceTests.cs | 36 +++++++++---------- EPAServeur/Controllers/FormationsApi.cs | 2 +- EPAServeur/IServices/IFormationService.cs | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/EPAServeur.Tests/Services/FormationServiceTests.cs b/EPAServeur.Tests/Services/FormationServiceTests.cs index 7349820..9881639 100644 --- a/EPAServeur.Tests/Services/FormationServiceTests.cs +++ b/EPAServeur.Tests/Services/FormationServiceTests.cs @@ -113,7 +113,7 @@ namespace EPAServeur.Tests.Services idStatuts = null; // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); // Assert Assert.Less(0, formationDTOs.Count()); @@ -127,7 +127,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null); // Assert Assert.AreEqual(parPAge, formationDTOs.Count()); @@ -160,7 +160,7 @@ namespace EPAServeur.Tests.Services } // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null); // Assert Assert.AreEqual(nbFormationDeuxiemePage, formationDTOs.Count()); @@ -174,7 +174,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Apprendre C# et le développement de logiciels avec WPF", formationDTOs.First().Intitule); @@ -190,7 +190,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Formation Xamarin, Développer des applications mobiles en C# pour iOS et Android", formationDTOs.First().Intitule); @@ -205,7 +205,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Annulée", formationDTOs.First().Statut.Libelle); @@ -220,7 +220,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Replanifiée", formationDTOs.First().Statut.Libelle); @@ -235,7 +235,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Demande collaborateur", formationDTOs.First().Origine.Libelle); @@ -250,7 +250,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual("Formation réglementaire", formationDTOs.First().Origine.Libelle); @@ -265,7 +265,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual(new DateTime(2020, 1, 25, 10, 0, 0), formationDTOs.First().DateDebut); @@ -280,7 +280,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual(new DateTime(2020, 12, 25, 14, 0, 0), formationDTOs.First().DateDebut); @@ -295,7 +295,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual(false, formationDTOs.First().EstCertifiee); @@ -310,7 +310,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); // Assert Assert.AreEqual(true, formationDTOs.First().EstCertifiee); @@ -326,7 +326,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, null); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, null); // Assert Assert.Greater(formationDTOs.First().DateDebut, dateDebut); @@ -341,7 +341,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, null, dateFin); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, null, dateFin); // Assert Assert.Less(formationDTOs.First().DateFin, dateFin); @@ -356,7 +356,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin); // Assert Assert.Greater(formationDTOs.First().DateDebut, dateDebut); @@ -374,7 +374,7 @@ namespace EPAServeur.Tests.Services FormationService formationService = new FormationService(epContext); // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin); // Assert Assert.AreEqual(0, formationDTOs.Count()); @@ -396,7 +396,7 @@ namespace EPAServeur.Tests.Services // Act - IEnumerable formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); + IEnumerable formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); // Assert Assert.AreEqual(0, formationDTOs.Count()); diff --git a/EPAServeur/Controllers/FormationsApi.cs b/EPAServeur/Controllers/FormationsApi.cs index f2ed436..52e9203 100644 --- a/EPAServeur/Controllers/FormationsApi.cs +++ b/EPAServeur/Controllers/FormationsApi.cs @@ -298,7 +298,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des formations."); - IEnumerable formations = null; + IEnumerable formations = null; try { diff --git a/EPAServeur/IServices/IFormationService.cs b/EPAServeur/IServices/IFormationService.cs index 0fbf2f3..099e065 100644 --- a/EPAServeur/IServices/IFormationService.cs +++ b/EPAServeur/IServices/IFormationService.cs @@ -11,7 +11,7 @@ namespace EPAServeur.IServices public interface IFormationService { Task GetFormationByIdAsync(long idFormation); - Task> GetFormationsAsync(long? idAgence, List idStatuts, bool? asc, int? numPage, int? parPage, string texte, string tri, DateTime? dateDebut, DateTime? dateFin); + Task> GetFormationsAsync(long? idAgence, List idStatuts, bool? asc, int? numPage, int? parPage, string texte, string tri, DateTime? dateDebut, DateTime? dateFin); Task GetFormationsCountAsync(long? idAgence, List idStatuts, int? numPage, int? parPage, string texte, DateTime? dateDebut, DateTime? dateFin); Task> GetModesFormationAsync(); Task> GetOriginesFormationAsync();