public void GivenValidData_WhenValidateUpdate_ThenReturnNoErrors() { var command = UpdateConsultantByIdCommandFactory.ValidUpdateConsultantCommand(_consultant.Id); var result = _validator.TestValidate(command); result.IsValid.Should().BeTrue(); result.ShouldNotHaveAnyValidationErrors(); }
public async Task GivenConsultantController_WhenUpdateIsCalled_ThenReturnNoContent() { var id = ObjectId.GenerateNewId().ToString(); var command = UpdateConsultantByIdCommandFactory.ValidUpdateConsultantCommand(id); var result = await _controller.Update(command); var noContentResult = result as NoContentResult; noContentResult.Should().NotBeNull(); noContentResult.StatusCode.Should().Be(204); A.CallTo(() => _mediator.Send(command, default)).MustHaveHappenedOnceExactly(); }