public void EngineShouldReadResponseXmlOfRespinBonusResult(int gameId, int level)
        {
            var config         = new Configuration();
            var requestContext = GetMockBonusRequestContext(0, gameId);
            var spinResult     = GenerateWithRespinSpinResult(level);
            var respinResult   = RespinBonusEngine.CreateRespinResult(spinResult, level, requestContext, config);
            var bonus          = RespinBonusEngine.CreateRespinBonus(spinResult);

            bonus.UpdateBonus(respinResult);

            var respinBonusResult = RespinBonusEngine.CreateRespinBonusResult(bonus, respinResult);

            var xElement = respinBonusResult.ToXElement();

            Assert.DoesNotThrow(() =>
            {
                using (var xmlReader = xElement.CreateReader())
                {
                    var responseXml = new BonusXml();
                    responseXml.ReadXml(xmlReader);
                }
            });
        }
        public void EngineShouldReadResponseXmlOfMultiplierBonusResult(int gameId, int level)
        {
            var config         = new Configuration();
            var requestContext = GetMockBonusRequestContext(0, gameId);
            var spinResult     = GenerateWithMultiplierSpinResult(level);
            var bonus          = MultiplierBonusEngine.CreateMultiplierBonus(spinResult);
            var multiplier     = MultiplierBonusEngine.GetMultiplier(config);
            var totalWin       = MultiplierBonusEngine.CalculateWin(spinResult.BonusPositions.First().Symbol, 1, multiplier, config);

            bonus.UpdateBonus(multiplier);

            var multiplierBonusResult = MultiplierBonusEngine.CreateMultiplierBonusResult(bonus, totalWin);

            var xElement = multiplierBonusResult.ToXElement();

            Assert.DoesNotThrow(() =>
            {
                using (var xmlReader = xElement.CreateReader())
                {
                    var responseXml = new BonusXml();
                    responseXml.ReadXml(xmlReader);
                }
            });
        }
Пример #3
0
 protected override void CreateDataXElement(BonusXml bonusXml)
 {
     this.CreateDataElement(bonusXml);
 }
Пример #4
0
 protected override void CreateBonusXElement(BonusXml bonusXml)
 {
     this.CreateBonusElementAttribute(bonusXml);
 }
Пример #5
0
 private void CreateBonusElementAttribute(BonusXml bonusXml)
 {
     bonusXml.Attributes.Add("counter", Convert.ToString(this.Counter));
 }