Exemplo n.º 1
0
        public void EngineShouldCopyBonusValuesFromResultToXml(int gameId, int level)
        {
            var module     = GetModule(gameId);
            var spinResult = GenerateWithBonusSpinResult(level);

            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var freeSpinResult = GenerateFreeSpinResult(level);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult);
            var xElement            = freeSpinBonusResult.ToXElement();
            var responseXml         = new FreeSpinBonusXml();

            using (var xmlReader = xElement.CreateReader())
            {
                responseXml.ReadXml(xmlReader);
            }

            Assert.IsNull(responseXml.GetSchema());
            Assert.AreEqual(freeSpinBonusResult.TotalWin, responseXml.TotalWin);
            Assert.AreEqual(freeSpinBonusResult.Counter, responseXml.Counter);
            Assert.AreEqual(freeSpinBonusResult.NumberOfFreeSpin, responseXml.NumberOfFreeSpin);
        }
Exemplo n.º 2
0
        public void EngineShouldReadResponseXmlOfFreeSpinBonusResult(int gameId, int level)
        {
            var module     = GetModule(gameId);
            var spinResult = GenerateWithBonusSpinResult(level);

            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var freeSpinResult = GenerateFreeSpinResult(level);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult);
            var xElement            = freeSpinBonusResult.ToXElement();

            Assert.DoesNotThrow(() =>
            {
                using (var xmlReader = xElement.CreateReader())
                {
                    var responseXml = new FreeSpinBonusXml();
                    responseXml.ReadXml(xmlReader);
                }
            });
        }
        public void EngineShouldCreateFreeSpinBonusResultFromFreeSpinResult(int level)
        {
            var config         = new Configuration();
            var requestContext = new RequestContext <BonusArgs>("", "", PlatformType.Web)
            {
                GameSetting = new Model.Entity.GameSetting {
                    GameSettingGroupId = 0
                },
                Currency = new Model.Entity.Currency {
                    Id = 0
                },
                Parameters = new BonusArgs(),
                Platform   = PlatformType.All
            };

            var spinResult             = GenerateSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var freeSpinResult = FreeSpinBonusEngine.CreateFreeSpinResult(level, requestContext, freeSpinMode, spinResult, config);

            Assert.DoesNotThrow(() => FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult));
        }
Exemplo n.º 4
0
        public void EngineShouldCompleteFreeSpinBonusResultOnBonusCompletion(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);
            freeSpinResult.UpdateBonus(freeSpinBonus);

            var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult);

            while (!freeSpinBonus.IsCompleted)
            {
                freeSpinResult = GenerateNonWinningFreeSpinResult(level);
                freeSpinBonus.UpdateBonus(freeSpinResult);
                freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult);
            }

            Assert.IsTrue(freeSpinBonusResult.IsCompleted);
        }
        public decimal FreeSpinResultShouldCreateCorrectPayout(string wheelString, int replacementSymbol, int freeSpinSelection, int freeSpinMultiplier, 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 freeSpinMode = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            FreeSpinResult freeSpinResult      = null;
            var            wheel               = new Wheel(Game.WheelWidth, Game.WheelHeight, wheelString.ToFormattedWheelString());
            var            stackedReels        = MainGameEngine.GetStackedSymbols(wheel);
            var            bonusPositions      = MainGameEngine.GenerateBonusPositions(wheel);
            var            hasWildStackedReels = stackedReels.Any(sr => sr.Symbol == Symbols.Wild);
            var            multiplier          = hasWildStackedReels ? freeSpinMultiplier : spinBet.Multiplier;

            if (wheel.CountDistinct(Symbols.Mystery) > 0)
            {
                var replacedMysterySymbolWheel = MainGameEngine.GenerateReplacedMysterySymbolWheel(config, wheel, replacementSymbol);
                var winPositions = MainGameEngine.GenerateWinPositions(
                    config.Payline,
                    config.PayTable,
                    replacedMysterySymbolWheel,
                    spinBet.LineBet,
                    spinBet.Lines,
                    multiplier);

                freeSpinResult = new FreeSpinResult(level, spinBet, wheel, winPositions, bonusPositions, multiplier, replacementSymbol);
            }
            else /// Calculate wins with initial wheel
            {
                var winPositions = MainGameEngine.GenerateWinPositions(
                    config.Payline,
                    config.PayTable,
                    wheel,
                    spinBet.LineBet,
                    spinBet.Lines,
                    multiplier);

                freeSpinResult = new FreeSpinResult(level, spinBet, wheel, winPositions, bonusPositions, multiplier);
            }

            return(freeSpinResult.Win);
        }
        public void EngineShouldCreateFreeSpinBonus(int level)
        {
            var spinResult             = GenerateSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            Assert.DoesNotThrow(() => FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus));
        }
        public void EngineShouldCreateFreeSpinBonusInstance(int level)
        {
            var config                 = new Configuration();
            var spinResult             = GenerateWithBonusSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            Assert.IsNotNull(FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus));
        }
        public void EngineShouldStartAndCompleteBonusOnCreateFreeSpinSelectionBonusResult(int level)
        {
            var config                 = new Configuration();
            var spinResult             = GenerateWithBonusSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            Assert.IsTrue(freeSpinSelectionBonus.IsStarted);
            Assert.IsTrue(freeSpinSelectionBonus.IsCompleted);
        }
        public void EngineShouldCreateFreeSpinBonusWithValidGuid(int level)
        {
            var config                 = new Configuration();
            var spinResult             = GenerateWithBonusSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            Assert.IsTrue(!string.IsNullOrWhiteSpace(freeSpinBonus.Guid.ToString()));
        }
