|
|
|
@ -544,14 +544,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public void AddFormation_AjouteUneFormationValide_FormationAjouteeAvecSucces(int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationDTO formation = new FormationDTO |
|
|
|
|
{ |
|
|
|
@ -597,14 +597,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public async Task AddFormationAsync_AjouteUneFormationValide_FormationAjouteeAvecSucces(int? idMode, int? idStatut, int? idType, long? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationDTO formation = new FormationDTO |
|
|
|
|
{ |
|
|
|
@ -693,14 +693,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationDTO formation = new FormationDTO |
|
|
|
|
{ |
|
|
|
@ -742,14 +742,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationDTO formation = new FormationDTO |
|
|
|
|
{ |
|
|
|
@ -876,14 +876,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public void UpdateFormation_ModifieUneFormationValide_FormationModifieeAvecSucces(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -927,14 +927,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public async Task UpdateFormationAsync_ModifieUneFormationValide_FormationModifieeAvecSucces(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -991,14 +991,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1041,14 +1041,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1079,14 +1079,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public void UpdateFormation_ModifieUneFormationAvecUnIdIncorrecte_LeveUneFormationIncompatibleIdException(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1118,14 +1118,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public async Task UpdateFormationAsync_ModifieUneFormationAvecUnIdIncorrecte_LeveUneFormationIncompatibleIdException(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1156,14 +1156,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public void UpdateFormation_ModifieUneFormationAvecUnIdInexistant_RetourneUnObjetNull(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1195,14 +1195,14 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
public async Task UpdateFormationAsync_ModifieUneFormationAvecUnIdInexistant_RetourneUnObjetNull(long? idFormation, int? idMode, int? idStatut, int? idType, int? idOrigine, long? idAgence, string intitule, string organisme, DateTime? dateDebut, DateTime? dateFin) |
|
|
|
|
{ |
|
|
|
|
// Arrange |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.Id == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.Id == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.Id == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.Id == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.Id, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
ModeFormationDTO modeExterne = epContext.ModeFormation.Where(mode => mode.IdModeFormation == idMode) |
|
|
|
|
.Select(mode => new ModeFormationDTO { Id = mode.IdModeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
StatutFormationDTO statutPlanifie = epContext.StatutFormation.Where(mode => mode.IdStatutFormation == idStatut) |
|
|
|
|
.Select(mode => new StatutFormationDTO { Id = mode.IdStatutFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
TypeFormationDTO typeELearning = epContext.TypeFormation.Where(mode => mode.IdTypeFormation == idType) |
|
|
|
|
.Select(mode => new TypeFormationDTO { Id = mode.IdTypeFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
OrigineFormationDTO origineFormationCollaborateur = epContext.OrigineFormation.Where(mode => mode.IdOrigineFormation == idOrigine) |
|
|
|
|
.Select(mode => new OrigineFormationDTO { Id = mode.IdOrigineFormation, Libelle = mode.Libelle }).FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
FormationService formationService = new FormationService(epContext); |
|
|
|
|
|
|
|
|
@ -1246,7 +1246,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
// Act |
|
|
|
|
FormationDTO formationSupprime = formationService.DeleteFormationById(idFormation); |
|
|
|
|
|
|
|
|
|
existFormation = epContext.Formation.Any(formation => formation.Id == formationSupprime.Id.Value); |
|
|
|
|
existFormation = epContext.Formation.Any(formation => formation.IdFormation == formationSupprime.Id.Value); |
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
Assert.IsFalse(existFormation); |
|
|
|
@ -1263,7 +1263,7 @@ namespace EPAServeur.Tests.Services |
|
|
|
|
// Act |
|
|
|
|
FormationDTO formationSupprime = await formationService.DeleteFormationByIdAsync(idFormation); |
|
|
|
|
|
|
|
|
|
existFormation = await epContext.Formation.AnyAsync(formation => formation.Id == formationSupprime.Id.Value); |
|
|
|
|
existFormation = await epContext.Formation.AnyAsync(formation => formation.IdFormation == formationSupprime.Id.Value); |
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
Assert.IsFalse(existFormation); |
|
|
|
|