Ejemplo n.º 1
0
        public void AddShortCut_ValidateShortCutsOverlap_ThrowsException()
        {
            BoardDataDto boardData = new BoardDataDto();

            //Arrange
            boardData.Height = 2;
            boardData.Width  = 10;
            Board    board  = new Board(boardData);
            ShortCut ladder = new RegularShortCut(1, 3);
            ShortCut snake  = new RegularShortCut(1, 2);

            board.AddLadderToBoard(ladder);


            Assert.That(() => board.AddSnakeToBoard(snake), Throws.Exception);
        }
Ejemplo n.º 2
0
        public void AddShortCut_SnakeLadderNotCompatible_ThrowsException()
        {
            BoardDataDto boardData = new BoardDataDto();

            //Arrange
            boardData.Height = 2;
            boardData.Width  = 2;
            Board    board  = new Board(boardData);
            ShortCut ladder = new RegularShortCut(1, 3);
            ShortCut snake  = new RegularShortCut(4, 2);

            board.AddLadderToBoard(ladder);


            //Assert
            Assert.That(() => board.AddSnakeToBoard(snake), Throws.Exception);
        }