public List<UnsettledBetModel> GetBetsWithStake30TimesAboveAvg(IEnumerable<CustomerModel> customers, IEnumerable<UnsettledBetModel> unsetteledBets)
        {
            const int multiplier = 30;

            var betsAboveAvg = new BetsHigherThanAvg(unsetteledBets, customers, multiplier);
            return _calculator.DoCalculation(betsAboveAvg);
        }
Exemplo n.º 2
0
        public void When_No_Bets_10_Times_Higher_Than_Avg_Exist_Then_No_Records_Returned()
        {
            var betHigherThanAvg = new BetsHigherThanAvg(new List<UnsettledBetModel>
                {
                    new UnsettledBetModel
                        {
                            Id = 3,
                            CustomerId = 1,
                            CustomerName = string.Empty,
                            EventId = 5,
                            ParticipantId = 8,
                            Stake = 750,
                            ToWin = 3500
                        },
                    new UnsettledBetModel
                        {
                            Id = 4,
                            CustomerId = 2,
                            CustomerName = string.Empty,
                            EventId = 5,
                            ParticipantId = 8,
                            Stake = 450,
                            ToWin = 900
                        }
                }, new List<CustomerModel>
                    {
                        new CustomerModel {Id = 1, Fullname = string.Empty, AverageBet = 100},
                        new CustomerModel {Id = 2, Fullname = string.Empty, AverageBet = 50}
                    }, 10);

            var calculator = new BetCalculatorService();
            var result = calculator.DoCalculation(betHigherThanAvg);

            Assert.IsNull(result, "Zero not returned when higher than average bets do not exist");
        }