public void EngineShouldCreateCorrectWinPositionLineAndMultiplierAndSymbol(string wheelString, int replacementSymbol, int level) { var config = new Configuration(); var wheel = new Wheel(Game.WheelWidth, Game.WheelHeight, wheelString.ToFormattedWheelString()); if (wheel.CountDistinct(Symbols.Mystery) > 0) /// Calculate wins with replaced mystery symbols { var replacedMysterySymbolWheel = MainGameEngine.GenerateReplacedMysterySymbolWheel(config, wheel, replacementSymbol); var winPositions = MainGameEngine.GenerateWinPositions( config.Payline, config.PayTable, replacedMysterySymbolWheel, 1, Game.Lines, 1); Assert.IsTrue(!winPositions.Any(wp => wp.Line < 0 || wp.Multiplier <= 0 || wp.Symbol < 0)); } else { var winPositions = MainGameEngine.GenerateWinPositions( config.Payline, config.PayTable, wheel, 1, Game.Lines, 1); Assert.IsTrue(!winPositions.Any(wp => wp.Line < 0 || wp.Multiplier <= 0 || wp.Symbol < 0)); } }
public string EngineShouldCreateCorrectRowPositions(string wheelString, int replacementSymbol, int level) { var config = new Configuration(); var wheel = new Wheel(Game.WheelWidth, Game.WheelHeight, wheelString.ToFormattedWheelString()); if (wheel.CountDistinct(Symbols.Mystery) > 0) /// Calculate wins with replaced mystery symbols { var replacedMysterySymbolWheel = MainGameEngine.GenerateReplacedMysterySymbolWheel(config, wheel, replacementSymbol); var winPositions = MainGameEngine.GenerateWinPositions( config.Payline, config.PayTable, replacedMysterySymbolWheel, 1, Game.Lines, 1); return(string.Join('|', winPositions.Select(wp => string.Join(',', wp.RowPositions)))); } else { var winPositions = MainGameEngine.GenerateWinPositions( config.Payline, config.PayTable, wheel, 1, Game.Lines, 1); return(string.Join('|', winPositions.Select(wp => string.Join(',', wp.RowPositions)))); } }
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 string EngineShouldGetCorrectReplacedMysterySymbolsWheel(string wheelString, int replacementSymbol, int level) { var config = new Configuration(); var wheel = new Wheel(Game.WheelWidth, Game.WheelHeight, wheelString.ToFormattedWheelString()); if (wheel.CountDistinct(Symbols.Mystery) > 0) /// Calculate wins with replaced mystery symbols { var replacedMysterySymbolWheel = MainGameEngine.GenerateReplacedMysterySymbolWheel(config, wheel, replacementSymbol); return(string.Join("|", replacedMysterySymbolWheel.Reels.Select(reel => string.Join(",", reel)))); } else { return(string.Join("|", wheel.Reels.Select(reel => string.Join(",", reel)))); } }