Example #1
0
        public async Task Controller_DELETE_APIKey()
        {
            var controller = new ApiKeyController(User, Manager);

            var str = await PostTestAPIKey();

            Assert.AreEqual(1, Context.ApiKeys.Count());
            await controller.DeleteAsync(str);

            Assert.AreEqual(0, Context.ApiKeys.Count());
            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.DeleteAsync(null));
        }