public void GameEngineSelecting5ShouldProperlySetBoardSizeTo5WhenInitiallyAsked() { var mockedUi = new Mock<IUserInterface>(); var mockedDrawer = new Mock<IPicasso>(); mockedDrawer.Setup(x => x.Draw(It.IsAny<object>())) .Verifiable(); mockedDrawer.Setup(x => x.Clear()) .Verifiable(); mockedUi.Setup(x => x.Drawer).Returns(mockedDrawer.Object); mockedUi.Setup(x => x.Reader).Returns(this.GetReader(new List<string> { "5", "4 4", "exit" })); var dependencies = new GameEngineDependencies(mockedUi.Object, new Logger(), new Board(5, 5, new RandomGenerator()), new BoardMemory(), new CommandFactory()); var engine = new GameEngine(dependencies); engine.Run(); }
public void GameEnginePoppingAllBalloonsShouldWinTheGame() { var mockedUi = new Mock<IUserInterface>(); var mockedDrawer = new Mock<IPicasso>(); mockedDrawer.Setup(x => x.Draw(It.IsAny<object>())) .Verifiable(); mockedDrawer.Setup(x => x.Clear()) .Verifiable(); mockedUi.Setup(x => x.Drawer).Returns(mockedDrawer.Object); mockedUi.Setup(x => x.Reader).Returns(this.GetReader(new List<string> { "5", "4 0", "4 1", "4 2", "4 3", "4 4", "4 0", "4 1", "4 2", "undo", "4 2", "4 3", "4 4", "4 0", "4 1", "4 2", "4 3", "4 4", "4 0", "4 1", "4 2", "4 3", "4 4", "4 0", "4 1", "4 2", "4 3", "4 4", "4 0", "4 1", "4 2", "4 3", "4 4" })); var dependencies = new GameEngineDependencies(mockedUi.Object, new Logger(), new Board(5, 5, new RandomGenerator()), new BoardMemory(), new CommandFactory()); var engine = new GameEngine(dependencies); engine.Run(); }
public void GameEngineShouldStartUpCorrectlyAndExitWhenACommandIsProvided() { var mockedUi = new Mock<IUserInterface>(); var mockedDrawer = new Mock<IPicasso>(); mockedDrawer.Setup(x => x.Draw(It.IsAny<object>())) .Verifiable(); mockedDrawer.Setup(x => x.Clear()) .Verifiable(); mockedUi.Setup(x => x.Drawer).Returns(mockedDrawer.Object); mockedUi.Setup(x => x.Reader).Returns(this.GetReader(new List<string> {"", "exit"})); var dependencies = new GameEngineDependencies(mockedUi.Object, new Logger(), new Board(5, 5, new RandomGenerator()), new BoardMemory(), new CommandFactory()); var engine = new GameEngine(dependencies); engine.Run(); }