Modification des tests unitaires en fonction des données qui ont été modifié dans DataSeeder

develop
jboinembalome 4 years ago
parent 9578543b99
commit cc83dea6d0
  1. 4
      EPAServeur.Tests/Controllers/EngagementsApiTests.cs
  2. 1
      EPAServeur.Tests/Services/EngagementServiceTests.cs
  3. 4
      EPAServeur.Tests/Services/FormationServiceTests.cs

@ -107,8 +107,8 @@ namespace EPAServeur.Tests.Controllers
EngagementsApiController engagementsApiController = new EngagementsApiController(engagementService, new NullLogger<EngagementsApiController>(), mockEnvironment.Object); EngagementsApiController engagementsApiController = new EngagementsApiController(engagementService, new NullLogger<EngagementsApiController>(), mockEnvironment.Object);
List<long> idBUs = new List<long> { 1, 2 }; List<long> idBUs = new List<long> { 1, 2 };
int nbEngagement = 5; int nbEngagement = 5;
int idFirstEngagement = 2; int idFirstEngagement = 8;
int idLastEngagement = 10; int idLastEngagement = 4;
// Act // Act
var okResult = engagementsApiController.GetEngagements(idBUs, null, true, 1, 5, null, null).Result as OkObjectResult; var okResult = engagementsApiController.GetEngagements(idBUs, null, true, 1, 5, null, null).Result as OkObjectResult;

@ -58,7 +58,6 @@ namespace EPAServeur.Tests.Services
#region Tests GetEngagementsAsync #region Tests GetEngagementsAsync
[TestCase(new long[] { 1, 2 })] [TestCase(new long[] { 1, 2 })]
[TestCase(new long[] { 3 })]
public async Task GetEngagementsAsync_PasseDesParamsDesIdBUValides_RetourneDesEngagements(long[] arrIdBUs) public async Task GetEngagementsAsync_PasseDesParamsDesIdBUValides_RetourneDesEngagements(long[] arrIdBUs)
{ {
// Arrange // Arrange

@ -272,7 +272,7 @@ namespace EPAServeur.Tests.Services
// Assert // Assert
Assert.AreEqual(0, formationDTOs.First().NbParticipations); Assert.AreEqual(0, formationDTOs.First().NbParticipations);
Assert.AreEqual(3, formationDTOs.Last().NbParticipations); Assert.AreEqual(2, formationDTOs.Last().NbParticipations);
} }
@ -286,7 +286,7 @@ namespace EPAServeur.Tests.Services
IEnumerable<FormationDetailsDTO> 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
Assert.AreEqual(3, formationDTOs.First().NbParticipations); Assert.AreEqual(2, formationDTOs.First().NbParticipations);
Assert.AreEqual(0, formationDTOs.Last().NbParticipations); Assert.AreEqual(0, formationDTOs.Last().NbParticipations);
} }

Loading…
Cancel
Save