private ApiError Validate(OrderDto orderDto) { var errors = new List <ApiError>(); errors.AddRange(_orderValidation.ValidateOrderNumber(orderDto.OrderNumber)); errors.AddRange(_orderValidation.ValidateUser(orderDto.UserId)); errors.AddRange(_orderValidation.ValidateAmount(orderDto.Amount)); errors.AddRange(_orderValidation.ValidateGatewayIdentifier(orderDto.PaymentGateway)); return(new ApiError(errors.FirstOrDefault()?.Message, errors)); }
public void ValidateAmount(decimal amount, bool success) { var result = _orderValidation.ValidateAmount(amount); AssertResult(result, success); }