public void Then_Cell_In_BottomRight_Has_No_Active_Neighbor()
        {
            World world = new World(3, 3);
            world.SetCellAlive(1, 1);

            Cell cell = world.GetCell(3, 3);
            Assert.AreEqual(0, cell.NumberOfLivingNeighbors);
        }
        public void Then_Cell_In_Center_Has_1_Active_Neighbor()
        {
            World world = new World(3, 3);
            world.SetCellAlive(3, 1);

            Cell cell = world.GetCell(2, 2);
            Assert.AreEqual(1, cell.NumberOfLivingNeighbors);
        }
        public void Then_Cell_On_2x1_Is_Different_From_Old_On_Same_Position()
        {
            World world = new World(2, 2);
            Cell oldCell = world.GetCell(2, 1);

            world.NextGeneration();
            Cell newCell = world.GetCell(2, 1);

            Assert.AreNotEqual(oldCell, newCell);
        }
        public void Then_New_Cell_On_Same_Position_Differs_From_Old_Cell()
        {
            World world = new World(1, 1);
            Cell oldCell = world.GetCell(1, 1);

            world.NextGeneration();
            Cell newCell = world.GetCell(1, 1);

            Assert.AreNotEqual(oldCell, newCell);
        }
        public void Then_A_Previously_Free_Cell_With_3_Alive_Members_Becomes_Alive()
        {
            World world = new World(3, 3);
            world.SetCellAlive(1, 1);
            world.SetCellAlive(1, 2);
            world.SetCellAlive(1, 3);

            world.NextGeneration();

            Cell cell = world.GetCell(2, 2);
            Assert.IsTrue(cell.IsAlive);
        }
 public void Then_Cell_At_Position_2x1_Is_Alive()
 {
     World world = new World(2, 1);
     world.SetCellAlive(2, 1);
     Assert.IsTrue(world.GetCell(2, 1).IsAlive);
 }
コード例 #7
0
 public void Then_Has_Different_Cells_On_Both_Positions()
 {
     World world = new World(1, 2);
     Assert.AreNotEqual(world.GetCell(1, 1), world.GetCell(1, 2));
 }
コード例 #8
0
 public void Then_Cell_Is_On_Position_X1_Y1()
 {
     World world = new World(1, 1);
     Assert.IsNotNull(world.GetCell(1, 1));
 }
 public void Then_Cell_At_Position_1x2_Is_Alive()
 {
     World world = new World(1, 2);
     world.SetCellAlive(1, 2);
     Assert.IsTrue(world.GetCell(1, 2).IsAlive);
 }
 public void Then_Cell_Within_World_Is_Alive()
 {
     World world = new World(1, 1);
     world.SetCellAlive(1, 1);
     Assert.IsTrue(world.GetCell(1, 1).IsAlive);
 }