Example #1
0
        public async Task <ActionResult> RoleDelete(int id)
        {
            if (id < 0)
            {
                return(BadRequest());
            }
            await dictionaryStorage.RoleDelete(id);

            return(Ok());
        }
Example #2
0
        private async Task RoleTestDelete(List <Role> listRole)
        {
            foreach (Role listRole1 in listRole)
            {
                List <Role> list = dictionaryStorage.RoleGetAll().Result;
                await dictionaryStorage.RoleDelete((int)listRole1.Id);

                List <Role> list1 = dictionaryStorage.RoleGetAll().Result;
                Assert.AreEqual(list.Count - 1, list1.Count);

                Assert.False(list1.Contains(listRole1));
            }
        }