Exemplo n.º 1
0
        public void GetNeighbours_Coordinates_For_BottomSide_Cell()
        {
            var cell = new NotAliveCell(new Coordinate(x: 2, y: 99));

            var neighbours = new HashSet <Coordinate>(cell.GetNeighbours());

            neighbours.Count.Should().Be(5);
            neighbours.Should().Contain(new Coordinate(1, 98));
            neighbours.Should().Contain(new Coordinate(2, 98));
            neighbours.Should().Contain(new Coordinate(3, 98));
            neighbours.Should().Contain(new Coordinate(1, 99));
            neighbours.Should().Contain(new Coordinate(3, 99));
        }
Exemplo n.º 2
0
        public void GetNeighbours_Coordinates_For_Center_Cell()
        {
            var cell = new NotAliveCell(new Coordinate(x: 2, y: 2));

            var neighbours = new HashSet <Coordinate>(cell.GetNeighbours());

            neighbours.Count.Should().Be(8);
            neighbours.Should().Contain(new Coordinate(1, 1));
            neighbours.Should().Contain(new Coordinate(2, 1));
            neighbours.Should().Contain(new Coordinate(3, 1));
            neighbours.Should().Contain(new Coordinate(1, 2));
            neighbours.Should().Contain(new Coordinate(3, 2));
            neighbours.Should().Contain(new Coordinate(1, 3));
            neighbours.Should().Contain(new Coordinate(2, 3));
            neighbours.Should().Contain(new Coordinate(3, 3));
        }