Example #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();
        }
Example #2
0
        public void Apply_Should_Not_Be_Applied_For_Non_Live_Cells()
        {
            var sut          = new LivenessRule3();
            var nonAliveCell = new NotAliveCell(new Coordinate(2, 2));

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

            willBeAlive.RuleApplied.Should().BeFalse();
        }
Example #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();
        }