public void UpdateClaim_ClaimNotExists() { try { _claimsController.Update(new UpdateClaimRequest { Code = "test.performance.a", Description = "test" }); } catch (ResponseException) { } }
public async Task Update_UpdateUnexistedClaim_ProperMethodsCalledAndReturnNotFoundResult() { _mediatorMock.Setup(mediator => mediator.Send(It.IsAny <UpdateClaimCommand>(), It.IsAny <CancellationToken>())).ReturnsAsync(false).Verifiable(); //Act var controller = new ClaimsController(_mediatorMock.Object); var result = await controller.Update(new UpdateClaimCommand(1, DateTime.UtcNow, 2, "descripton", "incidence", "Review", "damagedItem", "street", "city", "country")); //Assert Assert.True(((StatusCodeResult)result).StatusCode == (int)HttpStatusCode.NotFound); _mediatorMock.Verify(); }