예제 #1
0
        public void Referer_can_claim_2_different_bonus_redemptions()
        {
            var bonus = CreateBonusWithReferFriendTiers();

            bonus.Template.Info.Mode = IssuanceMode.ManualByPlayer;
            CompleteReferAFriendRequirments(PlayerId);
            bonus.IsActive = false;

            var bonus2 = CreateBonusWithReferFriendTiers();

            bonus2.Template.Info.Mode = IssuanceMode.ManualByPlayer;
            CompleteReferAFriendRequirments(PlayerId);
            bonus.IsActive = true;

            var bonusPlayer = BonusRepository.GetLockedPlayer(PlayerId);

            bonusPlayer.BonusesRedeemed.Count.Should().Be(2);
            bonusPlayer.BonusesRedeemed.All(br => br.Amount == 10).Should().BeTrue();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusPlayer.BonusesRedeemed.ElementAt(0).Id
            });
            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusPlayer.BonusesRedeemed.ElementAt(1).Id
            });
        }
        public void Fundin_ManualByPlayer_bonus_rollover_is_calculated()
        {
            var bonus         = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);
            var brandWalletId = bonus.Template.Info.Brand.WalletTemplates.First().Id;

            bonus.Template.Info.TemplateType   = BonusType.FundIn;
            bonus.Template.Rules.FundInWallets = new List <BonusFundInWallet>
            {
                new BonusFundInWallet {
                    WalletId = brandWalletId
                }
            };
            bonus.Template.Wagering.HasWagering = true;
            bonus.Template.Wagering.Method      = WageringMethod.TransferAmount;
            bonus.Template.Wagering.Multiplier  = 2;

            //depositing funds to use them for fund in
            MakeDeposit(PlayerId);
            MakeFundIn(PlayerId, brandWalletId, 100, bonusId: bonus.Id);

            var bonusRedemption = BonusRedemptions.First();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption.Rollover.Should().Be(200);
        }
예제 #3
0
        public void Bonus_issued_by_Cs_ignores_bonus_claim_duration_qualification()
        {
            MakeDeposit(PlayerId);
            var transaction = BonusRepository.Players.Single(p => p.Id == PlayerId).Wallets.SelectMany(t => t.Transactions).First();
            var bonus       = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            bonus.DaysToClaim = 1;

            BonusCommands.IssueBonusByCs(new IssueBonusByCs
            {
                BonusId       = bonus.Id,
                PlayerId      = PlayerId,
                TransactionId = transaction.Id
            });

            var bonusRedemption = BonusRedemptions.Single();

            //expiring the bonus
            bonus.ActiveTo = bonus.ActiveTo.AddDays(-2);
            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption.ActivationState.Should().Be(ActivationStatus.Activated);
        }
예제 #4
0
        public void Player_should_activate_ManualByPlayer_mode_bonus_redemption()
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            MakeDeposit(PlayerId, bonusId: bonus.Id);

            var bonusRedemption = BonusRedemptions.First();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption.ActivationState.Should().Be(ActivationStatus.Activated);
        }
예제 #5
0
        public void Bonus_claim_by_fraudulent_player_negates_it()
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            MakeDeposit(PlayerId, bonusId: bonus.Id);
            DisableBonusesForPlayer(PlayerId);

            var bonusRedemption = BonusRedemptions.First();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption.ActivationState.Should().Be(ActivationStatus.Negated);
        }
예제 #6
0
        public void Can_claim_percentage_reward_type_bonus()
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            bonus.Template.Rules.RewardType = BonusRewardType.Percentage;
            bonus.Template.Rules.RewardTiers.Single().Tiers.Single().Reward = 0.5m;

            MakeDeposit(PlayerId, 1000, bonusId: bonus.Id);

            var bonusRedemption = BonusRedemptions.Single();

            Assert.DoesNotThrow(() => BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            }));
            bonusRedemption.Amount.Should().Be(500);
            bonusRedemption.ActivationState.Should().Be(ActivationStatus.Activated);
        }
        public void Deposit_ManualByPlayer_bonus_rollover_is_calculated()
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            bonus.Template.Wagering.HasWagering = true;
            bonus.Template.Wagering.Method      = WageringMethod.TransferAmount;
            bonus.Template.Wagering.Multiplier  = 2;

            MakeDeposit(PlayerId, bonusId: bonus.Id);

            var bonusRedemption = BonusRedemptions.First();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption.Rollover.Should().Be(400);
        }
        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);
        }
        public void Claiming_bonus_outside_claim_duration_negates_it()
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            bonus.DaysToClaim = 1;

            MakeDeposit(PlayerId, bonusId: bonus.Id);
            //expiring the bonus
            bonus.ActiveTo = bonus.ActiveTo.AddDays(-3);

            var bonusRedemption = BonusRedemptions.First();

            BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
            {
                PlayerId     = PlayerId,
                RedemptionId = bonusRedemption.Id
            });

            bonusRedemption
            .ActivationState.Should()
            .Be(ActivationStatus.Negated);
        }
예제 #10
0
        public decimal Verification_bonus_redemption_locks_bonus_only(bool isAfterWager)
        {
            var bonus = CreateFirstDepositBonus(mode: IssuanceMode.ManualByPlayer);

            bonus.Template.Info.TemplateType     = BonusType.MobilePlusEmailVerification;
            bonus.Template.Wagering.HasWagering  = true;
            bonus.Template.Wagering.IsAfterWager = isAfterWager;

            var player          = CreatePlayer();
            var bonusRedemption = player.Wallets.First().BonusesRedeemed.First();

            VerifyPlayerContact(player.Id, ContactType.Mobile);
            VerifyPlayerContact(player.Id, ContactType.Email);
            if (isAfterWager == false)
            {
                BonusCommands.ClaimBonusRedemption(new ClaimBonusRedemption
                {
                    PlayerId     = player.Id,
                    RedemptionId = bonusRedemption.Id
                });
            }

            return(bonusRedemption.LockedAmount);
        }
예제 #11
0
 public void ClaimBonusRedemption(ClaimBonusRedemption model)
 {
     _bonusCommands.ClaimBonusRedemption(model);
 }