public void SetUp()
        {
            _scheduledFlightSummaryCalculator = Substitute.For <IScheduledFlightSummaryCalculator>();

            _scheduledFlightSummaryCalculator.CalculateSummary(Arg.Any <IEnumerable <Passenger> >(), Arg.Any <FlightRoute>()).Returns(new ScheduledFlightSummary());

            _summaryBuilder = new SummaryBuilder(_scheduledFlightSummaryCalculator);
        }
        public ScheduledFlight(FlightRoute flightRoute, ISummaryBuilder summaryBuilder, ISummaryOutputGenerator summaryOutputGenerator, IFleetRepository fleetRepository)
        {
            FlightRoute = flightRoute;

            _summaryBuilder         = summaryBuilder;
            _summaryOutputGenerator = summaryOutputGenerator;
            _fleetRepository        = fleetRepository;

            Passengers = new List <Passenger>();
        }
示例#3
0
        internal void AddParse(string type, ISummaryBuilder builder, CombinedStats combined, List <PlayerStats> selected = null, bool copy = false)
        {
            Parses[type] = new ParseData()
            {
                Builder = builder, CombinedStats = combined
            };

            if (selected != null)
            {
                Parses[type].Selected.AddRange(selected);
            }

            if (!AvailableParses.Contains(type))
            {
                Dispatcher.InvokeAsync(() => AvailableParses.Add(type));
            }

            TriggerParseUpdate(type, copy);
        }
示例#4
0
        public async Task <Pet> Get(string username,
                                    [FromServices] IMongoCollection <User> users,
                                    [FromServices] ISummaryBuilder summaryBuilder,
                                    CancellationToken cancel)
        {
            var user = users.AsQueryable().First(u => u.Username == username);

            var now  = DateTimeOffset.UtcNow;
            var then = now.AddMonths(-1);

            var finalSummary = await summaryBuilder.Summarise(user, then, now, cancel);

            return(new Pet
            {
                Id = Guid.NewGuid(),
                Health = CalculateHealth(finalSummary),
                BonusHealth = CalculateBonus(finalSummary),
                Summary = finalSummary,
            });
        }
示例#5
0
 public ResultBuilder(IBuilder <IEnumerable <Rule>, string> ruleBuilder, ISummaryBuilder summaryBuilder)
 {
     RuleBuilder    = ruleBuilder;
     SummaryBuilder = summaryBuilder;
     Rules          = null;
 }
 public TermReplacementController(ITermReplacer termReplacer, ISummaryBuilder summaryBuilder)
 {
     _termReplacer   = termReplacer;
     _summaryBuilder = summaryBuilder;
 }
示例#7
0
 public SummaryResultBuilder(IBuilder <IEnumerable <int>, string> resultListBuilder, ISummaryBuilder summaryBuilder)
 {
     ResultListBuilder = resultListBuilder;
     SummaryBuilder    = summaryBuilder;
 }