SubMain - CodeIt.Right The First Time!

/Community

A Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials Downloads
Welcome to SubMain Community Sign in | Join | Help

Feature request: Support for "Sentences" in names

Last post 02-24-2010, 2:58 AM by richtea. 1 replies.
Sort Posts: Previous Next
  •  12-02-2009, 11:29 AM 1000

    Feature request: Support for "Sentences" in names

    Hi,

     

    I like to write my unit test names in the format:

    <Subject>_<Scenario>_<ExpectedResult>()

    Which gives me test names such as:

    StringParser_GivenAnEmptyString_ReturnsNull()  

     Which I believe is quite a common pattern to use.  However GhostDoc doesn't make a very good job of these, because it doesn't understand the significance of the underscores (_).  I'd like to be able to write a rule that will produce the following summary for the above:

    Tests that String Parser when given an empty string returns null.

    Or something similar. 

     2 possible suggestions I can think of to solve this:

    (a) Treat underscore to a sentence seperator, so I can use something like  $(MethodName.Sentence[0].All) in the template text.

    (b) When using regex for matching, allow the match to be referred to in the template text. e.g. if (.*)_(.*)_(.*) is the regex then I can use $(MethodName.Group[0].All) in the template text.

     

    (a) seems simpler to use, but (b) is much more powerful.

     

    Thanks

     

    Andy 

     

    Filed under: ,
  •  02-24-2010, 2:58 AM 1124 in reply to 1000

    Re: Feature request: Support for "Sentences" in names

    Another vote for supporting test method sentences in some way. I often have the problem of a test called e.g. "FunctionThrowsWhenNullSupplied" becoming "Functions the throws when null supplied."

    Would it be possible to have rules that are triggered by attributes, so that a [Test] attribute would cause a different rule to fire?

View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |