示例#1
0
        public void GameConfig_livecell10x10_in4x4_return0()
        {
            GameConfig config = new GameConfig("TestFiles\\livecell10x10.conf");
            Assert.AreEqual(false, config.IsGoodConfig());

            LiveCell[] cells = config.GetLiveCells();

            Assert.AreEqual(0, cells.Length);
        }
示例#2
0
        public void GameConfig_dimension_axb_return0x0()
        {
            GameConfig config = new GameConfig("TestFiles\\dimensionaxb.conf");
            Assert.AreEqual(false, config.IsGoodConfig());

            Dimension dimension = config.GetDimension();

            Assert.AreEqual(dimension.X, 0);
            Assert.AreEqual(dimension.Y, 0);
        }
示例#3
0
        public void GameConfig_dimension_4x5_return4x5()
        {
            GameConfig config = new GameConfig("TestFiles\\dimension4x5.conf");
            Assert.AreEqual(true, config.IsGoodConfig());

            Dimension dimension = config.GetDimension();

            Assert.AreEqual(dimension.X, 4);
            Assert.AreEqual(dimension.Y, 5);
        }
示例#4
0
        public void GameConfig_livecell1x1_2x2_return1x1_2x2()
        {
            GameConfig config = new GameConfig("TestFiles\\livecell1x1_2x2.conf");
            Assert.AreEqual(true, config.IsGoodConfig());

            LiveCell[] cells = config.GetLiveCells();

            Assert.AreEqual(cells[0].X, 1);
            Assert.AreEqual(cells[0].Y, 1);
            Assert.AreEqual(cells[1].X, 2);
            Assert.AreEqual(cells[1].Y, 2);
        }
示例#5
0
        public void GameConfig_BlankFile_returnZero()
        {
            GameConfig config = new GameConfig("TestFiles\\blank.conf");

            Assert.AreEqual(false, config.IsGoodConfig());

            LiveCell[] cells = config.GetLiveCells();

            Assert.AreEqual(cells.Length, 0);

            Dimension dimension = config.GetDimension();

            Assert.AreEqual(dimension.X, 0);
            Assert.AreEqual(dimension.Y, 0);
        }
示例#6
0
        public void GameConfig_livecell1x1_axb_return1x1()
        {
            GameConfig config = new GameConfig("TestFiles\\livecell1x1_axb.conf");
            Assert.AreEqual(false, config.IsGoodConfig());

            LiveCell[] cells = config.GetLiveCells();

            Assert.AreEqual(1,cells.Length);
            Assert.AreEqual(cells[0].X, 1);
            Assert.AreEqual(cells[0].Y, 1);
        }
示例#7
0
        public void GameConfig_NoFile_returnZero()
        {
            GameConfig config = new GameConfig(string.Empty);
            Assert.AreEqual(false, config.IsGoodConfig());

            Dimension dimension = config.GetDimension();

            Assert.AreEqual(dimension.X, 0);
            Assert.AreEqual(dimension.Y, 0);
        }