public void DeleteExistingCircleByMember_ReturnUnauthorized() { //Arrange _controller.ControllerContext = new ControllerContext { HttpContext = new DefaultHttpContext { User = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.NameIdentifier, CommonTestData.AppUserList.Find(au => au.Id == 2).AccountId) })) } }; var result = _controller.Delete(1).Result; Assert.IsType <UnauthorizedResult>(result); }