Exemple #1
0
        public void HasVoted_UserHasVoted_ReturnsTrue()
        {
            int surveyId = dal.CreateSurvey();
            int userId   = dal.AddUser("New user", "12345");

            dal.CreateRestaurant("La bonne fourchette", "01 02 03 04 05");
            dal.AddVote(surveyId, 1, userId);

            bool hasVoted = dal.HasVoted(surveyId, userId.ToString());

            Assert.IsTrue(hasVoted);
        }
Exemple #2
0
        public void ADejaVote_UtilisateurAVote_RetourneTrue()
        {
            int idSondage     = dal.CreateSurvey();
            int idUtilisateur = dal.AddUser("Nouvel utilisateur", "12345");

            dal.CreateRestaurant("La bonne fourchette", "0102030405");
            dal.AddVote(idSondage, 1, idUtilisateur);

            bool aVote = dal.HasAlreadyVoted(idSondage, idUtilisateur.ToString());

            Assert.IsTrue(aVote);
        }