public void BoundedEnsureEdgeCellsHaveCorrectNeigbors()
        {
            BoundedWorld world = new BoundedWorld(10, 10);

            List<Cell> neighbors = world.GetNeighbors(0, 0);

            Assert.AreEqual(3, neighbors.Count);
        }
        public void BoundedEnsureThereAreZeroNeighbors()
        {
            BoundedWorld world = new BoundedWorld(10, 10);

            int expected_alive_neighbors = 0;
            int actual_alive_neighbors = world.AliveNeighborCount(4, 5);

            Assert.AreEqual(expected_alive_neighbors, actual_alive_neighbors);
        }
        public void BoundedApplyUnderPopulationToOneCell()
        {
            BoundedWorld world = new BoundedWorld(10, 10);
            world.AddCell(4, 5);

            world.UnderPopulationRule();
            world.Tick();

            Assert.AreEqual(0, world.AliveCellCount());
        }
예제 #4
0
        public void BoundedWorldEnsureThereAreZeroLiveNeighbors()
        {
            // Arrange
            BoundedWorld my_world = new BoundedWorld(10, 10);

            // Act
            int expected_alive_neighbors = 0;
            int actual_alive_neighbors = my_world.AliveNeighborCount(4,5);

            // Assert
            Assert.AreEqual(expected_alive_neighbors, my_world.AliveCellCount());
        }
        public void BoundedEnsureThereAreCells()
        {
            int width = 80;
            int height = 80;
            BoundedWorld instance = new BoundedWorld(width, height);

            int x = 4;
            int y = 3;
            instance.AddCell(x, y);

            Assert.AreEqual(1, instance.AliveCellCount());
        }
예제 #6
0
        public void BoundedWorldApplyUnderPopulationToOneCell()
        {
            // Arrange
            BoundedWorld my_world = new BoundedWorld(10, 10);
            my_world.AddCell(4, 5);

            // Act
            my_world.UnderPopulationRule();

            // Assert
            Assert.AreEqual(0, my_world.AliveCellCount());
        }
        public void BoundedWorldEnsureEdgeCellsHaveCorrectNeighbors()
        {
            /* Begin Arrange */
            BoundedWorld my_world = new BoundedWorld(10, 10);
            /* End Arrange */

            /* Begin Act */
            List<Cell> neighbors = my_world.GetNeighbors(0, 0);
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(3, neighbors.Count);
            /* End Assert */
        }
        public void BoundedWorldEnsureWorldHasCells()
        {
            int height = 100;
            int width = 100;
            BoundedWorld world = new BoundedWorld(width, height);

            int expected_number_of_dead_cells = 10000;
            int expected_number_of_live_cells = 0;
            int actual_number_of_live_cells = world.AliveCellCount();
            int actual_number_of_dead_cells = world.DeadCellCount();

            Assert.AreEqual(expected_number_of_dead_cells, actual_number_of_dead_cells);
            Assert.AreEqual(expected_number_of_live_cells, actual_number_of_live_cells);
        }
예제 #9
0
        public void BoundedWorldEnsureThereAreCells()
        {
            // Arrange
            int width = 80;
            int height = 80;
            BoundedWorld my_world = new BoundedWorld(width, height);

            // Act
            int x = 4;
            int y = 3;
            my_world.AddCell(x,y);

            // Assert
            Assert.AreEqual(1, my_world.AliveCellCount());
        }
        public void BoundedWorldApplyUnderPopulationToOneCell()
        {
            /* Begin Arrange */
            BoundedWorld my_world = new BoundedWorld(10, 10);
            my_world.AddCell(4, 5);
            /* End Arrange */

            /* Begin Act */
            my_world.UnderPopulationRule();
            my_world.Tick();
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(0, my_world.AliveCellCount());
            /* End Assert */
        }