Exemplo n.º 10
0
        public void EngineShouldCreateFreeSpinBonusWithTransactionId(int level)
        {
            var config                 = new Configuration();
            var spinResult             = GenerateWithBonusSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            Assert.IsTrue(freeSpinBonus.SpinTransactionId == spinResult.TransactionId);
        }
Exemplo n.º 11
0
        public void EngineShouldCreateFreeSpinBonusResultWithSameSpinTransactionId(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinSelectionBonusResult = FreeSpinBonusEngine.CreateFreeSpinSelectionBonusResult(freeSpinBonus);

            Assert.IsTrue(freeSpinSelectionBonusResult.SpinTransactionId == freeSpinBonus.SpinTransactionId);
        }
Exemplo n.º 12
0
        public void EngineShouldCreateFreeSpinBonusResultWithSameGameResultAndBonus(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinSelectionBonusResult = FreeSpinBonusEngine.CreateFreeSpinSelectionBonusResult(freeSpinBonus);

            Assert.AreSame(freeSpinSelectionBonusResult.Bonus, freeSpinBonus);
        }
Exemplo n.º 13
0
        public void EngineShouldShouldDeductCounterOnFreeSpin(int level)
        {
            var config                 = new Configuration();
            var freeSpinResult         = GenerateNonWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var initialCounter = freeSpinBonus.Counter;

            freeSpinBonus.UpdateBonus(freeSpinResult);

            Assert.AreEqual(initialCounter - 1, freeSpinBonus.Counter);
        }
Exemplo n.º 14
0
        public void EngineShouldIncompleteFreeSpinBonusIfWithCounter(int level)
        {
            var config                 = new Configuration();
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var initialCounter = freeSpinBonus.Counter;

            freeSpinBonus.UpdateBonus(freeSpinResult);

            Assert.IsTrue(!freeSpinBonus.IsCompleted);
        }
Exemplo n.º 15
0
        public void SpinResultShouldHaveSameBonusDetailsOnResultUpdate(int level)
        {
            var spinResult             = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var selection    = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode = FreeSpinBonusEngine.GetFreeSpinMode(selection);

            freeSpinSelectionBonus.UpdateBonus(selection, freeSpinMode);
            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(spinResult);
            spinResult.UpdateBonus(freeSpinBonus);

            var isEqualBonusId   = spinResult.BonusElement.Id == freeSpinBonus.Id;
            var isEqualBonusGuid = spinResult.BonusElement.Value == freeSpinBonus.Guid.ToString("N");

            Assert.IsTrue(isEqualBonusId && isEqualBonusGuid);
        }
Exemplo n.º 16
0
        public void FreeSpinResultShouldHaveSameCountersOnBonusElementOnResultUpdate(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);
            freeSpinResult.UpdateBonus(freeSpinBonus);

            var isEqualCurrentFreeSpinCounter = freeSpinResult.BonusElement.Count == freeSpinBonus.Counter;
            var isEqualFreeSpinCount          = freeSpinResult.BonusElement.NumberOfFreeSpin == freeSpinBonus.NumberOfFreeSpin;

            Assert.IsTrue(isEqualFreeSpinCount && isEqualCurrentFreeSpinCounter);
        }
