Keyboard Shortcut for UnitTestSession_RunAll

I've got a test session with a set of tests that I want to run frequently.

My problem is that I can't find a way to create a keyboard shortcut that
runs this session without first giving focus to the session window.

Have I overlooked something? Is there a better way to do what I want?

--
Yours,
Alf Lervåg

3 comments
Comment actions Permalink

Hello Alf,

Unfortunately, there is no such command, I admit it was a slip from our side.
We will include such command in next bugfix update.

Fortunately, you can craft such command very easy yourself.

Check this: http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.5Plugin+Development
(it is pretty old, so some namespaces and assemblies changed).

Create an action, and inside use UnitTestManager.GetInstance(solution).CurrentSession.
If it is not null, you can use UnitTestManager.RunSession to execute it.
You will need controller, which you can just create as "new ProcessTaskRunnerHostController(manager)"
(see inheritors of ITaskRunnerHostController for available controllers).

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


AL> I've got a test session with a set of tests that I want to run
AL> frequently.
AL>
AL> My problem is that I can't find a way to create a keyboard shortcut
AL> that runs this session without first giving focus to the session
AL> window.
AL>
AL> Have I overlooked something? Is there a better way to do what I
AL> want?
AL>


0
Comment actions Permalink

Ilya Ryzhenkov wrote:

Unfortunately, there is no such command, I admit it was a slip from our
side. We will include such command in next bugfix update.


Sounds good.

Fortunately, you can craft such command very easy yourself.
Check this:
http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.5Plugin+Development
(it is pretty old, so some namespaces and assemblies changed).


Took me a while to figure it out, but I ended up with the following
references (in case anyone reads this and tries to create a plugin):
- JetBrains.Platform.Resharper.ActionManagement
- JetBrains.Platform.Resharper.IDE
- JetBrains.Platform.Resharper.ProjectModel
- JetBrains.Platform.Resharper.Shell
- JetBrains.Platform.Resharper.UI
- JetBrains.Platform.Resharper.Util
- JetBrains.ReSharper.UnitTestExplorer

One question. IActionHandler.Execute has a nextExecute argument. When
would I use this, and for what? (I assume nextUpdate in Update will be
similar.)

I've got a working plugin now, so thanks for the pointers.

--
Alf

0
Comment actions Permalink

Hello Alf,

nextUpdate and nextExecute will call the handler defined for the action you
override. So, if you want to prevent original action from being executed,
you don't call next handler.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


AL> Ilya Ryzhenkov wrote:
AL>
>> Unfortunately, there is no such command, I admit it was a slip from
>> our side. We will include such command in next bugfix update.
>>
AL> Sounds good.
AL>
>> Fortunately, you can craft such command very easy yourself.
>> Check this:
>> http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.5P
>> lugin+Development
>> (it is pretty old, so some namespaces and assemblies changed).
AL> Took me a while to figure it out, but I ended up with the following
AL> references (in case anyone reads this and tries to create a plugin):
AL> - JetBrains.Platform.Resharper.ActionManagement
AL> - JetBrains.Platform.Resharper.IDE
AL> - JetBrains.Platform.Resharper.ProjectModel
AL> - JetBrains.Platform.Resharper.Shell
AL> - JetBrains.Platform.Resharper.UI
AL> - JetBrains.Platform.Resharper.Util
AL> - JetBrains.ReSharper.UnitTestExplorer
AL> One question. IActionHandler.Execute has a nextExecute argument.
AL> When would I use this, and for what? (I assume nextUpdate in Update
AL> will be similar.)
AL>
AL> I've got a working plugin now, so thanks for the pointers.
AL>


0

Please sign in to leave a comment.