Package pair.gameoflife.a20140102

Examples of pair.gameoflife.a20140102.CoordTest


    @Test
    public void shouldSumSelfNeighbourCountAndNextNeighbourCount() {
        final int selfNeighbourCount = 2;
        final int nextNeighbourCount = 40;

        Coord selfCoord = new Coord(0, 0) {
            @Override
            public int oneForNeighbour(Coord other) {
                return selfNeighbourCount;
            }
        };
View Full Code Here


    @Test
    public void shouldNotCountTooFarNeighbourLeftOrUpAsAnyNeighbours() {
        assertThat(coords()
                .with(0, 2)
                .with(2, 0)
           .countNeighbours(new Coord(2, 2)), is(0));
    }
View Full Code Here

           .countNeighbours(new Coord(2, 2)), is(0));
    }

    @Test
    public void shouldCountSelfAsNeighbours() {
        assertThat(coords().with(2, 2).countNeighbours(new Coord(2, 2)), is(1));
    }
View Full Code Here

        private LinkedCoordsBuilder(LinkedCoords currentLinkedCoords) {
            this.currentLinkedCoords = currentLinkedCoords;
        }

        public LinkedCoordsBuilder with(int x, int y) {
            Coord coord = new Coord(x, y);
            OccupiedCoords linkedCoords = new OccupiedCoords(coord, currentLinkedCoords);
            return new LinkedCoordsBuilder(linkedCoords);
        }
View Full Code Here

            this.currentLinkedCoords = currentLinkedCoords;
        }

        public LinkedCoordsBuilder with(int x, int y) {
            Coord coord = new Coord(x, y);
            OccupiedCoords linkedCoords = new OccupiedCoords(coord, currentLinkedCoords);
            return new LinkedCoordsBuilder(linkedCoords);
        }
View Full Code Here

TOP

Related Classes of pair.gameoflife.a20140102.CoordTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.