public void ShouldCreateGridIfInputPathInputIsGiven() { const string inputPath = "/Users/mario.sinovcic/Documents/Acceleration/Katas/Game Of Life/Game Of Life/Game Of Life Tests/TestData/TestData1.json"; var result = GameSetupFactory.CreateGameFromJsonFile(SetupType.PathName, inputPath); Assert.AreEqual(result.CellGrid[0, 0].CellStatus, CellStatus.Alive); Assert.AreEqual(result.CellGrid[0, 1].CellStatus, CellStatus.Dead); }
public void ShouldReturnCorrectNewGridGeneration() { var initialGeneration = new[, ] { { "o", "o", "o" }, { "o", "x", "o" }, { "o", "o", "o" } }; var grid = GameSetupFactory.CreateGridFromArray(SetupType.StringInput, initialGeneration); var ruleFactory = new ClassicRuleFactory(); var gameController = new GameController(ruleFactory); var result = gameController.IterateGame(grid); Assert.AreEqual(result.CellGrid[1, 1].CellStatus, CellStatus.Dead); }
public Grid SetupGame() { return(GameSetupFactory.CreateGrid(SetupType.Random)); }
public void ShouldReturnErrorIfPathIsInvalid() { const string inputPath = ""; Assert.Throws <ApplicationException>(() => GameSetupFactory.CreateGameFromJsonFile(SetupType.PathName, inputPath)); }
public void ShouldCreateRandomGridIfNullInputIsGiven() { var result = GameSetupFactory.CreateGrid(SetupType.Random); Assert.AreNotEqual(null, result.CellGrid[0, 0]); }