public async Task AddRoleToUser_ReturnsModel_WhenUserDoesntExist() { //Arrange userManager.CurrentRole = RoleType.Standard; controller.ControllerContext.HttpContext = new DefaultHttpContext(); //Act var result = await controller.AddRoleToUser("username", RoleType.Administrator.ToString()); //Assert var redirectToActionResult = Assert.IsType <RedirectToActionResult>(result); Assert.Equal("Role", redirectToActionResult.ControllerName); Assert.Equal("Index", redirectToActionResult.ActionName); }