public void First_deposit_bonus_works() { var bonus = CreateFirstDepositBonus(); bonus.Template.Info.TemplateType = BonusType.FirstDeposit; MakeDeposit(PlayerId); BonusRedemptions.Last().Amount.Should().Be(27); }
public void Percentage_deposit_bonus_reward_calculated_correctly() { var bonus = CreateFirstDepositBonus(); bonus.Template.Rules.RewardType = BonusRewardType.Percentage; MakeDeposit(PlayerId); BonusRedemptions.Last().Amount.Should().Be(5400); }
public void Bonus_reward_is_limited_by_RewardTier_reward_limit() { const decimal limit = 45m; var bonus = CreateFirstDepositBonus(); bonus.Template.Info.TemplateType = BonusType.ReloadDeposit; bonus.Template.Rules.RewardTiers.Single().RewardAmountLimit = limit; //Make 1st deposit so 2nd and 3rd deposits will be qualified MakeDeposit(PlayerId); MakeDeposit(PlayerId); Assert.AreEqual(27, BonusRedemptions.First().Amount); MakeDeposit(PlayerId); Assert.AreEqual(18, BonusRedemptions.Last().Amount); }
public void Bet_outcome_decreases_RolloverLeft_of_bonus_redemptions_one_by_one() { var bonus2 = CreateFirstDepositBonus(); bonus2.Template.Rules.RewardTiers.Single().BonusTiers.Single().Reward = 100; bonus2.Template.Wagering.HasWagering = true; bonus2.Template.Wagering.Multiplier = 3m; MakeDeposit(PlayerId, 800); var redemption1 = BonusRedemptions.First(); var redemption2 = BonusRedemptions.Last(); PlaceAndLoseBet(500, PlayerId); redemption1.RolloverState.Should().Be(RolloverStatus.Completed); redemption1.Contributions.SingleOrDefault(c => c.Type == ContributionType.Bet).Should().NotBeNull(); redemption2.RolloverState.Should().Be(RolloverStatus.Active); redemption2.Contributions.SingleOrDefault(c => c.Contribution == 200).Should().NotBeNull(); }
public void Flat_deposit_bonus_reward_calculated_correctly() { var bonus = CreateFirstDepositBonus(); //Adding a reward for RMB currency. This should not be used, 'cos Player's currency is CAD bonus.Template.Rules.RewardTiers.Add(new RewardTier { CurrencyCode = "RMB", BonusTiers = new List <TierBase> { new BonusTier { Reward = 100 } } }); MakeDeposit(PlayerId); BonusRedemptions.Last().Amount.Should().Be(27); }
public void Bet_outcome_decreases_RolloverLeft_of_bonus_redemption_that_was_created_first() { var bonus2 = CreateFirstDepositBonus(); bonus2.Template.Rules.RewardTiers.Single().BonusTiers.Single().Reward = 100; bonus2.Template.Wagering.HasWagering = true; bonus2.Template.Wagering.Multiplier = 3m; MakeDeposit(PlayerId, 400); var redemption1 = BonusRedemptions.First(); var redemption2 = BonusRedemptions.Last(); BonusRepository.GetLockedPlayer(PlayerId).Data.Wallets.First().BonusesRedeemed = new List <BonusRedemption> { redemption2, redemption1 }; PlaceAndLoseBet(50, PlayerId); redemption1.Contributions.SingleOrDefault(c => c.Type == ContributionType.Bet).Should().NotBeNull(); redemption2.Contributions.Should().BeEmpty(); }
public void Rest_of_qualification_is_not_processed_during_claim() { MakeDeposit(PlayerId); var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer); bonus.Template.Info.TemplateType = BonusType.ReloadDeposit; MakeDeposit(PlayerId, bonusId: bonus.Id); BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption { PlayerId = PlayerId, RedemptionId = BonusRedemptions.First().Id }); MakeDeposit(PlayerId, bonusId: bonus.Id); var bonusRedemption = BonusRedemptions.Last(); bonus.DurationType = DurationType.Custom; bonus.DurationStart = SystemTime.Now.AddMinutes(5); bonus.DurationEnd = SystemTime.Now.AddMinutes(10); bonus.Template.Availability.ParentBonusId = Guid.NewGuid(); bonus.Template.Availability.VipLevels = new List <BonusVip> { new BonusVip { Code = "Bronze" } }; bonus.Template.Availability.PlayerRedemptionsLimit = 1; BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption { PlayerId = PlayerId, RedemptionId = bonusRedemption.Id }); bonusRedemption .ActivationState.Should() .Be(ActivationStatus.Activated); }