title: How to programmatically ignore some acceptance tests using TechTalk.SpecFlow and C#?
body: <p>I have several feature files with some scenarios. I need to ignore several scenarios, or features, marked with some <code>@tag</code> depending on some condition. I have read <a href="https://github.com/techtalk/SpecFlow/wiki/Documentation" rel="noreferrer">specflow documentation</a> but didn't find there something that can be useful for my solution. I want to use something like</p>
  
  <pre><code>[BeforeScenario("sometag")]
  public static void BeforeScenario()
  {
      if(IgnoreTests)
      {
         // This is the hot spot
         Scenario.DoSomethingToIgnoreScenarioIfConditionButRunScenarioIfConditionFalse();
      }        
  }
  </code></pre>
  
  <p>Also I tried dynamically add or remove tags</p>
  
  <pre><code>[BeforeScenario("sometag")]
  public static void BeforeScenario()
  {
      if(IgnoreTests)
      {
         ScenarioContext.Current.ScenarioInfo.Tags.ToList().Add("ignore");
      }        
  }
  </code></pre>
  
  <p>but it didn't work. Maybe is there some other way to dynamically add or remove tags? Or some methods in <code>ScenarioContext</code> class which will ignore current scenario?</p>