有没有办法跨多行跨越长方法名称?

Lan*_*opp 5 c# syntax

我们在工作中使用非常具有描述性的测试名称,水平滚动它们变得非常烦人。有没有办法让方法名称在 C# 中跨越多行?

就像是:

MyMethodNameIsReallyLong
    _SoImMakingItSpanMultipleLines
    _SoIDontHaveToHorizontallyScroll
    _AndMyLifeIsMuchEasier()
{
    DoSomething();
}
Run Code Online (Sandbox Code Playgroud)

谢谢。

Scr*_*dog 5

我很确定简短的回答是:不。

TestMethod 有一个描述属性,“可能”是一个有用的替代方法......

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