Created
November 9, 2012 19:52
-
-
Save ngbrown/4047820 to your computer and use it in GitHub Desktop.
It would be nice if SpecFlow accepted custom attributes based off of StepDefinitionBaseAttribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StepDefinitions | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using TechTalk.SpecFlow; | |
using TechTalk.SpecFlow.Assist; | |
using TechTalk.SpecFlow.Bindings; | |
/// <summary> | |
/// Specifies a step definition primarily for 'When' steps that matches for the provided regular expression, but allows re-use in 'Given' steps as well. | |
/// </summary> | |
public class WhenGivenAttribute : StepDefinitionBaseAttribute | |
{ | |
public WhenGivenAttribute() | |
: this(null) | |
{ | |
} | |
public WhenGivenAttribute(string regex) | |
: base(regex, new[] { StepDefinitionType.Given, StepDefinitionType.When }) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment