|
|
@ -261,6 +261,36 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(true, "participants")] |
|
|
|
|
|
|
|
public async Task GetFormationsAsync_PasseEnParamAscEtTri_RetourneDesFormationsOrdonnanceeParNombreDeParticipantsCroissant(bool? asc, string tri) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext, collaborateurService); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
|
|
|
|
IEnumerable<FormationDetailsDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
|
|
|
Assert.AreEqual(0, formationDTOs.First().NbParticipations); |
|
|
|
|
|
|
|
Assert.AreEqual(3, formationDTOs.Last().NbParticipations); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(false, "participants")] |
|
|
|
|
|
|
|
public async Task GetFormationsAsync_PasseEnParamAscEtTri_RetourneDesFormationsOrdonnanceeParNombreDeParticipantsDecroissant(bool? asc, string tri) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext, collaborateurService); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
|
|
|
|
IEnumerable<FormationDetailsDTO> formationDTOs = await formationService.GetFormationsAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
|
|
|
Assert.AreEqual(3, formationDTOs.First().NbParticipations); |
|
|
|
|
|
|
|
Assert.AreEqual(0, formationDTOs.Last().NbParticipations); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[TestCase(true, "origine")] |
|
|
|
[TestCase(true, "origine")] |
|
|
|
public async Task GetFormationsAsync_PasseEnParamAscEtTri_RetourneDesFormationsOrdonnanceeParOrigineCroissante(bool? asc, string tri) |
|
|
|
public async Task GetFormationsAsync_PasseEnParamAscEtTri_RetourneDesFormationsOrdonnanceeParOrigineCroissante(bool? asc, string tri) |
|
|
|
{ |
|
|
|
{ |
|
|
|