public void Get_Polls_Check() { setUpPoll(); string answer = PollController.ReurnCurrentPolls(); Assert.AreEqual(answer, $"1, {question}?,Yes: 0, No: 0 \n"); File.Delete(Constants.pollPath); }
public async Task CurrentPolls() { // Search the db for current reminders (active) string currentPolls = PollController.ReurnCurrentPolls(); if (currentPolls == "") { await ReplyAsync("There are no active Polls!"); } else { await ReplyAsync(currentPolls); } }
public void Vote_Poll_No_Check() { File.Delete(Constants.pollPath); setUpPoll(); string voted = PollController.VoteOnPoll("1", "no", "Admin"); Assert.AreEqual(voted, "Thanks for the vote"); string answer = PollController.ReurnCurrentPolls(); Assert.AreEqual(answer, $"1, {question}?,Yes: 0, No: 1 \n"); File.Delete(Constants.pollPath); }
public void Vote_Poll_Failed_Check() { File.Delete(Constants.pollPath); setUpPoll(); string voted = PollController.VoteOnPoll("1", "cake", "Admin"); Assert.AreEqual(voted, "Did not update"); string answer = PollController.ReurnCurrentPolls(); Assert.AreEqual(answer, $"1, {question}?,Yes: 0, No: 0 \n"); File.Delete(Constants.pollPath); }
public void Vote_Poll_Already_Voted_Check() { File.Delete(Constants.pollPath); setUpPoll(); PollController.VoteOnPoll("1", "yes", "Admin"); string voted = PollController.VoteOnPoll("1", "yes", "Admin"); Assert.AreEqual(voted, "You have already Voted!"); string answer = PollController.ReurnCurrentPolls(); Assert.AreEqual(answer, $"1, {question}?,Yes: 1, No: 0 \n"); File.Delete(Constants.pollPath); }