public async Task SaveQuoteCommand_validation_should_fail_with_empty_required_fields() { var handler = new ChangeQuoteCommandHandler(_unitOfWork); var command = new ChangeQuoteCommand(Guid.Empty, null); var result = await handler.Handle(command, CancellationToken.None); result.ValidationResult.IsValid.Should().BeFalse(); result.ValidationResult.Errors.Count.Should().Be(2); }
public async Task <IActionResult> ChangeQuote([FromBody] ChangeQuoteRequest request) { var command = new ChangeQuoteCommand(request.QuoteId, request.Product); return(await Response(command)); }