public async Task Cancel_OkStatus() { // Arrange _userManager.Setup(x => x.GetUserAsync(It.IsAny <ClaimsPrincipal>())).ReturnsAsync(new User()); _userManager.Setup(x => x.GetRolesAsync(It.IsAny <User>())).ReturnsAsync(new List <string>() { "Admin" }); RegionAdministrationDTO admin = new RegionAdministrationDTO() { ID = 2 }; _logger.Setup(x => x.LogInformation(It.IsAny <string>())); int id = 0; // Act var result = await _regionController.Cancel(id); // Assert Assert.IsNotNull(result); Assert.AreEqual(200, ((ObjectResult)result).StatusCode); Assert.AreEqual("{ message = Річний звіт округи скасовано }", ((ObjectResult)result).Value.ToString()); }