如何让 Resharper 允许在方法名称中使用下划线,但只允许在测试中使用? [英] How to get Resharper to allow underscores in method names but only in Tests?

查看:26
本文介绍了如何让 Resharper 允许在方法名称中使用下划线,但只允许在测试中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一种方法可以做到这一点,但我找不到了.

I know that there is a way to do this, but I can't find it again.

那么,有人知道如何让 Resharper 在单元测试中允许使用下划线吗?

So, does any one know how to allow Resharper to allow underscores in unit tests?

所以,例如我希望这没问题

So, for example I want this to be OK

在 MyClassTest.cs 中

public void MyMethodName_StateUnderTest_ExpectedResult()
{}

<小时>

但我想要标记:


But I want this to flag:

在 MyClass.cs 中

public void MyPoorly_Named_Method()
{}

<小时>

感谢您的帮助


Thanks for any help

推荐答案

这篇文章演示了如何配置:http://atombrenner.blogspot.com/2010/07/how-to-change-resharper-naming-style.html

This post demonstrates how to configure this: http://atombrenner.blogspot.com/2010/07/how-to-change-resharper-naming-style.html

更新:Machine.Specifications 测试框架将 ReSharper 扩展到允许为测试/规范自定义命名样式.很酷;希望其他框架也这样做.http://lostechies.com/derekgreer/2010/02/11/resharper-naming-style-for-machine-specifications/

UPDATE: The Machine.Specifications testing framework extends ReSharper to allow for custom naming styles for the tests/specs. Very cool; wish other frameworks did likewise. http://lostechies.com/derekgreer/2010/02/11/resharper-naming-style-for-machine-specifications/

这篇关于如何让 Resharper 允许在方法名称中使用下划线,但只允许在测试中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