resharper

ReSharper run all unit tests in a project or solution at once

徘徊边缘 提交于 2019-12-03 23:19:07
问题 I am inside the IDE and I can run all the unit tests in a file but is there any way to run all test in a project or solution at once? 回答1: Right click on the project or solution in the VS solution-explorer and choose 'Run Unit Tests' Or go to the Resharper menu, choose Unit-Testing and choose one of the options from there. 回答2: If you learn executing menu commands with Alt-Letters, you can execute many commands fast even if they don't have direct shortcuts. Especially, if shortcuts are two

Wrapping multiple statements in braces

我与影子孤独终老i 提交于 2019-12-03 22:44:02
Is there a keyboard shortcut in Visual Studio 2010 (I'm using ReSharper 6.1 also) that will allow me to surround a selected block of text with curly braces? I tried "Surround With..." (Ctrl+K, Ctrl+S), but I didn't see an option in the list to choose curly braces as the surrounding element. The common use case for this is that I'll have an if-statement like the following: if (conditional) statement1; // the rest of the program I'll realize that there are some additional tasks that need to be performed inside the if-statement and I add them: if (conditional) statement1; statement2; statement3;

C# @ modifier for methods parameters

こ雲淡風輕ζ 提交于 2019-12-03 22:16:37
I was using ReSharper plugin on VS2010 and i was generating an interface method. ReSharper put an @ on the parameter name. WHat is that used for? int Count(Func<ContratoList, bool> @where); Whats the difference for int Count(Func<ContratoList, bool> where); Thanks! The @ symbol allows you to use reserved words in a variable name. int @class = 1; void MyMethod(int @goto); bool @public { get; set; } As Marc correctly pointed out in his comment and his answer, ReSharper is actually wrong to do this because where is a Contextual Keyword and is not actually a reserved word, so your method will

Is there a way to *prevent* ReSharper from running an assembly's unit tests in parallel?

筅森魡賤 提交于 2019-12-03 22:16:09
I see an option in the Unit Testing settings to "Run up to 1|2" assemblies in parallel", but setting this to "1" still seems to execute a single assembly's tests in parallel. Is there a way to disable parallel execution altogether? This is ReSharper 6.1. pms1969 You can try looking at the stack overflow answer here How to run NUnit test fixtures serially? However, it would seem that your need to do this might be fuelled by test dependencies. Either the need to access common resources or the output of one test needing to be the input of another. If this is the case, please consider refactoring

Resharper not running new unit tests

心已入冬 提交于 2019-12-03 22:12:33
When I create new NUnit unit tests in my test project, the ReSharper Unit Test Runner detects them but they remain grey and are not run. This behaviour occurs whether I try to run the tests individually or all together. If I close and reopen the solution, the new tests are detected and run correctly. The behaviour only occurs if I build the solution using visual studio before I run the tests. If I let resharper trigger the build the tests are detected correctly. I am using: Visual Studio 2010 ReSharper NUnit 2.5.7 Try cleaning the solution and delete RS related files and folders from your

Resharper 'Ctrl + Alt Click' isn't working with visual studio 2017

谁说我不能喝 提交于 2019-12-03 22:08:52
I installed vs 2017. And found that functional that I use every time isn't working anymore.Ctrl + alt click don't go to implementation ,it goes like 'ctrl click',to declaration. After some searching I found a solution . Need to uncheck visual studio settings 来源: https://stackoverflow.com/questions/46792639/resharper-ctrl-alt-click-isnt-working-with-visual-studio-2017

Reset Resharper

被刻印的时光 ゝ 提交于 2019-12-03 22:08:42
How can I reset all options in Resharper back to their default? Here is how you do it in Resharper 6.1. Go to Resharper -> Manage Options... Click the "Reset All Settings" button. devi Try deleting the file: C:\Users\<user-name>\AppData\Roaming\JetBrains\ReSharper\<resharper version>\vs<vs version>\UserSettings.xml 来源: https://stackoverflow.com/questions/3966798/reset-resharper

Code suggestions by Resharper making code less readable?

依然范特西╮ 提交于 2019-12-03 22:04:11
While trying to get to all green, i got the following suggestion by Resharper. Original code: static public string ToNonNullString(this XmlAttribute attr) { if (attr != null) return attr.Value; else return string.Empty; } Suggestion: remove redundant 'else' resulting in following: static public string ToNonNullString(this XmlAttribute attr) { if (attr != null) return attr.Value; return string.Empty; } To me, the suggested version seems less readable than the original. Does Resharper suggestion reflect the definition of good maintainable code? Technically Resharper is correct in that the "else"

Find Unused public functions

心已入冬 提交于 2019-12-03 18:46:20
问题 Is there a way to automatically find all unused public functions in a solution? I have resharper, and right now I have to do a "find usages" on each symbol, which is tedious--it seems like there should be a better way 回答1: Of course there's a better way. Here's what you should do if you use ReSharper 4.5 or later: Go to ReSharper > Options > Code Inspection > Inspection Severity. Scroll down to "Unused symbols" category and set all containing items called "Non-private accessibility" to be

Spec fails when run by mspec.exe, but passes when run by TD.NET

走远了吗. 提交于 2019-12-03 18:15:17
问题 I wrote about this topic in another question. However, I've since refactored my code to get rid of configuration access, thus allowing the specs to pass. Or so I thought. They run fine from within Visual Studio using TestDriven.Net. However, when I run them during rake using the mspec.exe tool, they still fail with a serialization exception. So I've created a completely self-contained example that does basically nothing except setup fake security credentials on the thread. This test passes