예제 #11
0
        public void BoundedWorldEnsureIHaveArrayOfCorrectSize()
        {
            // Arrange
            int height = 80;
            int width = 80;

            // Act
            BoundedWorld my_world = new BoundedWorld(width, height);
            int expected_height = height;
            int expected_width = width;

            int actual_height = my_world.Height;
            int actual_width = my_world.Width;

            // Assert
            Assert.AreEqual(expected_height, actual_height);
            Assert.AreEqual(expected_width, actual_width);
        }
        public void BoundedWorldEnsureThereAreCells()
        {
            /* Begin Arrange */
            int width = 80;
            int height = 80;
            BoundedWorld my_world = new BoundedWorld(width, height);
            /* End Arrange */

            /* Begin Act */
            int x = 4;
            int y = 3;
            my_world.AddCell(x, y);
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(1, my_world.AliveCellCount());
            /* End Assert */
        }
        public void BoundedWorldEnsureIHaveArrayOfCorrectSize()
        {
            /* Begin Arrange */
            int height = 80;
            int width = 80;
            BoundedWorld my_world = new BoundedWorld(width, height);
            int expected_height = height;
            int expected_width = width;
            /* End Arrange */

            /* Begin Act */
            int actual_height = my_world.Height;
            int actual_width = my_world.Width;
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(expected_height, actual_height);
            Assert.AreEqual(expected_width, actual_width);
            /* End Assert */
        }
        public void BoundedWorldEnsureWorldHasCells()
        {
            /* Begin Arrange */
            int height = 100;
            int width = 100;
            BoundedWorld my_world = new BoundedWorld(width, height);
            /* End Arrange */

            /* Begin Act */
            int expected_number_of_dead_cells = 10000;
            int expected_number_of_alive_cells = 0;
            int actual_number_of_dead_cells = my_world.DeadCellCount();
            int actual_number_of_alive_cells = my_world.AliveCellCount();
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(expected_number_of_dead_cells, actual_number_of_dead_cells);
            Assert.AreEqual(expected_number_of_alive_cells, actual_number_of_alive_cells);
            /* End Assert */
        }
        public void BoundedWorldEnsureWorldIsSmallerThanMax()
        {
            /* Begin Arrange */
            int height = 80;
            int width = 80;
            /* End Arrange */

            /* Begin Act */
            BoundedWorld my_world = new BoundedWorld(width, height);
            /* End Act */

            /* Begin Assert */
            Assert.IsNotNull(my_world);
            /* End Assert */
        }
예제 #16
0
        public void EnsureIHaveArrayOfCorrectSize()
        {
            int height = 80;
            int width = 80;
            BoundedWorld world = new BoundedWorld(width, height);
            int expected_height = height;
            int expected_width = width;

            int actual_height = world.Height;
            int actual_width = world.Width;

            Assert.AreEqual(expected_height, actual_height);
            Assert.AreEqual(expected_width, actual_width);
        }
        public void BoundedWorldEnsureThereAreZeroLiveNeighbors()
        {
            /* Begin Arrange */
            BoundedWorld my_world = new BoundedWorld(10, 10);
            /* End Arrange */

            /* Begin Act */
            int expected_alive_neighbors = 0;
            int actual_alive_neighbors = my_world.AliveNeighborCount(4, 5);
            /* End Act */

            /* Begin Assert */
            Assert.AreEqual(expected_alive_neighbors, actual_alive_neighbors);
            /* End Assert */
        }
예제 #18
0
        public void BoundedWorldEnsureWorldIsSmallerThanMax()
        {
            //Begin Arrange
            int height = 80;
            int width = 80;
            //End Arrange

            //Begin Act
            BoundedWorld world = new BoundedWorld(width, height);
            //End Act

            //Begin Assert
            Assert.IsNotNull(world);
            //End Assert
        }
 public void WorldEnsureICanCreateInstance()
 {
     BoundedWorld my_world = new BoundedWorld();
     Assert.IsNotNull(my_world);
 }
예제 #20
0
 public void EnsureICanCreateAnInstance()
 {
     BoundedWorld myInstance = new BoundedWorld();
     Assert.IsNotNull(myInstance);
 }
예제 #21
0
        public void MyTestMethod()
        {
            /* Arrage */
            int height = 80;
            int width = 80;

            /* Act */
            BoundedWorld my_world = new BoundedWorld(width, height);

            /* Assert */
            Assert.IsNotNull(my_world);
        }