Beispiel #1
0
    public void DroppingShouldShiftToDroppedOnUpdateWhenNothingToMove()
    {
        IGridState droppingState = new DroppingState(gridMock);
        gridMock.MoveBlocks().Returns(true);

        droppingState.OnUpdate();
        gridMock.DidNotReceive().SetState(GridStates.Dropped);

        gridMock.MoveBlocks().Returns(false);
        droppingState.OnUpdate();
        gridMock.Received().SetState(GridStates.Dropped);
    }
Beispiel #2
0
    public void DroppingShouldShiftToDroppedOnUpdateWhenNothingToMove()
    {
        IGridState droppingState = new DroppingState(gridMock);

        gridMock.MoveBlocks().Returns(true);

        droppingState.OnUpdate();
        gridMock.DidNotReceive().SetState(GridStates.Dropped);

        gridMock.MoveBlocks().Returns(false);
        droppingState.OnUpdate();
        gridMock.Received().SetState(GridStates.Dropped);
    }