-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run test(s) in context #45
Run test(s) in context #45
Conversation
package.json
Outdated
@@ -66,6 +66,10 @@ | |||
"dark": "resources/dark/run.svg" | |||
} | |||
}, | |||
{ | |||
"command": "dotnet-test-explorer.runTestInContext", | |||
"title": "Run Test in context" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better name it Run .NET Core Test
?
package.json
Outdated
"editor/context": [ | ||
{ | ||
"command": "dotnet-test-explorer.runTestInContext", | ||
"group": "dotnetTestExplorer@0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This context would only be shown when language is C#, F# or VB.NET
Had a quick glance and seem good to me. What I mentioned in Gitter about supporting the same k/b shortcuts as Visual Studio, that would be great but I recall having conflicts with existing default shortcuts. Here they are if you can get it to work or align closer https://msdn.microsoft.com/en-us/library/da5kh0wa.aspx#bkmk_testexplorerGLOBAL Will have a closer look at the PR later. |
Shortcuts are tricky since what feels natural is largely what you're used to from before. If you come from vs the vs ones make sense, if you come from resharper the resharper ones make sense etc. The shortcuts are easily changeable in vscode and I have a feeling that people that care deeply about their shortcuts will change them to whatever makes sense to them regardless of what we set as a default value. That's my gut feeling anyway. |
This adds a command to run test(s) depending on the context of the current cursor and open document.
The command can be executed by right clicking the editor or executing the keyboard shortcut (default is alt-r + alt-u)
Examples:
If the command is executed on line 10-13 it executes the dotnet test command for Xunittest.TestClass.Pass. If executed on line 7-9 it will run for Xunittest.TestClass. If it can't figure out which symbol is the matching one it will execute the test for the first symbol found in the file.