Are there shortcut keys for ReSharper's Unit Test Runner?

后端 未结 12 1503
旧时难觅i
旧时难觅i 2021-01-30 12:49

For obvious productivity reasons, I make an effort of learning and using as many of the keyboard shortcuts for the various Re# commands.

However, it seems that the unit

相关标签:
12条回答
  • 2021-01-30 12:50

    As for running all tests in solution the command is Alt-RUN, i.e. ALT+R for ReSharper menu, U for Unit Testing, and N for all tests in solution.

    And if you're using the R# shortcuts, the chord Ctrl-U, L will always do the job.

    NOTE: I found this answer from from stackoverflow user ilya-ryzhenkov on a related question

    0 讨论(0)
  • 2021-01-30 12:51

    Resharper > 7 / Visual Studio 2012

    You can find them in the defined shortcuts in Visual Studio 2012 under
    [Tools] > [Options] > [Environment] > [Keyboard]

    I usually use these:

    +---------------------------------+----------------+
    | Description                     | Shortcut       |
    +---------------------------------+----------------+
    | Run Test in Debug Mode (Editor) | Ctrl+U, Ctrl+D |
    | Run Test (Editor)               | Ctrl+U, Ctrl+R |
    | Run Tests from current session  | Ctrl+U, Ctrl+Y |
    | Run Tests from solution         | Ctrl+U, Ctrl+L |
    +---------------------------------+----------------+
    
    • Resharper.Resharper_Resharper_UnitTest_DebugContext
    • Resharper.Resharper_Resharper_UnitTest_RunContext
    • Resharper.Resharper_UnitTest_RunCurrentSession
    • Resharper.Resharper_UnitTest_RunSolution
    0 讨论(0)
  • 2021-01-30 12:51

    It writes shortcuts in itself or website. Run Unit Tests: Ctrl+T, R
    Debug Unit Tests: Ctrl+T, D
    Run All Tests From Solution: Ctrl+T, Ctrl+L
    Run Current Session: Ctrl+T, Y
    Repeat Previous Run: Ctrl+T, T
    Append Tests To Session: Ctrl+T, Ctrl+A
    Create New Session: Ctrl+T, N
    Unit Tests: Ctrl+Alt+T
    Unit Tests Session: Ctrl+Alt+R
    https://www.jetbrains.com/help/resharper/Reference__Keyboard_Shortcuts.html#unit_testing

    0 讨论(0)
  • 2021-01-30 12:52

    ReSharper adds items to Visual Studio's keyboard settings dialog box.

    Go to:

    Tools -> Options, Environment -> Keyboard

    In the search bar, type "resharper" and see the vast options that you can control with the keyboard.

    Specifically, there is one to launch the unit test explorer window, and there's a couple called

    • ReSharper.ReSharper_UnitTest_RunSolution
    • ReSharper.ReSharper_UnitTest_RunContext

    that are likely what you need.

    0 讨论(0)
  • 2021-01-30 12:54

    For Resharper 4.5 OOTB:

    Unit Test Explorer : Ctrl+Alt+U
    Unit Test Sessions : Ctrl+Alt+T
    Close Active Window : Shift+Esc

    I just noticed last week that my keyboard has a right-click button between Alt and Ctrl on the right side, so no mouse needed to mouse to a specific test. Yeah!

    Custom key mapping via Ben Scheirman's method:
    ReSharper.ReSharper_UnitTest_ContextDebug : Alt+T, Alt+D
    ReSharper.ReSharper_UnitTest_ContextProfile : Alt+T, Alt+P
    ReSharper.ReSharper_UnitTest_ContextRun : Alt+T, Alt+T and Alt+T, Alt+R
    ReSharper.ReSharper_UnitTest_RunSolution : Alt+T, Alt+S
    ReSharper.ReSharper_UnitTest_RunSolution : Alt+T, Alt+A

    0 讨论(0)
  • 2021-01-30 12:54

    Since the time I originally asked this question, this is what I have been using:

    Open 'Unit Test Explorer' and 'Unit Test Session' windows

    • use the keybindings available in ReSharper 4.5+

    Selecting a single test in 'Unit Test Session'

    • to select a test, use arrow keys to navigate

    Selecting multiple tests in 'Unit Test Session'

    • to select multiple continous tests, hold the Shift key down while navigating with the arrow keys
    • to select multiple non-continous tests, hold Ctrl key while using arrows keys and toggle Spacebar to select/deselect tests

    Run and execute tests in 'Unit Test Session'

    • press context menu button (found between the Alt and Ctrl buttons on most Windows-centric keyboards)

      or

    • alternatively, press Shift + F10

    • navigate with arrow keys within context window and hit Enter on any selection

      or

    • for Run Selected Tests, press r + Enter

    • for Debug Selected Tests, press d

    Select call stack error line hyperlinks

    • if a test fails and the call stack is displayed splitting the 'Session' window, press Tab to navigate from the test section to the error links in the lower section

    • after tabbing to a specific error line, hit Enter to go to line of code with the runtime error

    • press Shift + Tab mutliple times as necessary to go backwards from the call stack (lower) section back to the unit tests (upper) section

    0 讨论(0)
提交回复
热议问题