/// <summary>
        /// The judgement.
        /// </summary>
        /// <param name="judgementContext">
        /// The judgement context.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task Judgement(IFixedIncomeHighProfitJudgementContext judgementContext)
        {
            if (judgementContext == null)
            {
                this.logger?.LogError("Fixed Income High Profit Judgement was null");
                return;
            }

            if (string.IsNullOrWhiteSpace(judgementContext?.Judgement?.OrderId))
            {
                this.logger?.LogInformation(
                    "Fixed Income High Profit Judgement had no order id - this is normal for market close analysis");
                return;
            }

            await this.judgementRepository.SaveAsync(judgementContext.Judgement);

            if (!judgementContext.RaiseRuleViolation)
            {
                return;
            }

            var projectedBreach = this.fixedIncomeHighProfitJudgementMapper.Map(judgementContext);

            this.ruleViolationService.AddRuleViolation(projectedBreach);
        }
 public void Setup()
 {
     this.logger            = A.Fake <ILogger <FixedIncomeHighProfitJudgementMapper> >();
     this.judgementContext  = A.Fake <IFixedIncomeHighProfitJudgementContext>();
     this.ruleBreachContext = A.Fake <IRuleBreachContext>();
     this.parameters        = A.Fake <IHighProfitsRuleFixedIncomeParameters>();
     this.profitBreakdown   = A.Fake <IExchangeRateProfitBreakdown>();
 }
 public void Setup()
 {
     this.judgementRepository                       = A.Fake <IJudgementRepository>();
     this.highProfitJudgementContext                = A.Fake <IHighProfitJudgementContext>();
     this.cancelledOrderJudgementContext            = A.Fake <ICancelledOrderJudgement>();
     this.highVolumeJudgementContext                = A.Fake <IHighVolumeJudgement>();
     this.layeringJudgementContext                  = A.Fake <ILayeringJudgement>();
     this.placingOrdersWithNoIntentJudgementContext = A.Fake <IPlacingOrdersWithNoIntentToExecuteJudgement>();
     this.rampingJudgementContext                   = A.Fake <IRampingJudgement>();
     this.markingTheCloseJudgementContext           = A.Fake <IMarkingTheCloseJudgement>();
     this.spoofingJudgementContext                  = A.Fake <ISpoofingJudgement>();
     this.highProfitJudgementMapper                 = A.Fake <IHighProfitJudgementMapper>();
     this.fixedIncomeProfitJudgementMapper          = A.Fake <IFixedIncomeHighProfitJudgementMapper>();
     this.fixedIncomeProfitJudgementContext         = A.Fake <IFixedIncomeHighProfitJudgementContext>();
     this.fixedIncomeHighVolumeJudgementMapper      = A.Fake <IFixedIncomeHighVolumeJudgementMapper>();
     this.fixedIncomeHighVolumeJudgementContext     = A.Fake <IFixedIncomeHighVolumeJudgementContext>();
     this.ruleViolationService                      = A.Fake <IRuleViolationService>();
     this.logger = A.Fake <ILogger <JudgementService> >();
 }