Exemplo n.º 1
0
        public void Should_CellField_Equals()
        {
            var cellField1 = new CellField(2, 2);

            cellField1.SeedLife(0, 0);
            var cellField2 = new CellField(2, 2);

            cellField2.SeedLife(0, 0);

            Assert.IsTrue(cellField1.Equals(cellField2));
            Assert.IsFalse(cellField1 == cellField2);
        }
Exemplo n.º 2
0
        public void Should_state_not_changed_on_GenerateNextState()
        {
            var cellFieldInitial       = new CellField(3, 3);
            var cellFieldWithNextState = new CellField(3, 3);

            for (int j = 0; j < 2; j++)
            {
                for (int i = 0; i < 2; i++)
                {
                    cellFieldInitial.SeedLife(i, j);
                    cellFieldWithNextState.SeedLife(i, j);
                }
            }

            _sut.GenerateNextState(cellFieldWithNextState);
            Assert.That(cellFieldInitial.Equals(cellFieldWithNextState));
        }