Exemplo n.º 1
0
        public void SingleBombNeighborHasCorrectValue()
        {
            var table = new Table(new Coordinate(9, 9));
            var cell = table.GetCell(9, 8);

            Assert.AreEqual(1, cell.NearbyBombsCount);
        }
Exemplo n.º 2
0
        public void BombNumberInCellEquals0()
        {
            var table = new Table();
            var cell = table.GetCell(7, 7);

            Assert.AreEqual(0, cell.NearbyBombsCount);
        }
Exemplo n.º 3
0
        public void GetCell_OneBomb_OnGettingNeighborIsOfTypeSafe()
        {
            var table = new Table(new Coordinate(9, 9));
            var cell = table.GetCell(9, 8);

            Assert.AreEqual(CellType.Safe, cell.Type);
        }
Exemplo n.º 4
0
        public void BombCellIsProperlyInitialized()
        {
            var table = new Table(new Coordinate(1, 1));
            var cell = table.GetCell(1, 1);

            Assert.AreEqual(CellType.Bomb, cell.Type);
        }
Exemplo n.º 5
0
        public void TableConstructor_TakesListOfBombPositions_AndRemembersThem()
        {
            var table = new Table(
                new Coordinate(5, 0),
                new Coordinate(2, 8)
            );

            var cell = table.GetCell(5, 0);
            Assert.AreEqual(CellType.Bomb, cell.Type);
        }