Extract parts of $(MethodName.ActualName) in a custom rule
Question asked by Serge ARADJ - March 26 at 6:45 AM
Answered
Hi,

I am trying to create custom rules to be triggered when documenting Unit test cases.
One of them is as follows :

public async Task Add_CallRouteWithTemplate_ShouldReturnTemplateViewModel()
My goal is to make GhostDoc generate something the closest to :
/// <summary>
///     Calling the <see cref="Add"/> route [with template] should return a <see cref="TemplateViewModel"/>.
/// </summary>
I can easily match the method name using a regex like the following :
(?<route>.*)_CallRoute(?<condition>.*)_ShouldReturn(?<returntype>.*)
But now, how can I extract the different named groups to generate the appropriate comment ? I tried looking in the Dictionary as well, to override the summary with the above regular expression but it seems that only
<pattern>
 is a recognized name for a group.

Best regards.

3 Replies

Reply to Thread
0
Misha Zhutov Replied
Employee Post
Hi Serge, 

Are you using GhostDoc Community version or GhostDoc Pro?
0
Serge ARADJ Replied
Hi,

I am still using the Community version so far, is this something I can do without going Pro ?
0
Misha Zhutov Replied
Employee Post Marked As Answer
Hi Serge, 
The Pro version uses T4 templates for generating XML documentation for each member type and the templates are highly customizable. 

Reply to Thread