|
|
@ -61,18 +61,19 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
|
|
|
|
|
|
|
#region Tests GetDemandesFormationAsync |
|
|
|
#region Tests GetDemandesFormationAsync |
|
|
|
|
|
|
|
|
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { 1, 2 }, true, 1, 20, "gaillard", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { 1, 2 }, new StatutEp[] { StatutEp.Signe, StatutEp.SignatureReferent }, true, 1, 20, "gaillard", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { 1 }, false, 1, 5, "gaillard", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { 1 }, new StatutEp[] { StatutEp.Signe, StatutEp.SignatureReferent }, false, 1, 5, "gaillard", null, null, null)] |
|
|
|
[TestCase(null, null, null, 2, 5, null, null, null, null)] |
|
|
|
[TestCase(null, null, null, null, 2, 5, null, null, null, null)] |
|
|
|
[TestCase(null, new long[] { 1 }, null, 1, 10, null, null, null, null)] |
|
|
|
[TestCase(null, new long[] { 1 }, null, null, 1, 10, null, null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.Rejetee }, null, null, 1, 10, "gai", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.Rejetee }, null, null, null, 1, 10, "gai", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { }, null, 1, 50, "gai", null, null, null)] |
|
|
|
[TestCase(new EtatDemande[] { EtatDemande.EnAttente, EtatDemande.Validee, EtatDemande.Rejetee }, new long[] { }, new StatutEp[] { StatutEp.Signe, StatutEp.SignatureReferent }, null, 1, 50, "gai", null, null, null)] |
|
|
|
public async Task GetDemandesFormationAsync_PasseDesParamsValides_RetourneDesDemandesDeFormations(EtatDemande[] arrEtatDemandes, long[] arrIdBUs, bool? asc, int? numPage, int? parPAge, string texte, string tri, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
public async Task GetDemandesFormationAsync_PasseDesParamsValides_RetourneDesDemandesDeFormations(EtatDemande[] arrEtatDemandes, long[] arrIdBUs, StatutEp[] arrStatutsEp, bool? asc, int? numPage, int? parPAge, string texte, string tri, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Arrange |
|
|
|
// Arrange |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
List<long?> idBUs; |
|
|
|
List<long?> idBUs; |
|
|
|
List<EtatDemande> etatDemandes; |
|
|
|
List<EtatDemande> etatDemandes; |
|
|
|
|
|
|
|
List<StatutEp> statutsEp; |
|
|
|
|
|
|
|
|
|
|
|
if (arrEtatDemandes != null) |
|
|
|
if (arrEtatDemandes != null) |
|
|
|
etatDemandes = arrEtatDemandes.ToList(); |
|
|
|
etatDemandes = arrEtatDemandes.ToList(); |
|
|
@ -84,8 +85,13 @@ namespace EPAServeur.Tests.Services |
|
|
|
else |
|
|
|
else |
|
|
|
idBUs = null; |
|
|
|
idBUs = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (arrStatutsEp != null) |
|
|
|
|
|
|
|
statutsEp = arrStatutsEp.ToList(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
statutsEp = null; |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(etatDemandes, idBUs, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(etatDemandes, idBUs, statutsEp, asc, numPage, parPAge, texte, tri, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.Less(0, demandeFormationDTOs.Count()); |
|
|
|
Assert.Less(0, demandeFormationDTOs.Count()); |
|
|
@ -99,7 +105,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, numPage, parPage, null, null, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, numPage, parPage, null, null, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(parPage, demandeFormationDTOs.Count()); |
|
|
|
Assert.AreEqual(parPage, demandeFormationDTOs.Count()); |
|
|
@ -121,10 +127,10 @@ namespace EPAServeur.Tests.Services |
|
|
|
nbDemandeFormationDeuxiemePage = 5; |
|
|
|
nbDemandeFormationDeuxiemePage = 5; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
case 6: |
|
|
|
nbDemandeFormationDeuxiemePage = 4; |
|
|
|
nbDemandeFormationDeuxiemePage = 6; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 10: |
|
|
|
case 10: |
|
|
|
nbDemandeFormationDeuxiemePage = 0; |
|
|
|
nbDemandeFormationDeuxiemePage = 2; |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
nbDemandeFormationDeuxiemePage = 0; |
|
|
|
nbDemandeFormationDeuxiemePage = 0; |
|
|
@ -132,7 +138,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, numPage, parPage, null, null, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, numPage, parPage, null, null, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(nbDemandeFormationDeuxiemePage, demandeFormationDTOs.Count()); |
|
|
|
Assert.AreEqual(nbDemandeFormationDeuxiemePage, demandeFormationDTOs.Count()); |
|
|
@ -145,7 +151,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual("Orléans", demandeFormationDTOs.First().Collaborateur.BusinessUnit.Nom); |
|
|
|
Assert.AreEqual("Orléans", demandeFormationDTOs.First().Collaborateur.BusinessUnit.Nom); |
|
|
@ -159,7 +165,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual("Tours", demandeFormationDTOs.First().Collaborateur.BusinessUnit.Nom); |
|
|
|
Assert.AreEqual("Tours", demandeFormationDTOs.First().Collaborateur.BusinessUnit.Nom); |
|
|
@ -176,7 +182,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual("Gaillard", demandeFormationDTOs.First().Collaborateur.Nom); |
|
|
|
Assert.AreEqual("Gaillard", demandeFormationDTOs.First().Collaborateur.Nom); |
|
|
@ -193,7 +199,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual("Vasseur", demandeFormationDTOs.First().Collaborateur.Nom); |
|
|
|
Assert.AreEqual("Vasseur", demandeFormationDTOs.First().Collaborateur.Nom); |
|
|
@ -208,7 +214,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(new DateTime(2020, 1, 22, 9, 0, 0), demandeFormationDTOs.First().DateDemande); |
|
|
|
Assert.AreEqual(new DateTime(2020, 1, 22, 9, 0, 0), demandeFormationDTOs.First().DateDemande); |
|
|
@ -222,7 +228,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(new DateTime(2020, 12, 22, 9, 0, 0), demandeFormationDTOs.First().DateDemande); |
|
|
|
Assert.AreEqual(new DateTime(2020, 12, 22, 9, 0, 0), demandeFormationDTOs.First().DateDemande); |
|
|
@ -236,7 +242,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsFalse(demandeFormationDTOs.First().DemandeRH); |
|
|
|
Assert.IsFalse(demandeFormationDTOs.First().DemandeRH); |
|
|
@ -250,7 +256,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsTrue(demandeFormationDTOs.First().DemandeRH); |
|
|
|
Assert.IsTrue(demandeFormationDTOs.First().DemandeRH); |
|
|
@ -264,7 +270,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(EtatDemande.EnAttente, demandeFormationDTOs.First().EtatDemande); |
|
|
|
Assert.AreEqual(EtatDemande.EnAttente, demandeFormationDTOs.First().EtatDemande); |
|
|
@ -278,7 +284,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(EtatDemande.Rejetee, demandeFormationDTOs.First().EtatDemande); |
|
|
|
Assert.AreEqual(EtatDemande.Rejetee, demandeFormationDTOs.First().EtatDemande); |
|
|
@ -293,7 +299,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsNull(demandeFormationDTOs.First().DateDerniereReponse); |
|
|
|
Assert.IsNull(demandeFormationDTOs.First().DateDerniereReponse); |
|
|
@ -307,7 +313,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, asc, null, null, null, tri, null, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, asc, null, null, null, tri, null, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(new DateTime(2020, 12, 27, 9, 0, 0), demandeFormationDTOs.First().DateDerniereReponse); |
|
|
|
Assert.AreEqual(new DateTime(2020, 12, 27, 9, 0, 0), demandeFormationDTOs.First().DateDerniereReponse); |
|
|
@ -321,7 +327,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, dateDebut, null); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, null, dateDebut, null); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande >= dateDebut)); |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande >= dateDebut)); |
|
|
@ -334,7 +340,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, null, dateFin); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, null, null, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande <= dateFin)); |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande <= dateFin)); |
|
|
@ -347,7 +353,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, dateDebut, dateFin); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, null, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande >= dateDebut && d.DateDemande <= dateFin)); |
|
|
|
Assert.IsTrue(demandeFormationDTOs.Any(d => d.DateDemande >= dateDebut && d.DateDemande <= dateFin)); |
|
|
@ -360,7 +366,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
DemandeFormationService demandeFormationService = new DemandeFormationService(epContext, collaborateurService, transformDTO); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, dateDebut, dateFin); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, null, null, null, null, null, null, null, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.Zero(demandeFormationDTOs.Count()); |
|
|
|
Assert.Zero(demandeFormationDTOs.Count()); |
|
|
@ -382,7 +388,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
idBUs = null; |
|
|
|
idBUs = null; |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, idBUs, null, null, null, texte, null, dateDebut, dateFin); |
|
|
|
IEnumerable<DemandeFormationDTO> demandeFormationDTOs = await demandeFormationService.GetDemandesFormationAsync(null, idBUs, null, null, null, null, texte, null, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.Zero(demandeFormationDTOs.Count()); |
|
|
|
Assert.Zero(demandeFormationDTOs.Count()); |
|
|
@ -411,7 +417,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
idBUs = null; |
|
|
|
idBUs = null; |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
long count = await demandeFormationService.GetDemandesFormationCountAsync(null, idBUs, texte, dateDebut, dateFin); |
|
|
|
long count = await demandeFormationService.GetDemandesFormationCountAsync(null, idBUs, null, texte, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.Less(0, count); |
|
|
|
Assert.Less(0, count); |
|
|
@ -433,7 +439,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
idBUs = null; |
|
|
|
idBUs = null; |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
// Act |
|
|
|
long count = await demandeFormationService.GetDemandesFormationCountAsync(null, idBUs, texte, dateDebut, dateFin); |
|
|
|
long count = await demandeFormationService.GetDemandesFormationCountAsync(null, idBUs, null, texte, dateDebut, dateFin); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
// Assert |
|
|
|
Assert.AreEqual(0, count); |
|
|
|
Assert.AreEqual(0, count); |
|
|
|