Ejemplo n.º 1
0
        public void ShouldReturnFalseIfNotNeighbor()
        {
            LiveCell cell1 = new LiveCell(Guid.NewGuid());
            LiveCell cell2 = new LiveCell(Guid.NewGuid());
            DeadCell cell3 = new DeadCell(Guid.NewGuid());

            Relationship relationship = new Relationship(cell1, cell3);

            relationship.IsNeighborOf(cell2).Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void ShouldGenisisIfThreeLiveNeighbors()
        {
            DeadCell liveCell = new DeadCell(Guid.NewGuid());
            Rule     rule     = new Rule();

            Cell returnCell = rule.EvaluateTick(liveCell, new List <Cell> {
                new LiveCell(Guid.NewGuid()), new LiveCell(Guid.NewGuid()), new LiveCell(Guid.NewGuid())
            });

            returnCell.Should().BeOfType <LiveCell>();
        }