Exemplo n.º 1
0
        public void Alive_And_Overpopulated_Should_Die(string neighbours)
        {
            // Arrange
            CellStatus currentStatus = CellStatus.Alive;

            // Act
            CellStatusResult result = Rules.OverPopulated(neighbours, currentStatus);

            // Assert
            Assert.AreEqual(CellStatusResult.Die, result);
        }
Exemplo n.º 2
0
        public void Not_Well_Populated_Dead_No_Change(string neighbours)
        {
            // Arrange
            CellStatus currentStatus = CellStatus.Dead;

            // Act
            CellStatusResult result = Rules.WellPopulated(neighbours, currentStatus);

            // Assert
            Assert.AreEqual(CellStatusResult.NoChange, result);
        }
Exemplo n.º 3
0
        public void Underpopulated_Dead_Stays_Dead(string neighbours)
        {
            // Arrange
            CellStatus currentStatus = CellStatus.Dead;

            // Act
            CellStatusResult result = Rules.Underpopulated(neighbours, currentStatus);

            // Assert
            Assert.AreEqual(CellStatusResult.NoChange, result);
        }
Exemplo n.º 4
0
        public void Well_Populated_Alive_Stays_Alive(string neighbours)
        {
            // Arrange
            CellStatus currentStatus = CellStatus.Alive;

            // Act
            CellStatusResult result = Rules.WellPopulated(neighbours, currentStatus);

            // Assert
            Assert.AreEqual(CellStatusResult.Live, result);
        }
Exemplo n.º 5
0
        public void Dead_And_InCorrect_Amount_Of_Neighbours_Dead_Stays_Dead(string neighbours)
        {
            // Arrange
            CellStatus currentStatus = CellStatus.Dead;

            // Act
            CellStatusResult result = Rules.Reproduce(neighbours, currentStatus);

            // Assert
            Assert.AreEqual(CellStatusResult.NoChange, result);
        }