Exemplo n.º 1
0
        public void Living_cell_with_less_than_2_neighbours_dies(int neighbours)
        {
            // Arrange
            var cell = new LivingCell();

            // Act
            var newCell = cell.Evolve(neighbours);

            // Assert
            newCell.ShouldBeOfType <EmptyCell>();
        }
Exemplo n.º 2
0
        public void Living_cell_with_2_or_3_neighbours_lives(int neighbours)
        {
            // Arrange
            var cell = new LivingCell();

            // Act
            var newCell = cell.Evolve(neighbours);

            // Assert
            newCell.ShouldBeOfType <LivingCell>();
        }
Exemplo n.º 3
0
        public void Live_cell_with_1_neighbour_dies()
        {
            // Arrange
            var cell = new LivingCell();

            // Act
            var newCell = cell.Evolve(1);

            // Assert
            newCell.IsAlive.ShouldBe(false);
        }