public void EngineShouldCreateFreeSpinBonusResultFromFreeSpinCollapsingResult(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 }; Assert.DoesNotThrow(() => { var freeSpinResult = FreeSpinBonusEngine.CreateFreeSpinResult(level, requestContext, config); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); var targetWheel = MainGameEngine.GetTargetWheel(level, config, freeSpinResult.Wheel.ReelStripsId); var freeSpinCollapsingResult = FreeSpinBonusEngine.CreateFreeSpinCollapsingResult(freeSpinResult, targetWheel, config.BonusConfig.FreeSpin.Multipliers, config.Payline, config.PayTable); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinCollapsingResult); }); }
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 EngineShouldWriteXmlOfFreeSpinBonusResultXml(int gameId, int level) { var module = GetModule(gameId); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); 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 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)); }
public void EngineShouldCreateFreeSpinBonusInstance(int level) { var config = new Configuration(); var spinResult = GenerateWithBonusSpinResult(level); Assert.IsNotNull(FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult)); }
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); }
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 void EngineShouldCreateFreeSpinBonusWithValidGuid(int level) { var config = new Configuration(); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); Assert.IsTrue(!string.IsNullOrWhiteSpace(freeSpinBonus.Guid.ToString())); }
public void EngineShouldCreateFreeSpinBonusWithTransactionId(int level) { var config = new Configuration(); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); Assert.IsTrue(freeSpinBonus.SpinTransactionId == spinResult.TransactionId); }
public void EngineShouldCreateFreeSpinBonusWithGameResult(int level) { var config = new Configuration(); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); Assert.AreSame(spinResult, freeSpinBonus.GameResult); Assert.AreSame(spinResult, freeSpinBonus.SpinResult); }
public void EngineShouldContinueFreeSpinBonusResultOnWinSpin(int level) { var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); Assert.IsTrue(!freeSpinBonusResult.IsCompleted); }
public void EngineShouldCreateFreeSpinBonusResultWithSameSpinTransactionId(int level) { var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); Assert.IsTrue(freeSpinBonusResult.SpinTransactionId == freeSpinBonus.SpinTransactionId); }
public void EngineShouldCreateFreeSpinBonusResultWithSameGameResultAndBonus(int level) { var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); Assert.AreSame(freeSpinBonusResult.Bonus, freeSpinBonus); }
public void EngineShouldStartBonusOnCreateFreeSpinBonusResult(int level) { var config = new Configuration(); var freeSpinResult = GenerateFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); Assert.IsTrue(freeSpinBonus.IsStarted); }
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 EngineShouldIncompleteFreeSpinBonusIfWithCounter(int level) { var config = new Configuration(); var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); var initialCounter = freeSpinBonus.Counter; freeSpinBonus.UpdateBonus(freeSpinResult); Assert.IsTrue(!freeSpinBonus.IsCompleted); }
public void EngineShouldShouldDeductCounterOnFreeSpin(int level) { var config = new Configuration(); var freeSpinResult = GenerateNonWinningNonBonusFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); var initialCounter = freeSpinBonus.Counter; freeSpinBonus.UpdateBonus(freeSpinResult); Assert.AreEqual(initialCounter - 1, freeSpinBonus.Counter); }
public void EngineShouldCreateBonusXElementOfFreeSpinBonusResult(int level) { var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); var xElement = freeSpinBonusResult.ToXElement(); Assert.IsNotNull(xElement); }
public void EngineShouldCreateBonusResponseXmlOfFreeSpinBonusResult(int level) { var freeSpinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); var responseXml = freeSpinBonusResult.ToResponseXml(Model.ResponseXmlFormat.History); Assert.IsNotNull(responseXml); }
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 SpinResultShouldHaveSameBonusDetailsOnResultUpdate(int level) { var spinResult = GenerateWinningFreeSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); freeSpinBonus.UpdateBonus(spinResult, 1); spinResult.UpdateBonus(freeSpinBonus); var isEqualBonusId = spinResult.BonusElement.Id == freeSpinBonus.Id; var isEqualBonusGuid = spinResult.BonusElement.Value == freeSpinBonus.Guid.ToString("N"); Assert.IsTrue(isEqualBonusId && isEqualBonusGuid); }
public void FreeSpinCollapsingShouldHaveSameCountersOnBonusElementOnResultUpdate(int level) { var freeSpinCollapsingResult = GenerateWinningFreeSpinCollapsingResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinCollapsingResult); freeSpinBonus.UpdateBonus(freeSpinCollapsingResult); freeSpinCollapsingResult.UpdateBonus(freeSpinBonus); var isEqualCurrentFreeSpinCounter = freeSpinCollapsingResult.BonusElement.Count == freeSpinBonus.Counter; var isEqualFreeSpinCount = freeSpinCollapsingResult.BonusElement.AdditionalFreeSpinCount == freeSpinBonus.NumOfFreeSpin; Assert.IsTrue(isEqualFreeSpinCount && isEqualCurrentFreeSpinCounter); }
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())); }
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); }
public void EngineShouldCreateBonusXElementOfFreeSpinBonusResult(int gameId, int level) { var module = GetModule(gameId); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); var freeSpinResult = GenerateFreeSpinResult(level); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); var xElement = freeSpinBonusResult.ToXElement(); Assert.IsNotNull(xElement); }
public void EngineShouldCompleteFreeSpinBonusWithZeroCounter(int level) { var config = new Configuration(); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); for (var count = 0; count < freeSpinBonus.NumOfFreeSpin; count++) { var freeSpinResult = GenerateNonWinningNonBonusFreeSpinResult(level); freeSpinBonus.UpdateBonus(freeSpinResult); } Assert.IsTrue(freeSpinBonus.IsCompleted); }
public void EngineShouldCreateBonusResponseXmlOfFreeSpinBonusResult(int gameId, int level) { var module = GetModule(gameId); var spinResult = GenerateWithBonusSpinResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(spinResult); var freeSpinResult = GenerateFreeSpinResult(level); freeSpinBonus.UpdateBonus(freeSpinResult); var freeSpinBonusResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinResult); var responseXml = freeSpinBonusResult.ToResponseXml(ResponseXmlFormat.History); Assert.IsNotNull(responseXml); }
public void EngineShouldRetainCounterOnCollapsingFreeSpin(int level) { var config = new Configuration(); var freeSpinResult = GenerateWinningNonBonusFreeSpinResult(level); var targetWheel = MainGameEngine.GetTargetWheel(level, config, freeSpinResult.Wheel.ReelStripsId); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinResult); freeSpinBonus.UpdateBonus(freeSpinResult); var initialCounter = freeSpinBonus.Counter; var collapsingFreeSpinResult = FreeSpinBonusEngine.CreateFreeSpinCollapsingResult(freeSpinResult, targetWheel, config.BonusConfig.FreeSpin.Multipliers, config.Payline, config.PayTable); freeSpinBonus.UpdateBonus(collapsingFreeSpinResult); Assert.AreEqual(initialCounter, freeSpinBonus.Counter); }
public void EngineShouldStartBonusOnCreateFreeSpinBonusResult(int level) { var config = new Configuration(); var freeSpinResult = GenerateFreeSpinResult(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); Assert.IsTrue(freeSpinBonus.IsStarted); }
public void EngineShouldCreateCollapsingResultSameRoundId(int level) { var config = new Configuration(); var spinResult = GenerateWinningFreeSpinResult(level); var freeSpinCollapsingResult = GenerateWinningFreeSpinCollapsingResult(level); var freeSpinBonus = FreeSpinBonusEngine.CreateFreeSpinBonus(freeSpinCollapsingResult); freeSpinBonus.UpdateBonus(freeSpinCollapsingResult); var spinResultCollapsingResult = CollapsingBonusEngine.CreateCollapsingSpinResult(spinResult, config.Wheels[level], config.SymbolCollapsePairs, config.Payline, config.PayTable); var freeSpinCollapsingResultCollapsingResult = FreeSpinBonusEngine.CreateFreeSpinBonusResult(freeSpinBonus, freeSpinCollapsingResult); Assert.IsTrue(spinResult.RoundId == spinResultCollapsingResult.RoundId); Assert.IsTrue(freeSpinCollapsingResultCollapsingResult.RoundId == freeSpinCollapsingResult.RoundId); }