Example #1
0
        public async Task BotLogin()
        {
            var controller = new BaseController(new UserManager(Context), Manager, User);

            Assert.ThrowsAsync <InvalidCredentials>(() => controller.BotLogin(new Models.Input.Auth.Bot()
            {
                AppId     = Context.Users.First().Id,
                AppSecret = Context.Users.First().Pass
            }));
            Context.Users.First().IsBot = true;
            var res = await controller.BotLogin(new Models.Input.Auth.Bot()
            {
                AppId     = Context.Users.First().Id,
                AppSecret = Context.Users.First().Pass
            }) as JsonResult;

            var tok = res.Value as string;

            Assert.IsNotNull(tok);
        }