public async Task DeleteBot() { var controller = new BotController(Manager, new AdminManager(Context, LogUtils.FakeLogger <AdminManager>()), User); var bot = await PostTestBot(controller); Assert.AreEqual(2, Context.Users.Count()); await controller.DeleteAsync(bot.Id); Assert.AreEqual(1, Context.Users.Count()); User.SetPermissions(new string[] { }); Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.DeleteAsync(null)); }