Skip to content

Instantly share code, notes, and snippets.

@LSTANCZYK
Forked from ngbrown/WhenGivenAttribute.cs
Last active August 29, 2015 14:07
Show Gist options
  • Save LSTANCZYK/ccf9010eda87e1e2ecfa to your computer and use it in GitHub Desktop.
Save LSTANCZYK/ccf9010eda87e1e2ecfa to your computer and use it in GitHub Desktop.
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