Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7022405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:34:40+00:00 2026-05-27T23:34:40+00:00

I follow the naming convention of MethodName_Condition_ExpectedBehaviour when it comes to naming my unit-tests

  • 0

I follow the naming convention of

MethodName_Condition_ExpectedBehaviour

when it comes to naming my unit-tests that test specific methods.

for example:

[TestMethod]
public void GetCity_TakesParidId_ReturnsParis(){...}

But when I need to rename the method under test, tools like ReSharper does not offer me to rename those tests.

Is there a way to prevent such cases to appear after renaming? Like changing ReSharper settings or following a better unit-test naming convention etc. ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:34:41+00:00Added an answer on May 27, 2026 at 11:34 pm

    A recent pattern is to groups tests into inner classes by the method they test.

    For example (omitting test attributes):

    public CityGetterTests 
    {
       public class GetCity
       {
          public void TakesParidId_ReturnsParis()
          {
              //...
          }
    
          // More GetCity tests
       }
    }
    

    See Structuring Unit Tests from Phil Haack’s blog for details.

    The neat thing about this layout is that, when the method name changes,
    you’ll only have to change the name of the inner class instead of all
    the individual tests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like the unit tests naming convention recommended by Roy Osherove where unit tests
I have pretty large file names that follow a standard naming practice and I
Is there any accepted convention for naming war files? Jar files seem to follow
Is there a well-established naming convention in use for WCF binding configurations that someone
I've just started looking at a project that has >20k unit tests written in
Here http://source.android.com/source/code-style.html#follow-field-naming-conventions it is stated that : Field Names Non-public, non-static field names start
I have to following problem: If i want to follow the Rails naming convention
Follow up to this question for Facebook Friends.getAppUsers using Graph API that pulls friends
I follow example from here using section listview http://lalit3686.blogspot.com/2012/05/sectionadapter.html But how can I implement
So I know the convention for naming M-M relationship tables in SQL is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.