コード例 #1
0
        public SellOrderResponseDto Execute(SellOrdersRequestDto request)
        {
            var validateRequest = ValidateRequestStructure.Execute(request);

            if (validateRequest.Any())
            {
                return(SellOrderResponseDto.Build(validateRequest, null));
            }

            var validateBusinessRules = validateSellOrderBusinessRules.Execute(request);

            if (validateBusinessRules.ErrorList != null && validateBusinessRules.ErrorList.Any())
            {
                messageErrorList.AddRange(validateBusinessRules.ErrorList);
            }

            request.OrderList = validateBusinessRules.Result;

            var sellOrderProcess = processSellOrder.Execute(request);

            if (sellOrderProcess.ErrorList != null && sellOrderProcess.ErrorList.Any())
            {
                messageErrorList.AddRange(sellOrderProcess.ErrorList);
            }

            return(SellOrderResponseDto.Build(messageErrorList, sellOrderProcess.Result));
        }
コード例 #2
0
 internal static void FailureUser(SellOrderResponseDto response)
 {
     response.Success.Should().BeTrue();
     response.BusinessErrorList.Should().NotBeNull();
     response.BusinessErrorList.Any().Should().BeTrue();
 }
コード例 #3
0
 internal static void Succesfull(SellOrderResponseDto response)
 {
     response.Success.Should().BeTrue();
 }