public async Task TestDeleteRoomBedRelationById_Success_OkResponse() { // Arrange var id = 1; mockRoomRepository.Setup(a => a.DeleteRoomBedRelationById(It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(new BaseResult <bool>() { Result = true })).Verifiable(); //Act var result = await mockRoomController.DeleteRoomBedRelationById(id); BaseResult <bool> finalResult = (result as Microsoft.AspNetCore.Mvc.OkObjectResult).Value as BaseResult <bool>; //Assert Assert.AreEqual(((Microsoft.AspNetCore.Mvc.ObjectResult)result).StatusCode, 200); Assert.IsNotNull(finalResult); Assert.IsTrue(!finalResult.IsError); }