A couple questions about resharper(formating and Unit Testing)

Hi

I am wondering why does resharper suggest that for private field variables that I use the underscore(_)

like

private int myMember // is what I learned in head first C# as the standard to use

but resharper wants

private int _myMember

I know I can change it but why does it suggest this as the standard.

Second I have a unit test soultion that I made with Nunit. However I currently don't have Nunit installed but I can right click on "run unit tests" and it will run and tell me all my tests passed. What is resharper using?

2 comments

Hello xiao,

'_' is just the default setting, you can change it to anything that corresponds
to your naming style. As to unit testing, by default the NUnit engine that
comes with ReSharper is used, so you don't need to have full NUnit installed
in order to run your tests. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi

I am wondering why does resharper suggest that for private field
variables that I use the underscore(_)

like

private int myMember // is what I learned in head first C# as the
standard to use

but resharper wants

private int _myMember

I know I can change it but why does it suggest this as the standard.

Second I have a unit test soultion that I made with Nunit. However I
currently don't have Nunit installed but I can right click on "run
unit tests" and it will run and tell me all my tests passed. What is
resharper using?

---
Original message URL:
http://devnet.jetbrains.net/message/5281876#5281876



0

'_' is just the default setting, you can change it to anything that corresponds
to your naming style.


I know you can change it but I am wondering why it was choosen as the naming style since I was under the impression it was not the standard way(set out by MS) to write those kind of private fields. I thought Resharper took the standards that where set out and use them.


I am also wondering how does Change Signature work? I click on one of my methods and click "Change Signature" and all my parameters come up yet I can't add any default values to any of the existing parameters. If I add a new parameter through the Change Signature dialog then it will let me.

Why won't it let me?

Thanks

0

Please sign in to leave a comment.