Exemplo n.º 1
0
        public void S03AC1_0_neighbor_becomes_dead()
        {
            MockGameDisplay display = new MockGameDisplay();
            Game game = new Game(new GameConfig("TestFiles\\story_03_AC1.conf"), display);

            game.Run();

            Assert.AreEqual(false, display.IsAlive(1, 1));
        }
Exemplo n.º 2
0
        public void S02AC1_set_10x10_in4x4_get0()
        {
            GameDisplay display = new MockGameDisplay();
            Game game = new Game(new GameConfig("TestFiles\\story_02_AC2.conf"), display);

            //game.Run();

            Assert.AreEqual(game.State, Game.GameStateWrongConfig);
        }
Exemplo n.º 3
0
        public void S03AC3_2_neighbors_becomes_live()
        {
            MockGameDisplay display = new MockGameDisplay();
            Game game = new Game(new GameConfig("TestFiles\\story_03_AC3.conf"), display);

            game.Run();

            Assert.AreEqual(false, display.IsAlive(0, 0));
            Assert.AreEqual(true, display.IsAlive(1, 1));
            Assert.AreEqual(false, display.IsAlive(2, 2));
        }
Exemplo n.º 4
0
        public void S02AC1_set_1x1_2x2_in4x4_get1x1_2x2()
        {
            GameDisplay display = new MockGameDisplay();
            Game game = new Game(new GameConfig("TestFiles\\story_02_AC1.conf"), display);

            //game.Run();

            Assert.AreEqual(game.State, Game.GameStateNormal);
            Assert.AreEqual(true, display.IsAlive(1, 1));
            Assert.AreEqual(true, display.IsAlive(2, 2));
        }
Exemplo n.º 5
0
        public void S01AC2_RightConfigure_displayWorldOfRightSize()
        {
            GameConfig conf = new GameConfig("TestFiles\\Story_01.conf");
            GameDisplay display = new MockGameDisplay();
            Game game = new Game(conf, display);

            game.Run();

            Assert.AreEqual(game.State, Game.GameStateNormal);
            Assert.AreEqual(display.Width, 4);
            Assert.AreEqual(display.Height,5);
        }