Esempio n. 1
0
        public void Apply_Should_Not_Be_Applied_For_Live_Cells_With_1_Or_Less_Neighbours()
        {
            var sut      = new LivenessRule3();
            var liveCell = new AliveCell(new Coordinate(2, 2));

            var willBeAlive = sut.Apply(liveCell, 1);

            willBeAlive.RuleApplied.Should().BeFalse();
        }
Esempio n. 2
0
        public void Apply_Should_Not_Be_Applied_For_Live_Cells()
        {
            var sut       = new LivenessRule4();
            var aliveCell = new AliveCell(new Coordinate(2, 2));

            var willBeAlive = sut.Apply(aliveCell, 3);

            willBeAlive.RuleApplied.Should().BeFalse();
        }
Esempio n. 3
0
        public void Apply_Should_Be_True_For_Live_Cells_With_3_Neighbours()
        {
            var sut      = new LivenessRule3();
            var liveCell = new AliveCell(new Coordinate(2, 2));

            var willBeAlive = sut.Apply(liveCell, 3);

            willBeAlive.RuleApplied.Should().BeTrue();
            willBeAlive.CellWillBeAlive.Should().BeTrue();
        }