Exemplo n.º 1
0
        public void CannotSelectASquareOutOfRightBounds()
        {
            var board = default(IBoard);
            var squareSelectable = default(SquareSelectable);
            var result = default(bool);

            "Given I have a default 9x9 board".Context(() =>
            {
                board = new BoardFactory().Create();
                squareSelectable = new SquareSelectable();
            });

            "When I try to select a square out of bounds to the right".Do(() =>
                result = squareSelectable.CanSelectSquare(board, 100, 3));

            "Then that square should not be selectable".Observation(() =>
                result.ShouldBeFalse());
        }
Exemplo n.º 2
0
        public void CanSelectAnInBoundsSelectableSquare()
        {
            var board = default(IBoard);
            var squareSelectable = default(SquareSelectable);
            var result = default(bool);

            "Given I have a default 9x9 board".Context(() =>
                            {
                                board = new BoardFactory().Create();
                                squareSelectable = new SquareSelectable();
                            });

            "When I try to select a square in bounds that is selectable".Do(() =>
                result = squareSelectable.CanSelectSquare(board, 3, 3));

            "Then that square should be selectable".Observation(() =>
                result.ShouldBeTrue());
        }