Remplacement du DTO FormationDTO par FormationDetailsDTO

develop
jboinembalome 4 years ago
parent 29970bc54f
commit d08a86bb9b
  1. 36
      EPAServeur.Tests/Services/FormationServiceTests.cs
  2. 2
      EPAServeur/Controllers/FormationsApi.cs
  3. 2
      EPAServeur/IServices/IFormationService.cs

@ -113,7 +113,7 @@ namespace EPAServeur.Tests.Services
idStatuts = null;
// Act
IEnumerable<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, numPage, parPAge, null, null, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, null);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, null, dateFin);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, null, null, null, null, null, dateDebut, dateFin);
IEnumerable<FormationDetailsDTO> 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<FormationDTO> formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin);
IEnumerable<FormationDetailsDTO> formationDTOs = await formationService.GetFormationsAsync(idAgence, idStatuts, asc, numPage, parPAge, texte, tri, dateDebut, dateFin);
// Assert
Assert.AreEqual(0, formationDTOs.Count());

@ -298,7 +298,7 @@ namespace IO.Swagger.Controllers
if (env.IsDevelopment())
logger.LogInformation("Récupération de la liste des formations.");
IEnumerable<FormationDTO> formations = null;
IEnumerable<FormationDetailsDTO> formations = null;
try
{

@ -11,7 +11,7 @@ namespace EPAServeur.IServices
public interface IFormationService
{
Task<FormationDTO> GetFormationByIdAsync(long idFormation);
Task<IEnumerable<FormationDTO>> GetFormationsAsync(long? idAgence, List<int?> idStatuts, bool? asc, int? numPage, int? parPage, string texte, string tri, DateTime? dateDebut, DateTime? dateFin);
Task<IEnumerable<FormationDetailsDTO>> GetFormationsAsync(long? idAgence, List<int?> idStatuts, bool? asc, int? numPage, int? parPage, string texte, string tri, DateTime? dateDebut, DateTime? dateFin);
Task<long> GetFormationsCountAsync(long? idAgence, List<int?> idStatuts, int? numPage, int? parPage, string texte, DateTime? dateDebut, DateTime? dateFin);
Task<IEnumerable<ModeFormationDTO>> GetModesFormationAsync();
Task<IEnumerable<OrigineFormationDTO>> GetOriginesFormationAsync();

Loading…
Cancel
Save