public ActionResult Suppression(int id, string Clef) { ClasseSondage classeSondage = DataAcces.RecupererSondageEnBDD(id); if (classeSondage.ClefDeSupression == Clef) { DataAcces.DesactivationSondage(id); return(RedirectToAction("VoteDesactiver", new { idsondageCourant = id })); } return(View()); }
public void TesteDesactivationSondage() { ReponseSondage Reponse = new ReponseSondage("UnitTest1"); ReponseSondage Reponse1 = new ReponseSondage("UnitTest2"); ReponseSondage Reponse2 = new ReponseSondage("UnitTest3"); List <ReponseSondage> ListeDeReponse = new List <ReponseSondage>(); ListeDeReponse.Add(Reponse); ListeDeReponse.Add(Reponse1); ListeDeReponse.Add(Reponse2); ClasseSondage sondage = new ClasseSondage("Creation d'un sondage UniTest", ListeDeReponse, false); int idUnitest = DataAcces.CreerUnSondage(sondage); DataAcces.DesactivationSondage(idUnitest); ClasseSondage SondageUniTest = DataAcces.RecupererSondageEnBDD(idUnitest); Assert.IsTrue(SondageUniTest.EtatDuSondage == false, "le sondage n'as pas été désactivé"); }