Is it possible to define custom naming conventions for resharper?

I'm using Resharper (with the StyleCop plugin, although I don't think that's relevant to the question/answer) to enforce naming conventions amongst other things in our code base. Pretty much everywhere this works brilliantly, with one exception.

For test method names I prefer the following convention:

ThingOrBehaviourUnderTest_Action_ExpectedOutcome

Currently this results in an inconsistent naming warning and to-date I've just ignored it (I know I can disable the warning in that file, but then it disables the warning for all any other naming inconsistencies). In the list of styles I can assign Resharper offers camel case, which would result in:

ThingOrBehaviourUnderTestActionExpectedOutcome

or underscore separated words:

Thing_or_behaviour_under_test_action_expected_outcome

Both are close to what I want, but not quite there. I guess I'm after a way of allowing underscores as valid characters in camel cased test method names, or a way of supporting a custom naming convention. Is this possible?

-------------Problems Reply------------

I know this question is pretty old, but ReSharper 7 now finally supports the definition of extended naming rules. Those make it possible to have separate name styles for test methods.

The AgentSmith plugin for ReSharper should meet your needs through its regex rule support.

Category:resharper Views:0 Time:2010-10-16
Tags: resharper

Related post

  • How to convert string type to user defined custom type 2010-08-31

    I have a string value that needs to be converted into my user defined custom type. how to do this, please help me. public class ItemMaster { public static ItemMaster loadFromReader(string oReader) { return oReader;//here i am unable to convert into I

  • Where to define custom error types in Ruby and/or Rails? 2011-03-05

    Is there a best practice for defining custom error types in a Ruby library (gem) or Ruby on Rails application? Specifically: Where do they belong structurally in the project? A separate file, inlined with the relevant module/class definition, somewhe

  • Can I define custom "surround with" templates in Visual Studio 2008? 2009-07-23

    Can I define custom "surround with" templates in Visual Studio 2008? --------------Solutions------------- Here you go, this is an example to set everything selected inside {} In tools, codesnipet manager. <?xml version="1.0" encoding="utf-8" ?>

  • What are custom calling conventions? 2010-02-23

    What are these? And how am I affected by these as a developer? Related: What are the different calling conventions in C/C++ and what do each mean? --------------Solutions------------- A calling convention describes how something may call another func

  • Is there a better way to get 'class' semantics in Powershell (defining custom types)? 2010-08-11

    I am building an automation system using Powershell and I would like to define custom .Net types so that I can structure my application in a similar way to the other code I write. At first, I tried using ‘Add-Type’ to import types from c# files into

  • How do I define custom datatype in xsd? 2010-10-04

    I want to check if a field in my XML is of type positive double/decimal. There is a type="xs:positiveInteger" datatype in XSD but no positive double or decimal. Is there a way to achieve this either by defining custom datatype or some other way? ----

  • how to define custom week range in FullCalendar 2010-12-03

    how to define custom week range in Full Calendar. For example currently it is given 7 days week like 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'. but i want to display 14 days week like 'SunA','MonA','TueA','WedA','ThuA','FriA','SatB','SunB','MonB','Tu

  • defining custom protocol 2010-12-18

    I have a custom class.And I want if any other class instantiate it then it "must" have some specific method. How to achieve this? I don't want to inherit it cause I m not adding any extra feature or modifying its functionality in any way. I thought o

  • Can I define custom operator overloads in Javascript? 2011-01-15

    Is it possible to define custom operators between instances of a type in JavaScript? For example, given that I have a custom vector class, is it possible to use vect1 == vect2 to check for equality, whilst the underlying code would be something like

  • what's the advantages to define custom exception? 2011-03-09

    Any big reasons to define custome exceptions in Java? --------------Solutions------------- Two reasons immediately spring to mind: Simply so you don't say try { ... } catch (Exception e) { ... } - having your own subclasses lets you treat distinct ex

  • How to define custom filter to block spam in Drupal 2011-04-07

    Drupal has a nice spam module with a lot of features, including defining Custom filters. The filters can be either Plain text or Regular expressions. I am a bit familiar with regexp but not sure how to define regexps in spam module in order to block

  • How to define custom sendable actions on my custom control? (which can be recognized in IB) 2011-06-01

    How to define custom sendable actions(which can be connected with [email protected]) on my custom control? For Instance, UIButton can invoke actions by many events. (Touch Up Inside, Touch Up Outside... and so on) and We can connect these event

  • How to define custom compiler for some file type in IntelliJ IDEA? 2011-12-22

    Is it possible to define custom compiler for particular file type in IntelliJ IDEA ? I found how to define custom formatting though. I have bunch of *.proto files in my project. It would be nice if I have define external executable that compiles them

  • How jquery ui disable default events and define custome events? 2012-01-01

    How jquery ui disable default events and define custom events? (like disable tab click event and define custom tabselect event) Where can i read about that deeply? Can you give places in jquery ui code that it happen Can you give simple example to ex

  • Defining custom permissions android 2012-02-16

    What would be the best strategy to define custom (application specific) permissions in Android? I have an application of which part of it is accessible without requiring a login. But part of the application functionality is to be restricted to users

  • Where to define custom schema using RailwayJS 2012-04-05

    The docs simply say "or define custom schema (non-juggling), for example, mongoose. Please note, in case of custom schema all jugglingdb features of course will be disabled." However.. Where exactly should this schema be created? --------------Soluti

  • Custom ListView defined in XML (so without a programatically defined custom adapter) 2012-04-16

    The main menu of my app is a list of items that has a very specific look. It has a custom divider and every list element has a custom colour and height. To achieve this is have built a custom ArrayAdapter, but I wonder whether this is really necessar

  • Mobile BCM user defined (customer) fields. 2012-09-23

    In my desktop Outlook 2007 with BCM, my contacts have 9 standard fields and 12 user-defined (customer) fields. When trying to synchronize in Windows Mobile 6.1 on a HTC Touch device, no user - defined field is synchronized (and only 7 of the 9 standa

  • Defining custom GNU make functions 2011-06-29

    What is the problem with the dep2 function in the sample code below? dep1 = $(eval makefile_list_$1 := $(MAKEFILE_LIST))$(eval -include $1.mk)$(eval MAKEFILE_LIST := $(makefile_list_$1)) define dep2 $(eval makefile_list_$1 := $(MAKEFILE_LIST)) $(eval

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.168 (s). 11 q(s)