MAJ des tests unitaires pour le service et l'api engagement

develop
jboinembalome 4 years ago
parent 87f887be0c
commit 4e101f472c
  1. 6
      EPAServeur.Tests/Controllers/EngagementsApiTests.cs
  2. 6
      EPAServeur.Tests/Services/EngagementServiceTests.cs

@ -132,7 +132,7 @@ namespace EPAServeur.Tests.Controllers
List<long> idBUs = new List<long> { 1, 2 };
// Act
var okResult = engagementsApiController.GetEngagementsCount(idBUs, null, true, 1, 5, null, null);
var okResult = engagementsApiController.GetEngagementsCount(idBUs, null, null);
// Assert
Assert.IsInstanceOf<OkObjectResult>(okResult.Result);
@ -144,10 +144,10 @@ namespace EPAServeur.Tests.Controllers
// Arrange
EngagementsApiController engagementsApiController = new EngagementsApiController(engagementService, new NullLogger<EngagementsApiController>(), mockEnvironment.Object);
List<long> idBUs = new List<long> { 1, 2 };
int nbEngagement = 5;
int nbEngagement = 12;
// Act
var okResult = engagementsApiController.GetEngagementsCount(idBUs, null, true, 1, 5, null, null).Result as OkObjectResult;
var okResult = engagementsApiController.GetEngagementsCount(idBUs, null, null).Result as OkObjectResult;
// Assert
Assert.IsInstanceOf<long>(okResult.Value);

@ -327,7 +327,7 @@ namespace EPAServeur.Tests.Services
#region Tests GetEngagementsCountAsync
[TestCase(new long[] { 1, 2, 3 }, "formation")]
[TestCase(new long[] { 1, 2, 3 }, "Coty")]
[TestCase(new long[] { 1 }, null)]
public async Task GetEngagementsCountAsync_PasseDesParamsValides_RetourneLeNombreTotalDEngagements(long[] arrIdBUs, string texte)
{
@ -341,7 +341,7 @@ namespace EPAServeur.Tests.Services
idBUs = new List<long>();
// Act
long count = await engagementService.GetEngagementsCountAsync(idBUs, null, null, null, null, texte, null);
long count = await engagementService.GetEngagementsCountAsync(idBUs, null, texte);
// Assert
Assert.Less(0, count);
@ -362,7 +362,7 @@ namespace EPAServeur.Tests.Services
idBUs = new List<long>();
// Act
long count = await engagementService.GetEngagementsCountAsync(idBUs, null, null, null, null, texte, null);
long count = await engagementService.GetEngagementsCountAsync(idBUs, null, texte);
// Assert
Assert.AreEqual(0, count);

Loading…
Cancel
Save