开发者

Is there a way to span long method names across multiple lines?

开发者 https://www.devze.com 2023-01-06 05:00 出处:网络
We\'re using very descriptive test names for work and it\'s开发者_StackOverflow社区 getting very annoying to horizontally scroll across them.Is there a way to get a method name to span multiple lines

We're using very descriptive test names for work and it's开发者_StackOverflow社区 getting very annoying to horizontally scroll across them. Is there a way to get a method name to span multiple lines in C#?

Something like:

MyMethodNameIsReallyLong
    _SoImMakingItSpanMultipleLines
    _SoIDontHaveToHorizontallyScroll
    _AndMyLifeIsMuchEasier()
{
    DoSomething();
}

Thanks.


I'm pretty sure the short answer is: No.

There is a Description Attribute for TestMethod that "might" be a helpful alternative...

[TestMethod, Description("My really long descriptive test name")]
public void Test99()
{
   Assert.Fail();
}


why choose so much lengthy names. length of the first one is enough to understand MyMethodNameIsReallyLong. Function name should be combination of max 4-5 different words which could be understandable. Such lengthy names should be avoided.

existing examples getElementById/Name - javascript


I assume the individual method names are not long enough to require scrolling. If you rearrange the method calls, you'll see more text vertically:

MyMethodNameIsReallyLong(
   SoImMakingItSpanMultipleLines(
      SoIDontHaveToHorizontallyScroll()
   )
);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号