草庐IT

resharper-4.5

全部标签

c# - ReSharper 提示成员 "ID"中的大写字母 "EntityID"

我在一个类中有一个属性“EntityID”。Resharper(5.1)说Name'EntityID'doesnotmatchrule'Methods,propertiesandevents'.Suggestednameis'EntityId'.但是恕我直言,根据DesignGuidelinesforClassLibraryDevelopers中的命名约定.“EntityID”应该完全没问题:Donotuseacronymsthatarenotgenerallyacceptedinthecomputingfield.Whereappropriate,usewell-knownacron

c# - ReSharper 提示成员 "ID"中的大写字母 "EntityID"

我在一个类中有一个属性“EntityID”。Resharper(5.1)说Name'EntityID'doesnotmatchrule'Methods,propertiesandevents'.Suggestednameis'EntityId'.但是恕我直言,根据DesignGuidelinesforClassLibraryDevelopers中的命名约定.“EntityID”应该完全没问题:Donotuseacronymsthatarenotgenerallyacceptedinthecomputingfield.Whereappropriate,usewell-knownacron

c# - ReSharper 一次运行项目或解决方案中的所有单元测试

我在IDE中,我可以在一个文件中运行所有单元测试,但是有什么方法可以同时在一个项目或解决方案中运行所有测试吗? 最佳答案 在VS解决方案资源管理器中右键单击项目或解决方案并选择“运行单元测试”或转到Resharper菜单,选择单元测试并从中选择一个选项。 关于c#-ReSharper一次运行项目或解决方案中的所有单元测试,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/334933

c# - ReSharper 一次运行项目或解决方案中的所有单元测试

我在IDE中,我可以在一个文件中运行所有单元测试,但是有什么方法可以同时在一个项目或解决方案中运行所有测试吗? 最佳答案 在VS解决方案资源管理器中右键单击项目或解决方案并选择“运行单元测试”或转到Resharper菜单,选择单元测试并从中选择一个选项。 关于c#-ReSharper一次运行项目或解决方案中的所有单元测试,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/334933

c# - ReSharper 突出显示 nameof 与 "Explicit argument passed to parameter with caller info attribute"的结合使用

我使用nameof函数将属性名称作为字符串获取:publicboolIsRunning=>...;...RaisePropertyChanged(nameof(IsRunning));ReSharper通过警告突出显示这一点:Explicitargumentpassedtoparameterwithcallerinfoattribute代码有效,我只是想知道上面的警告是否是我应该担心的事情。 最佳答案 wasjustwonderingiftheabovewarningissomethingIshouldworryabout.当您附加

c# - ReSharper 突出显示 nameof 与 "Explicit argument passed to parameter with caller info attribute"的结合使用

我使用nameof函数将属性名称作为字符串获取:publicboolIsRunning=>...;...RaisePropertyChanged(nameof(IsRunning));ReSharper通过警告突出显示这一点:Explicitargumentpassedtoparameterwithcallerinfoattribute代码有效,我只是想知道上面的警告是否是我应该担心的事情。 最佳答案 wasjustwonderingiftheabovewarningissomethingIshouldworryabout.当您附加

c# - .NET 4.5 中 List<T>.Sort 的行为从 .NET 4.0 改变了吗?

我在一个针对.NET4.0的项目中进行了以下测试:[TestFixture]publicclassDonkey{[Test]publicvoidTestListSorting(){varexpected=new[]{MockRepository.GenerateStub(),MockRepository.GenerateStub()};varsorted=newList(expected);CollectionAssert.AreEqual(expected,sorted);sorted.Sort();CollectionAssert.AreEqual(expected,sorted)

c# - .NET 4.5 中 List<T>.Sort 的行为从 .NET 4.0 改变了吗?

我在一个针对.NET4.0的项目中进行了以下测试:[TestFixture]publicclassDonkey{[Test]publicvoidTestListSorting(){varexpected=new[]{MockRepository.GenerateStub(),MockRepository.GenerateStub()};varsorted=newList(expected);CollectionAssert.AreEqual(expected,sorted);sorted.Sort();CollectionAssert.AreEqual(expected,sorted)

c# - 为什么 Resharper 建议我将 "not any equal"简化为 "all not equal"?

这个问题在这里已经有了答案:LINQ:NotAnyvsAllDon't(8个答案)关闭7年前。我需要检查一个项目是否不存在于C#的项目列表中,所以我有这一行:if(!myList.Any(c=>c.id==myID)))Resharper建议我将其更改为:if(myList.All(c=>c.id!=myID)))我可以看到它们是等价的,但为什么它建议更改?第一次实现是否由于某种原因变慢了?

c# - 为什么 Resharper 建议我将 "not any equal"简化为 "all not equal"?

这个问题在这里已经有了答案:LINQ:NotAnyvsAllDon't(8个答案)关闭7年前。我需要检查一个项目是否不存在于C#的项目列表中,所以我有这一行:if(!myList.Any(c=>c.id==myID)))Resharper建议我将其更改为:if(myList.All(c=>c.id!=myID)))我可以看到它们是等价的,但为什么它建议更改?第一次实现是否由于某种原因变慢了?