public void GESTVAE012() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.AjouteCandidat(); oCan = VM.CurrentCandidat; oCan.Nom = "TEST2"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; Assert.IsFalse(VM.AjouteL1Command.CanExecute(null)); VM.LockCurrentCandidat(); Assert.IsTrue(VM.AjouteL1Command.CanExecute(null)); // Ajout du Livret1 VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); // L'ajout de L1 n'est plus possible Assert.IsFalse(VM.AjouteL1Command.CanExecute(null)); }
public void TestCreationL2() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.EtatLivret = String.Format("{0:D}-Recu complet", MyEnums.EtatL1.ETAT_L1_RECU_COMPLET); oL1.FTO_SetDecisionJuryL1Favorable(); VM.ValideretQuitterL1(); Assert.AreEqual(1, oCand.lstLivrets.Count); oL1 = (Livret1VM)oCand.CurrentLivret; oL1.IsCNIOK = true; oL1.DateValiditeCNI = new DateTime(2020, 01, 01); oL1.IsEnregistre = true; oL1.IsPaye = true; VM.AjouteL2(); VM.ValideretQuitterL2(); Assert.AreEqual(2, oCand.lstLivrets.Count); Livret2VM oL2 = (Livret2VM)oCand.lstLivrets[1]; Assert.AreEqual(oL1.IsCNIOK, oL2.IsCNIOK); Assert.AreEqual(oL1.DateValiditeCNI, oL2.DateValiditeCNI); Assert.AreEqual(false, oL2.IsEnregistre); Assert.AreEqual(false, oL2.IsPaye); }
public void GESTVAE017b() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le candidat a obtenu le diplome Assert.IsFalse(VM.CurrentCandidat.IsCAFDES); VM.LockCurrentCandidat(); VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); VM.AjouteL2(); // Decision = Favorable DateValidité > Now VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(-1); VM.ValideretQuitterL2(); // Le candidat a obtenu le diplome Assert.IsTrue(VM.CurrentCandidat.IsCAFDES); }//GestVAE017b
public void TestDateDeValiditéL1() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); VM.ValideretQuitterL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; Assert.AreEqual(oL1.DateDemande.Value.AddYears(3), oL1.DateValidite); oL1.EtatLivret = String.Format("{0:D}-RecuComplet", MyEnums.EtatL1.ETAT_L1_RECU_COMPLET); Assert.AreEqual(oL1.DateDemande.Value.AddYears(3), oL1.DateValidite); oL1.FTO_SetDecisionJuryL1Favorable(DateTime.Today.AddDays(2)); Assert.AreEqual(oL1.DateJury.Value.AddYears(3), oL1.DateValidite); oL1.FTO_SetDecisionJuryL1DeFavorable(DateTime.Today.AddDays(2)); Assert.AreEqual(oL1.DateJury, oL1.DateValidite); oL1.IsRecoursDemande = true; oL1.DateJuryRecours = oL1.DateJury.Value.AddDays(5); oL1.DecisionJuryRecours = String.Format("{0:D}-Defavorable", MyEnums.DecisionJuryL1.DECISION_L1_DEFAVORABLE); Assert.AreEqual(oL1.DateJury, oL1.DateValidite); oL1.DecisionJuryRecours = String.Format("{0:D}-Favorable", MyEnums.DecisionJuryL1.DECISION_L1_FAVORABLE); Assert.AreEqual(oL1.DateJury.Value.AddYears(3), oL1.DateValidite); }
public void GESTVAE002() { MyViewModel VM = new MyViewModel(); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(); VM.rechNom = "TEST1"; VM.Recherche(); Assert.AreEqual(1, VM.lstCandidatVM.Count); oCan = VM.lstCandidatVM[0]; VM.CurrentCandidat = oCan; VM.LockCurrentCandidat(); Assert.IsTrue(oCan.IsLocked); oCan.IdSiscole = "123456"; VM.saveData(); Assert.IsTrue(oCan.IsUnlocked); VM.rechNom = "TEST1"; VM.Recherche(); Assert.AreEqual(1, VM.lstCandidatVM.Count); oCan = VM.lstCandidatVM[0]; Assert.IsTrue(oCan.IsUnlocked); Assert.AreEqual("123456", oCan.IdSiscole); }
public void GESTVAE011() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.AjouteCandidat(); oCan = VM.CurrentCandidat; oCan.Nom = "TEST2"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; Assert.IsFalse(VM.AjouteL1Command.CanExecute(null)); VM.LockCurrentCandidat(); Assert.IsTrue(VM.AjouteL1Command.CanExecute(null)); // Ajout du Livret1 VM.AjouteL1(); VM.ValideretQuitterL1(); // Vérification que le livret est bien ajouté à la liste Assert.AreEqual(1, VM.CurrentCandidat.lstLivrets.Count); // Sauvegarde des Données VM.saveData(); // rechargement du Model VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.RechercherCommand.Execute(null); VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le Livret est bien Dans la base Assert.AreEqual(1, VM.CurrentCandidat.lstLivrets.Count); }
public void GESTVAE020() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le candidat a obtenu le diplome Assert.IsFalse(VM.CurrentCandidat.IsCAFDES); VM.LockCurrentCandidat(); VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; // Tous les DC sont a Valider foreach (DCLivretVM item in oL2.lstDCLivret) { item.IsAValider = true; } // Decision = Validation Partielle > Now VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2Partielle(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); oL2.lstDCLivretAValider[0].Decision = String.Format("{0:D}-Favorable", MyEnums.DecisionJuryL2.DECISION_L2_FAVORABLE); oL2.lstDCLivretAValider[1].Decision = String.Format("{0:D}-Défavorable", MyEnums.DecisionJuryL2.DECISION_L2_DEFAVORABLE); oL2.lstDCLivretAValider[2].Decision = String.Format("{0:D}-Favorable", MyEnums.DecisionJuryL2.DECISION_L2_FAVORABLE); oL2.lstDCLivretAValider[3].Decision = String.Format("{0:D}-Défavorable", MyEnums.DecisionJuryL2.DECISION_L2_DEFAVORABLE); VM.ValideretQuitterL2(); // Le candidat n'a pas obtenu le diplome DiplomeCandVM oDip = VM.CurrentCandidat.getDiplomeCand(oL2); Assert.IsNotNull(oDip); Assert.AreEqual("Validé Partiellement", oDip.StatutDiplome); Assert.AreEqual("Validé", oDip.lstDCCands[0].Statut); Assert.AreEqual("Refusé", oDip.lstDCCands[1].Statut); Assert.AreEqual("Validé", oDip.lstDCCands[2].Statut); Assert.AreEqual("Refusé", oDip.lstDCCands[3].Statut); }//GestVAE020
public void GESTVAE010() { MyViewModel VM = new MyViewModel(); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.AjouteCandidat(); oCan = VM.CurrentCandidat; oCan.Nom = "TEST2"; VM.saveData(); MyViewModel VM1; VM1 = new MyViewModel(); VM1.rechNom = ""; VM1.Recherche(); //Lock du candidat sur POSTE1 VM1.CurrentCandidat = VM1.lstCandidatVM[0]; VM1.LockCurrentCandidat(); VM1.CurrentCandidat.DateNaissance = Convert.ToDateTime("1964-02-06"); VM1.CurrentCandidat = VM1.lstCandidatVM[1]; VM1.saveData(); // Message D'alerte Assert.IsFalse(VM1.HasChanges()); // Rechargement du Candidat VM1 = new MyViewModel(); VM1.rechNom = ""; VM1.Recherche(); VM1.CurrentCandidat = VM1.lstCandidatVM[0]; Assert.IsNotNull(VM1.CurrentCandidat.DateNaissance); }
public void GESTVAE013() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.AjouteCandidat(); oCan = VM.CurrentCandidat; oCan.Nom = "TEST2"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; Assert.IsFalse(VM.AjouteL1Command.CanExecute(null)); VM.LockCurrentCandidat(); Assert.IsTrue(VM.AjouteL1Command.CanExecute(null)); // Ajout du Livret1 VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1DeFavorable(); // Date de validité = demain VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); // L'ajout de L1 n'est pas possible S'il y a un L1 en cours Assert.IsFalse(VM.AjouteL1Command.CanExecute(null)); // Modification de la date de Validié < Aujourd'hui VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(-1); VM.ValideretQuitterL1(); // L'ajout de L1 Est Possible Assert.IsTrue(VM.AjouteL1Command.CanExecute(null)); }
public void GESTVAE004() { MyViewModel VM = new MyViewModel(); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); MyViewModel VM1 = new MyViewModel(); VM1 = new MyViewModel(); VM1.rechNom = "TEST1"; VM1.Recherche(); Assert.AreEqual(1, VM1.lstCandidatVM.Count); oCan = VM1.lstCandidatVM[0]; VM1.CurrentCandidat = oCan; Assert.IsFalse(VM1.IsCurrentCandidatLocked); MyViewModel VM2 = new MyViewModel(); VM2 = new MyViewModel(); VM2.rechNom = "TEST1"; VM2.Recherche(); Assert.AreEqual(1, VM2.lstCandidatVM.Count); oCan = VM2.lstCandidatVM[0]; VM2.CurrentCandidat = oCan; Assert.IsFalse(VM2.IsCurrentCandidatLocked); //Lock du candidat sur POSTE1 VM1.LockCurrentCandidat(); // Candidat Locker sur poste1 Assert.IsTrue(VM1.IsCurrentCandidatLocked); //Loack candidat sur poste2 VM2.LockCurrentCandidat(); // Le candidat ne peut est locké Assert.IsTrue(VM2.IsCurrentCandidatLocked); Assert.IsFalse(VM2.IsCurrentCandidatLockedByMe); VM1.UnLockCurrentCandidat(); Assert.IsFalse(VM1.IsCurrentCandidatLocked); VM2.LockCurrentCandidat(); Assert.IsTrue(VM2.IsCurrentCandidatLocked); VM1.LockCurrentCandidat(); Assert.IsTrue(VM1.IsCurrentCandidatLocked); Assert.IsFalse(VM1.IsCurrentCandidatLockedByMe); }
public void GESTVAE003() { // GIVER 5 Candidats existent dans la base MyViewModel VM = new MyViewModel(); VM.AjouteCandidat(); VM.CurrentCandidat.Nom = "TEST1"; VM.CurrentCandidat.Prenom = "Prenom1"; VM.CurrentCandidat.Ville = "VILLE1"; VM.AjouteCandidat(); VM.CurrentCandidat.Nom = "TEST2"; VM.CurrentCandidat.Prenom = "Prenom2"; VM.CurrentCandidat.Ville = "VILLE2"; VM.AjouteCandidat(); VM.CurrentCandidat.Nom = "TEST3"; VM.CurrentCandidat.Prenom = "Prenom3"; VM.CurrentCandidat.Ville = "VILLE3"; VM.AjouteCandidat(); VM.CurrentCandidat.Nom = "TEST4"; VM.CurrentCandidat.Prenom = "Prenom4"; VM.CurrentCandidat.Ville = "VILLE4"; VM.AjouteCandidat(); VM.CurrentCandidat.Nom = "TEST5"; VM.CurrentCandidat.Prenom = "Prenom5"; VM.CurrentCandidat.Ville = "VILLE5"; VM.saveData(); VM = new MyViewModel(); VM.rechPrenom = "Prenom3"; VM.Recherche(); Assert.AreEqual(1, VM.lstCandidatVM.Count); VM.rechPrenom = ""; VM.Recherche(); Assert.AreEqual(6, VM.lstCandidatVM.Count); }
public void TestDateDeRecevabilitechangeAvecDatenotificationjury() { DateTime dateV1 = DateTime.Today.AddDays(10); MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.EtatLivret = String.Format("{0:D}-Recu complet", MyEnums.EtatL1.ETAT_L1_RECU_COMPLET); oL1.DateValidite = dateV1; oL1.DateNotificationJury = DateTime.Today.AddDays(1); Assert.AreEqual(dateV1, oL1.DateValidite); }
public void GESTVAE019() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le candidat a obtenu le diplome Assert.IsFalse(VM.CurrentCandidat.IsCAFDES); VM.LockCurrentCandidat(); VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; // Tous les DC sont a Valider foreach (DCLivretVM item in oL2.lstDCLivret) { item.IsAValider = true; } // Decision = Validation Partielle > Now VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2Partielle(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(-1); oL2.lstDCLivret[0].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[1].Decision = oL2.DecisionL2ModuleDeFavorable; oL2.lstDCLivret[2].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[3].Decision = oL2.DecisionL2ModuleDeFavorable; VM.ValideretQuitterL2(); // Le candidat n'a pas obtenu le diplome DiplomeCandVM oDip = VM.CurrentCandidat.getDiplomeCand(oL2); Assert.IsNotNull(oDip); Assert.AreEqual("Validé Partiellement", oDip.StatutDiplome); }//GestVAE019
public void TestDateDeRecevabilite() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.EtatLivret = String.Format("{0:D}-Recu complet", MyEnums.EtatL1.ETAT_L1_RECU_COMPLET); VM.ValideretQuitterL1(); oL1 = (Livret1VM)oCand.CurrentLivret; Assert.IsNull(oL1.DateJury); Assert.IsNull(oL1.DateDepotRecours); }
public void GESTVAE021() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le candidat n'a pas obtenu le diplome Assert.IsFalse(VM.CurrentCandidat.IsCAFDES); VM.LockCurrentCandidat(); VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); VM.AjouteL2(); Assert.IsTrue(VM.CurrentCandidat.IsCAFDES); // Decision = Validation Partielle > Now Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); //Saisie du numéro de diplome oL2.DateJury = DateTime.Now.AddDays(-1); // oL2.NumeroDiplome = "123546"; Assert.IsTrue(VM.CurrentCandidat.IsCAFDES); VM.ValideretQuitterL2(); Assert.IsTrue(VM.CurrentCandidat.IsCAFDES); // Le candidat a obtenu le diplome DiplomeCandVM oDip = VM.CurrentCandidat.getDiplomeCand(oL2); Assert.IsNotNull(oDip); Assert.AreEqual(oL2.DateJury, oDip.DateObtentionDiplome); }//GestVAE021
public void TestDateDeValiditéL1L2() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); VM.ValideretQuitterL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; // Jury = Après-demain oL1.FTO_SetDecisionJuryL1Favorable(DateTime.Today.AddDays(2)); VM.CloturerL1etCreerL2(); Assert.IsTrue(VM.CurrentCandidat.CurrentLivret is Livret2VM); Assert.AreEqual(oL1.DateValidite, ((Livret2VM)VM.CurrentCandidat.CurrentLivret).DateLimiteReceptEHESP); }
public void TestDatePrevionnelleJury() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.FTO_SetDecisionJuryL1Favorable(); VM.ValideretQuitterL1(); VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; oL2.DatePrevJury1 = DateTime.Today; Assert.AreEqual(DateTime.Today.AddDays(1), oL2.DatePrevJury2); }
public void GESTVAE015() { MyViewModel VM = new MyViewModel(true); Int32 nDelaiValiditeL1avant = VM.ParamDelaiValiditeL1; VM.ParamDelaiValiditeL1 = 0; VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Avant Verrouillage => Ajout L2 impossible Assert.IsFalse(VM.AjouteL2Command.CanExecute(null)); VM.LockCurrentCandidat(); // Après Verrouillage => Ajout L2 impossible car pas de L1 Assert.IsFalse(VM.AjouteL2Command.CanExecute(null)); // Ajout du Livret1 VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); // Date de validé > Ajourd'hui VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); // L'ajout de L2 Est Possible car le L1 est valide Assert.IsTrue(VM.AjouteL2Command.CanExecute(null)); // Modification de la date de Validié < Ajourd'hui VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(-1); VM.ValideretQuitterL1(); // L'ajout de L2 Est impossible car le L1 n'est pas valide Assert.IsFalse(VM.AjouteL2Command.CanExecute(null)); VM.ParamDelaiValiditeL1 = nDelaiValiditeL1avant; VM.saveDataParam(); }//GestVAE015
public void GESTVAE001() { MyViewModel VM = new MyViewModel(); VM.rechNom = "TEST1"; VM.Recherche(); Assert.AreEqual(0, VM.lstCandidatVM.Count); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(); VM.rechNom = "TEST1"; VM.Recherche(); Assert.AreEqual(1, VM.lstCandidatVM.Count); }
public void TestchgmtDateValiditesurdatenotifJury() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.DateValidite = DateTime.Today.AddDays(10); oL1.FTO_SetDecisionJuryL1Favorable(); VM.ValideretQuitterL1(); VM.saveData(); VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; Assert.AreEqual(oL1.DateValidite, oL2.DateValidite); oL2.DateNotificationJury = DateTime.Today; Assert.AreEqual(oL1.DateValidite, oL2.DateValidite); }
public void GESTVAE018() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); //Lock du candidat sur POSTE1 VM.CurrentCandidat = VM.lstCandidatVM[0]; // Le candidat n'a pas obtenu le CAFDES Assert.IsFalse(VM.CurrentCandidat.IsCAFDES); VM.LockCurrentCandidat(); VM.AjouteL1(); VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); VM.AjouteL2(); // Decision = DéFavorable DateValidité > Now VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2DeFavorable(); VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(-1); VM.ValideretQuitterL2(); // Le candidat n'a pas obtenu le diplome Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; DiplomeCandVM oDip = VM.CurrentCandidat.getDiplomeCand(oL2); Assert.IsNotNull(oDip); // L'état du diplome est refusé Assert.AreEqual("Refusé", oDip.StatutDiplome); }//GestVAE018
public void CRUDTest() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; oCand.Nom = "TESTADD"; VM.saveData(); VM.rechNom = "TESTADD"; VM.Recherche(); VM.CurrentCandidat = VM.lstCandidatVM[0]; Assert.AreEqual("TESTADD", VM.CurrentCandidat.Nom); Assert.IsTrue(String.IsNullOrEmpty(VM.CurrentCandidat.Commentaire)); VM.CurrentCandidat.Commentaire = "COMMENTAIRE"; VM.CurrentCandidat.TypeCommentaire = GestVAEcls.EnumTypeCommentaire.INFO; VM.saveData(); VM.rechNom = "TESTADD"; VM.Recherche(); VM.CurrentCandidat = VM.lstCandidatVM[0]; VM.LockCurrentCandidat(); Assert.AreEqual("TESTADD", VM.CurrentCandidat.Nom); Assert.AreEqual("COMMENTAIRE", VM.CurrentCandidat.Commentaire); Assert.AreEqual(GestVAEcls.EnumTypeCommentaire.INFO, VM.CurrentCandidat.TypeCommentaire); VM.DeleteCurrentCandidat(); VM.saveData(); VM.rechNom = "TESTADD"; VM.Recherche(); Assert.AreEqual(0, VM.lstCandidatVM.Count); }
public void testDCAValider() { MyViewModel VM = new MyViewModel(true); //Ajout d'un candidat avec un L1 Favorable VM.AjouteCandidat(); CandidatVM oCand = VM.CurrentCandidat; VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)oCand.CurrentLivret; oL1.FTO_SetDecisionJuryL1Favorable(); VM.ValideretQuitterL1(); VM.saveData(); // Ajout D'un L2 VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; Assert.IsTrue(oL2.lstDCLivret[0].IsAValider); Assert.IsTrue(oL2.lstDCLivret[1].IsAValider); Assert.IsTrue(oL2.lstDCLivret[2].IsAValider); Assert.IsTrue(oL2.lstDCLivret[3].IsAValider); Assert.AreEqual("En Cours", oL2.lstDCLivret[0].Statut); Assert.AreEqual("En Cours", oL2.lstDCLivret[1].Statut); Assert.AreEqual("En Cours", oL2.lstDCLivret[2].Statut); Assert.AreEqual("En Cours", oL2.lstDCLivret[3].Statut); // Validation partielle du L2 oL2.FTO_SetDecisionJuryL2Partielle(); oL2.lstDCLivret[0].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[1].Decision = oL2.DecisionL2ModuleDeFavorable; oL2.lstDCLivret[2].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[3].Decision = oL2.DecisionL2ModuleDeFavorable; VM.ValideretQuitterL2(); VM.saveData(); // test de l'état des DCCand après Décision du jury Assert.AreEqual("Validé", oCand.lstDiplomesCandVMs[0].StatutDC1); Assert.AreEqual("Refusé", oCand.lstDiplomesCandVMs[0].StatutDC2); Assert.AreEqual("Validé", oCand.lstDiplomesCandVMs[0].StatutDC1); Assert.AreEqual("Refusé", oCand.lstDiplomesCandVMs[0].StatutDC4); // Création d'un nouveau L2 VM.AjouteL2(); oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; Assert.IsFalse(oL2.lstDCLivret[0].IsAValider); Assert.IsTrue(oL2.lstDCLivret[1].IsAValider); Assert.IsFalse(oL2.lstDCLivret[2].IsAValider); Assert.IsTrue(oL2.lstDCLivret[3].IsAValider); Assert.AreEqual("Validé", oL2.lstDCLivret[0].Statut); Assert.AreEqual("Refusé", oL2.lstDCLivret[1].Statut); Assert.AreEqual("Validé", oL2.lstDCLivret[2].Statut); Assert.AreEqual("Refusé", oL2.lstDCLivret[3].Statut); // Validation PArtielle du L2 oL2.FTO_SetDecisionJuryL2Partielle(); oL2.lstDCLivret[1].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[3].Decision = oL2.DecisionL2ModuleDeFavorable; VM.ValideretQuitterL2(); VM.saveData(); // test de l'état des DCCand Assert.AreEqual("Validé", oCand.lstDiplomesCandVMs[0].StatutDC1); Assert.AreEqual("Validé", oCand.lstDiplomesCandVMs[0].StatutDC2); Assert.AreEqual("Validé", oCand.lstDiplomesCandVMs[0].StatutDC1); Assert.AreEqual("Refusé", oCand.lstDiplomesCandVMs[0].StatutDC4); VM.AjouteL2(); oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; Assert.IsFalse(oL2.lstDCLivret[0].IsAValider); Assert.IsFalse(oL2.lstDCLivret[1].IsAValider); Assert.IsFalse(oL2.lstDCLivret[2].IsAValider); Assert.IsTrue(oL2.lstDCLivret[3].IsAValider); Assert.AreEqual("Validé", oL2.lstDCLivret[0].Statut); Assert.AreEqual("Validé", oL2.lstDCLivret[1].Statut); Assert.AreEqual("Validé", oL2.lstDCLivret[2].Statut); Assert.AreEqual("Refusé", oL2.lstDCLivret[3].Statut); oL2.FTO_SetDecisionJuryL2Partielle(); oL2.lstDCLivret[3].Decision = oL2.DecisionL2ModuleFavorable; VM.ValideretQuitterL2(); VM.saveData(); }
public void GESTVAE016() { MyViewModel VM = new MyViewModel(true); VM.AjouteCandidat(); CandidatVM oCan = VM.CurrentCandidat; oCan.Nom = "TEST1"; VM.saveData(); VM = new MyViewModel(true); VM.rechNom = "TEST1"; VM.Recherche(); VM.CurrentCandidat = VM.lstCandidatVM[0]; VM.LockCurrentCandidat(); // Avant Verrouillage => Ajout L2 impossible Assert.IsFalse(VM.AjouteL2Command.CanExecute(null)); // Ajout du Livret1 Favorable Date de validité > Aujourd'hui VM.AjouteL1(); Livret1VM oL1 = (Livret1VM)VM.CurrentCandidat.CurrentLivret; VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL1Favorable(); // Date de validé > Ajourd'hui VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL1(); // Ajout d'un Livret2 (non complet) VM.AjouteL2(); Livret2VM oL2 = (Livret2VM)VM.CurrentCandidat.CurrentLivret; VM.CurrentCandidat.CurrentLivret.DateValidite = DateTime.Now.AddDays(1); oL2.lstDCLivret[0].IsAValider = true; oL2.lstDCLivret[1].IsAValider = true; oL2.lstDCLivret[2].IsAValider = true; oL2.lstDCLivret[3].IsAValider = true; VM.ValideretQuitterL2(); //Ajout de L2 impossible car L2 en cours Assert.IsTrue(VM.CurrentCandidat.ISL2EnCours); Assert.IsFalse(VM.AjouteL2Command.CanExecute(null)); // Le L2 est Validé Partiellement => on peut Ajouter un L2 VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2Partielle(); oL2.lstDCLivret[0].Decision = oL2.DecisionL2ModuleFavorable; oL2.lstDCLivret[1].Decision = oL2.DecisionL2ModuleDeFavorable; oL2.lstDCLivret[2].Decision = oL2.DecisionL2ModuleDeFavorable; oL2.lstDCLivret[3].Decision = oL2.DecisionL2ModuleDeFavorable; Assert.IsTrue(VM.AjouteL2Command.CanExecute(null)); // Même Si le Livret1 est echue oL1.DateValidite = DateTime.Now.AddDays(-1); Assert.IsTrue(VM.IsCurrentCandidatAddL2Available); Assert.IsTrue(VM.AjouteL2Command.CanExecute(null)); // Et même Si on Lui ajoute un L2 Refusé VM.AjouteL2(); Livret2VM oL2bis = (Livret2VM)VM.CurrentCandidat.CurrentLivret; VM.CurrentCandidat.CurrentLivret.FTO_SetDecisionJuryL2DeFavorable(); oL2bis.DateValidite = DateTime.Now.AddDays(1); VM.ValideretQuitterL2(); Assert.IsTrue(VM.AjouteL2Command.CanExecute(null)); }//GestVAE016