public async Task ActivityController_PatchActivityStatus_BadRequest() { // Arrange Activity toBeUpdated = new Activity { Id = 1, Amount = 10, DateTime = DateTime.Now, Description = "Test", Status = "Pending" }; string newStatus = "Completed"; PatchActivityStatusDto patchDto = null; var mockActivityService = new MockActivityService().MockPatchActivityStatus(toBeUpdated, newStatus); var controller = new ActivitiesController(mockActivityService.Object, AutoMapperSingleton.Mapper); // Act var actionResult = await controller.PatchActivityStatus(1, patchDto); //Assert Assert.IsType <BadRequestResult>(actionResult); }
public async Task ActivityController_PatchActivityStatus_NotFound() { // Arrange Activity toBeUpdated = null; string newStatus = "Completed"; PatchActivityStatusDto patchDto = new PatchActivityStatusDto { Status = newStatus }; var mockActivityService = new MockActivityService().MockPatchActivityStatus(toBeUpdated, newStatus); var controller = new ActivitiesController(mockActivityService.Object, AutoMapperSingleton.Mapper); // Act var actionResult = await controller.PatchActivityStatus(1, patchDto); //Assert Assert.IsType <NotFoundResult>(actionResult); }