Esempio n. 1
0
        public async Task GetBots()
        {
            var controller = new BotController(Manager, new AdminManager(Context, LogUtils.FakeLogger <AdminManager>()), User);

            await PostTestBot(controller);

            var res   = controller.Get() as JsonResult;
            var elems = res.Value as IEnumerable <Models.Output.User>;

            Assert.AreEqual(1, elems.Count());
            User.SetPermissions(new string[] { });
            Assert.Throws <Shared.Exceptions.InsuficientPermission>(() => controller.Get());
        }