public void Per_player_bonus_issuance_limit_qualification_per_period(BonusPlayerRedemptionsLimitType periodType, int daysOffset) { MakeDeposit(PlayerId); var bonus = CreateFirstDepositBonus(); bonus.ActiveTo = bonus.ActiveTo.AddDays(60); bonus.Template.Availability.PlayerRedemptionsLimitType = periodType; bonus.Template.Availability.PlayerRedemptionsLimit = 2; bonus.Template.Info.TemplateType = BonusType.ReloadDeposit; MakeDeposit(PlayerId); MakeDeposit(PlayerId); MakeDeposit(PlayerId); BonusRedemptions.Count(br => br.ActivationState == ActivationStatus.Activated).Should().Be(2, because: "Only first 2 bonuses should be activated."); BonusRedemptions.Count(br => br.ActivationState != ActivationStatus.Activated).Should().Be(0, because: "Last deposit should not redeem bonus."); // Switch to the next datetime period SystemTime.Factory = () => DateTimeOffset.Now.AddDays(daysOffset); MakeDeposit(PlayerId); BonusRedemptions.Count(br => br.ActivationState == ActivationStatus.Activated).Should().Be(3, because: "Deposit falls into next period."); SystemTime.Factory = () => DateTimeOffset.Now; }
public void Can_redeem_bonus_providing_correct_bonusCode() { var bonus = CreateFirstDepositBonus(mode: IssuanceMode.AutomaticWithCode); MakeDeposit(PlayerId, bonusCode: bonus.Code); BonusRedemptions .Count(br => br.ActivationState == ActivationStatus.Activated) .Should().Be(1); }
public int List_does_not_contain_bonuses_for_player_with_invalid_within_registration_days(int withinRegistrationDays) { var bonus = CreateFirstDepositBonus(); bonus.Template.Availability.WithinRegistrationDays = withinRegistrationDays; var player = BonusRepository.Players.First(); player.DateRegistered = player.DateRegistered.AddDays(-7); MakeDeposit(PlayerId); return(BonusRedemptions.Count(br => br.ActivationState == ActivationStatus.Activated)); }