forked from samholder/SpecFlow.NCrunch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNCrunchAttributeProviderBase.cs
29 lines (25 loc) · 1.04 KB
/
NCrunchAttributeProviderBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.CodeDom;
using TechTalk.SpecFlow.Utils;
namespace NCrunch.Generator.SpecflowPlugin
{
/// <summary>
/// Base class for all attribute providers that will be used to provide the NCrunch attributes to decorate the specflow
/// generated tests
/// </summary>
internal abstract class NCrunchAttributeProviderBase : INCrunchAttributeProvider
{
public CodeAttributeDeclaration ProvideAttribute(CodeDomHelper codeDomHelper, CodeMemberMethod method,
string nCrunchAttributeIdentifier,
string nCrunchAttributeParameters)
{
if (nCrunchAttributeIdentifier == AttributeName())
{
return InternalProvideAttribute(codeDomHelper, method, nCrunchAttributeParameters);
}
return null;
}
protected abstract CodeAttributeDeclaration InternalProvideAttribute(CodeDomHelper codeDomHelper,
CodeMemberMethod method, string nCrunchAttributeParameters);
protected abstract string AttributeName();
}
}