Exemplo n.º 1
0
        public void Delete_Reminder_Admin_Check()
        {
            setUpUser();

            Assert.That(RemindMeController.DeleteReminder(1, "Admin2"), Is.EqualTo(true));

            File.Delete(Constants.remindMePath);
        }
Exemplo n.º 2
0
        public async Task DeleteReminder(string id)
        {
            //Gets your discord user id
            var msg       = Context.Message;
            var discordId = msg.Author.Username;

            // Delete item from the db
            bool hasDeleted = RemindMeController.DeleteReminder(Convert.ToInt32(id), discordId);

            if (hasDeleted)
            {
                await ReplyAsync($"{id} was deleted");
            }

            else
            {
                await ReplyAsync($"You cannot delete someone elses reminders! Not cool...");
            }
        }
Exemplo n.º 3
0
 public async Task AdminDeleteReminder(string id)
 {
     // Delete item from the db
     RemindMeController.DeleteReminder(Convert.ToInt32(id), "Admin2");
     await ReplyAsync($"{id} was deleted");
 }
Exemplo n.º 4
0
 public void Delete_Reminder_Fails()
 {
     setUpUser();
     Assert.That(RemindMeController.DeleteReminder(1, "Test"), Is.EqualTo(false));
     File.Delete(Constants.remindMePath);
 }