diff --git a/EPAServeur.Tests/Services/FormationServiceTests.cs b/EPAServeur.Tests/Services/FormationServiceTests.cs index cefa3b6..e2954c5 100644 --- a/EPAServeur.Tests/Services/FormationServiceTests.cs +++ b/EPAServeur.Tests/Services/FormationServiceTests.cs @@ -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 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 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")] public async Task GetFormationsAsync_PasseEnParamAscEtTri_RetourneDesFormationsOrdonnanceeParOrigineCroissante(bool? asc, string tri) {