private string getFromSpecFlowFeature()
 {
     try
     {
         var feature = _application.ActiveDocument.FullName;
         var items = _application.ActiveDocument.ProjectItem.ProjectItems;
         ProjectItem item = null;
         foreach (object itm in items)
         {
             item = (ProjectItem)itm;
             break;
         }
         var codeBehind = item.Document.FullName;
         var sel = (TextSelection)_application.ActiveDocument.Selection;
         var point = (TextPoint)sel.ActivePoint;
         var match = new SpecFlowFeatureParser(File.ReadAllText(feature), File.ReadAllText(codeBehind)).GetTest(point.Line - 1);
         if (match == null)
             return null;
         return match.Name;
     }
     catch
     {
     }
     return null;
 }
 public void When_given_a_spec_flow_feature_file_using_mstest_it_will_find_closest_scenario()
 {
     var line = 41;
     var parser = new SpecFlowFeatureParser(getFeature("SpecflowMSTestFeatures.txt"), getCodeBehind("SpecflowMSTestCodeBehind.txt"));
     var signature = parser.GetTest(line);
     Assert.That(signature.Name, Is.EqualTo("Nrk.OnDemand.Common.AcceptanceTests.Features.ReceiveVODPatternsFromPRFFeature.CreateANewVODPatternForARadioProgram"));
     Assert.That(signature.Type, Is.EqualTo(SignatureType.Method));
 }
 public void When_given_a_spec_flow_feature_file_and_its_an_empty_line_execute_all_specs_in_file()
 {
     var line = 20;
     var parser = new SpecFlowFeatureParser(getFeature("SpecflowFeature.txt"), getCodeBehind("SpecflowCodeBehind.txt"));
     var signature = parser.GetTest(line);
     Assert.That(signature.Name, Is.EqualTo("Specifications.Features.SMSPaymentsFeature"));
     Assert.That(signature.Type, Is.EqualTo(SignatureType.Class));
 }
 public void When_given_a_spec_flow_feature_file_it_will_find_closest_scenario()
 {
     var line = 28;
     var parser = new SpecFlowFeatureParser(getFeature("SpecflowFeature.txt"), getCodeBehind("SpecflowCodeBehind.txt"));
     var signature = parser.GetTest(line);
     Assert.That(signature.Name, Is.EqualTo("Specifications.Features.SMSPaymentsFeature.SendMoneyFromUnregisteredUser"));
     Assert.That(signature.Type, Is.EqualTo(SignatureType.Method));
 }