public void ShouldReturnDyingCellForNextTurn() { LiveCell liveCell = new LiveCell(Guid.NewGuid()); Cell returnCell = liveCell.GenerateNextTurnStatus(new FakeDeadRule(), null); returnCell.Should().BeOfType <DeadCell>(); }
public void ShouldReturnTrueIfOtherNeighbor() { LiveCell cell1 = new LiveCell(Guid.NewGuid()); LiveCell cell2 = new LiveCell(Guid.NewGuid()); Relationship relationship = new Relationship(cell1, cell2); relationship.IsNeighborOf(cell2).Should().BeTrue(); }
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(); }
public void ShouldLiveIfLiveAndTwoLiveNeighbors() { LiveCell liveCell = new LiveCell(Guid.NewGuid()); Rule rule = new Rule(); Cell returnCell = rule.EvaluateTick(liveCell, new List <Cell> { new LiveCell(Guid.NewGuid()), new LiveCell(Guid.NewGuid()) }); returnCell.Should().BeOfType <LiveCell>(); }
public void ShouldDieWithFewerThanTwo() { LiveCell liveCell = new LiveCell(Guid.NewGuid()); Rule rule = new Rule(); Cell returnCell = rule.EvaluateTick(liveCell, new List <Cell> { new LiveCell(Guid.NewGuid()) }); returnCell.Should().BeOfType <DeadCell>(); }
public void ShouldReturnRelationshipsForCell() { Cell cell1 = new LiveCell(Guid.NewGuid()); Cell cell2 = new LiveCell(Guid.NewGuid()); Relationships relationships = new Relationships(); relationships.CreateNewRelationship(cell1, cell2); List <Relationship> neighbors = relationships.GetNeighbors(cell1); neighbors.Should().HaveCount(1); }