title: Replace ScenarioContext.Current in non binding class using context injection
body: <p>I want to use context injection to remove the obsolete warnings for <code>FeatureContext.Current</code> and <code>ScenarioContext.Current</code> my code.</p>
  
  <p>I have a reporter in a non binding class that requires setup before the test is run. </p>
  
  <p>I have tried making a constructor and instantiating it but the values always return as Null. </p>
  
  <p>In the Setup Step </p>
  
  <pre><code>namespace EclipseWebAutomationV2.Steps
  {
      [Binding]
      class StepSetup
      {
  
          public static FeatureContext _featurecontext;
          public static ScenarioContext _scenariocontext;
  
  
          [BeforeTestRun]
          public static void InitializeReport()
          {
              Reporter.ReportInit();
          }
  
          [BeforeFeature]
          public static void BeforeFeature()
          {
              Reporter bfeature = new Reporter(_featurecontext, _scenariocontext);
              bfeature.ReportFeature();
          }
      }
  }
  </code></pre>
  
  <p>In the report class:</p>
  
  <pre><code>namespace EclipseWebAutomationV2.Configurations
  {
      class Reporter
      {
  
  
  
          private readonly FeatureContext _featurecontext;
          private readonly ScenarioContext _scenariocontext;
          public Reporter(FeatureContext _featurecontext, ScenarioContext _scenariocontext)
          {
              this._featurecontext = _featurecontext;
              this._scenariocontext = _scenariocontext;
          }
  
          public static void ReportInit()
          {
              //does stuff
          }
  
  
          public void ReportFeature()
          {
              featureName = extent.CreateTest&lt;Feature&gt;(_featurecontext.FeatureInfo.Title);
          }
      }
  }
  </code></pre>
  
  <p>_featurecontext always returns null. I was hoping for it to get the current feature context so i can use it to get the title and use it in other parts of the reporting class.</p>
  
  <p>I am having the same issue with _scenariocontext.</p>