Lots and Lots of Unit Test Runner Improvements to make it keyboard friendly

The unit test runner is a real pain in the ass to drive from the keyboard (Especially in a Vim like style where you don't want to touch the mouse or arrow keys).  For the most you never want to leave the text editor, the unit test session window is only really needed to be "view" only, and would be nice if it can be completely controlled from the text editor window.  The following are some suggestions on how to do that :-

One of the biggest problems is you can't easily re run failing tests.  Previously in the forum you need to go to the test runner and set the filter to failed.  This is a huge pain in the ass to do from the keyboard, it would be much nicer to have the following



Another pain point is cycling to the code locations of fails, at the moment you need to select the test runner, get to the failing test somehow, then press enter, instead, it would be nice to have the following



These would both take you to the code location AND select the failing test in the test runner session ( which will then show you the failing result ) but keep you in the text editor

Also it would be good to have ways to go to the next failing test in the unit session window without having to switch to the unit test session window



and to go to the code 



It would be nice to have the option  "Auto Scroll to Failing Test", without switching to the unit test session window.


Next option that would be nice is a refactoring "Change Assert.Equal to Pass Failing Test", which would take the failing test value and put it into the Assert, very useful when you do silly typos

In the actions when you have an unknown type, I want to create type in Project.  Currently there are generators where you can generate it in a new project ( which aren't too keyboard friendly )  I'd like   "Create Type in a new file in Project" ... then it would let me select the project, then any new type I want to create there would be a quick create type for the project I had selected.


Also, these would be nicer if they could be done from the text editor

ReSharper_UnitTestSessionAutoScrollOutput, Alt+1
ReSharper_UnitTestSessionTrackRunningTest, Alt+2
ReSharper_ContinuousTestingRunAllMode, Alt+4
ReSharper_ContinuousTestingRunNewAndOutdatedMode, Alt+3
ReSharper_ContinuousTestingCoverNewAndOutdatedMode, Alt+5

but at the moment they only work with the unit test session window, this means I cannot bind them to VsVim keyboard settings

as an example of the bindings I do in VsVim to R#....

map gd :vsc ReSharper.ReSharper_GotoDeclaration<CR>
map <Space>r :vsc ReSharper.ReSharper_Rename<CR>
map <Space>f :vsc ReSharper.ReSharper_GotoFileMember<CR>
map <Space>e :vsc ReSharper.ReSharper_GotoNextErrorInSolution<CR>
map <Space>E :vsc ReSharper.ReSharper_GotoPrevErrorInSolution<CR>
map <Space>s :vsc ReSharper.ReSharper_SurroundWith<CR>
map <Space>l :vsc ReSharper.ReSharper_LiveTemplatesInsert
map <Space>u :vsc ReSharper.ReSharper_GotoUsage<CR>
map <Space>d :vsc ReSharper.ReSharper_DuplicateText<CR>
map <Space>, :vsc ReSharper.ReSharper_GotoText<CR>
map <Space>v :vsc ReSharper.Resharper_IntroVariable<CR>
map <Space>m :vsc ReSharper.ReSharper_ExtractMethod<CR>
map <Space>o :vsc ReSharper.ReSharper_Move<CR>
map <Space>t :vsc ReSharper.ReSharper_GotoType<CR>
map <Space>tr :vsc ReSharper.ReSharper_UnitTestRunFromContext<CR>
map <Space>td :vsc ReSharper.ReSharper_UnitTestDebugContext<CR>
map <Space>ta :vsc ReSharper.ReSharper_UnitTestRunSolution<CR>
map <Space>tl :vsc ReSharper.ReSharper_UnitTestSessionRepeatPreviousRun<CR>
map <Space>tt :vsc ReSharper.ReSharper_ShowUnitTestSessions<CR>
map <Space>b :vsc Build.BuildSolution<CR>
map <Space><Space> :vsc Tools.InvokeAceJumpCommand<CR>
map <Space>; A;<Esc>
map ] :vsc ReSharper.ReSharper_GotoNextMethod<CR>
map [ :vsc ReSharper.ReSharper_GotoPrevMethod<CR>
map zl :so ~/.vsvimrc<CR>


I'd like to be able to do all the above from vsvims bindings.  


As a bonus, if you guys did a EasyMotion type system in R# that was compatible with VsVim, that would be awesome. The current plugins that try to do this are not really very good.  

Also, if you did your Vim emulation you have for WebStorm / DataGrip etc as a plugin to Visual Studio as a replacement for vsvim, that would be cool as well since the emulation is really good in those products


A lot of this I'm putting into a guide on how to use VsVim and Resharper together   https://github.com/keithn/vsvimguide



Please sign in to leave a comment.