Exemplo n.º 17
0
        public void EngineShouldCreateBonusResponseXmlOfFreeSpinBonusResult(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinSelectionBonusResult = FreeSpinBonusEngine.CreateFreeSpinSelectionBonusResult(freeSpinBonus);

            var responseXml = freeSpinSelectionBonusResult.ToResponseXml(ResponseXmlFormat.History);

            Assert.IsNotNull(responseXml);
        }
Exemplo n.º 18
0
        public void EngineShouldCreateBonusXElementOfFreeSpinBonusResult(int level)
        {
            var freeSpinResult         = GenerateWinningFreeSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(freeSpinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinSelectionBonusResult = FreeSpinBonusEngine.CreateFreeSpinSelectionBonusResult(freeSpinBonus);

            var xElement = freeSpinSelectionBonusResult.ToXElement();

            Assert.IsNotNull(xElement);
        }
Exemplo n.º 19
0
        public static FreeSpinResult GenerateFreeSpinResult(int level)
        {
            var config     = new Configuration();
            var spinResult = GenerateWithBonusSpinResult(level);

            var requestContext = new RequestContext <BonusArgs>("", "", PlatformType.Web)
            {
                GameSetting = new Model.Entity.GameSetting {
                    GameSettingGroupId = 0
                },
                Currency = new Model.Entity.Currency {
                    Id = 0
                },
                Parameters = new BonusArgs(),
                Platform   = PlatformType.All
            };
            var randomFreeSpinMode = FreeSpinBonusEngine.GetFreeSpinMode(RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection));

            return(FreeSpinBonusEngine.CreateFreeSpinResult(level, requestContext, randomFreeSpinMode, spinResult, config));
        }
Exemplo n.º 20
0
        public void EngineShouldCompleteFreeSpinBonusWithZeroCounter(int level)
        {
            var config                 = new Configuration();
            var spinResult             = GenerateWithBonusSpinResult(level);
            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);

            for (var count = 0; count < freeSpinBonus.NumberOfFreeSpin; count++)
            {
                var freeSpinResult = GenerateNonWinningNonBonusFreeSpinResult(level);
                freeSpinBonus.UpdateBonus(freeSpinResult);
            }

            Assert.IsTrue(freeSpinBonus.IsCompleted);
        }
Exemplo n.º 21
0
        public void EngineShouldWriteXmlOfFreeSpinBonusResultXml(int gameId, int level)
        {
            var module     = GetModule(gameId);
            var spinResult = GenerateWithBonusSpinResult(level);

            var freeSpinSelectionBonus = FreeSpinBonusEngine.CreateFreeSpinSelectionBonus(spinResult);
            var freeSpinSelection      = RandomNumberEngine.Next(FreeSpinMode.MinimumFreeSpinSelection, FreeSpinMode.MaximumFreeSpinSelection);
            var freeSpinMode           = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            freeSpinSelectionBonus.UpdateBonus(freeSpinSelection, freeSpinMode);

            var freeSpinBonus  = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinSelectionBonus);
            var freeSpinResult = GenerateFreeSpinResult(level);

            freeSpinBonus.UpdateBonus(freeSpinResult);

            var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult);
            var xElement            = freeSpinBonusResult.ToXElement();

            Assert.DoesNotThrow(() =>
            {
                var responseXml = new FreeSpinBonusXml();
                using (var xmlReader = xElement.CreateReader())
                {
                    responseXml.ReadXml(xmlReader);
                }

                using (var memStream = new MemoryStream())
                    using (var xmlWriter = XmlWriter.Create(memStream, new XmlWriterSettings()
                    {
                        ConformanceLevel = ConformanceLevel.Auto
                    }))
                    {
                        xmlWriter.WriteStartElement("bonus");
                        responseXml.WriteXml(xmlWriter);
                    }
            });
        }
        public string EngineShouldCreateFreeSpinMode(int level, int freeSpinSelection)
        {
            var freeSpinMode = FreeSpinBonusEngine.GetFreeSpinMode(freeSpinSelection);

            return(freeSpinMode.GetType().Name);
        }