public void Delete_Poll_Admin_Check() { setUpPoll(); Assert.That(PollController.DeletePoll(1, "Admin2"), Is.EqualTo(true)); File.Delete(Constants.pollPath); }
public void Delete_Poll_Failed_Check() { setUpPoll(); Assert.That(PollController.DeletePoll(1, "test"), Is.EqualTo(false)); File.Delete(Constants.pollPath); }
public async Task DeletePoll(string id) { // Discord user info var msg = Context.Message; var discordId = msg.Author.Username; bool hasDeleted = PollController.DeletePoll(Convert.ToInt32(id), discordId); if (hasDeleted == true) { await ReplyAsync($"{id} was deleted"); } else { await ReplyAsync($"You cannot delete someone elses poll! Not cool..."); } }