Esempio n. 1
0
        public void EngineShouldReturnCorrectFeatureTypeForCollapsingSpin(int level)
        {
            var config      = new Configuration();
            var spinResult  = GenerateWinningNonBonusSpinResult(level);
            var featureType = FeatureBonusEngine.GetFeatureType(spinResult, config.BonusConfig.TriggerWeights[level]);

            Assert.AreEqual(Features.Collapse, featureType);
        }
Esempio n. 2
0
        public void EngineShouldReturnCorrectFeatureTypeForNonCollapse(int level)
        {
            var config               = new Configuration();
            var spinResult           = GenerateWithBonusSpinResult(level);
            var targetTriggerWeights = config.BonusConfig.TriggerWeights[level];
            var featureType          = FeatureBonusEngine.GetFeatureType(spinResult, config.BonusConfig.TriggerWeights[level]);

            Assert.IsTrue(targetTriggerWeights.Keys.Contains(featureType));
        }
        public void SpinResultShouldCreateValidBonusElementOnUpdateWhenWin(string wheelString, int level, decimal bet)
        {
            var config  = new Configuration();
            var spinBet = MainGameEngine.GenerateSpinBet(new RequestContext <SpinArgs>("", "", PlatformType.Web)
            {
                GameSetting = new Model.Entity.GameSetting {
                    GameSettingGroupId = 0
                },
                Currency = new Model.Entity.Currency {
                    Id = 0
                },
                Parameters = new SpinArgs
                {
                    LineBet    = bet,
                    Multiplier = 1,
                },
            });

            var wheel        = new Wheel(Game.WheelWidth, Game.WheelHeight, wheelString);
            var winPositions = MainGameEngine.GenerateWinPositions(
                config.Payline,
                config.PayTable,
                wheel,
                spinBet.LineBet,
                spinBet.Lines,
                spinBet.Multiplier);

            var spinResult = new Games.NuwaAndTheFiveElements.Models.GameResults.Spins.SpinResult(level, spinBet, wheel, null, winPositions, null, null)
            {
                Level = level
            };
            var featureType = FeatureBonusEngine.GetFeatureType(spinResult, config.BonusConfig.TriggerWeights[spinResult.Level]);
            var bonus       = FeatureBonusEngine.GetBonus(featureType, spinResult, config);

            spinResult.UpdateBonus(bonus);

            Assert.IsTrue(spinResult.Bonus.Id > 0 && !string.IsNullOrWhiteSpace(spinResult.Bonus.Value));
        }