Beispiel #1
0
        private async Task <RedirectToRouteResult> DeleteUser(string id)
        {
            var user = await userService.GetByIdAsync(id);

            var result = (await operatorController.Delete(user.Id)) as ViewResult;

            if (result == null)
            {
                return(null);
            }
            else
            {
                return((await operatorController.Delete((DeleteOperatorModel)result.Model)) as RedirectToRouteResult);
            }
        }
Beispiel #2
0
        public void Delete()
        {
            try
            {
                string id = "login_2";

                var controller = new OperatorController();
                controller.Delete(id);

                Assert.IsNull(controller.Get(id));
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }