public CodeFunction FindCodeFunction(VsProjectScope projectScope, IBindingMethod bindingMethod)
        {
            var project = projectScope.Project;

            var function = FindCodeFunction(project, bindingMethod);
            if (function != null)
                return function;

            var specFlowProject = projectScope.SpecFlowProjectConfiguration;
            if (specFlowProject != null)
            {
                foreach (var assemblyName in specFlowProject.RuntimeConfiguration.AdditionalStepAssemblies)
                {
                    string simpleName = assemblyName.Split(new[] { ',' }, 2)[0];

                    var stepProject = VsxHelper.FindProjectByAssemblyName(project.DTE, simpleName);
                    if (stepProject != null)
                    {
                        function = FindCodeFunction(stepProject, bindingMethod);
                        if (function != null)
                            return function;
                    }
                }
            }

            return null;
        }
        public IProjectScope GetProjectScope(Project project)
        {
            if (project == null || !VsProjectScope.IsProjectSupported(project))
            {
                return(noProjectScopeReference.Value);
            }

            return(projectScopeCache.GetOrCreate(project));
        }
예제 #3
0
        protected ProjectFilesTracker(VsProjectScope vsProjectScope)
        {
            if (vsProjectScope.GherkinProcessingScheduler == null)
            {
                throw new ArgumentException("GherkinProcessingScheduler is null", "vsProjectScope");
            }

            this.vsProjectScope = vsProjectScope;
            this.IsStepMapDirty = true;
        }
예제 #4
0
        public BindingAssemblyInfo(string assemblyName, Project mainProject)
        {
            AssemblyName = assemblyName;
            Project      = VsxHelper.FindProjectByAssemblyName(mainProject.DTE, AssemblyShortName);

            if (Project != null && VsProjectScope.GetTargetLanguage(Project) == ProgrammingLanguage.FSharp) //HACK: we force the f# libs to be used as assembly reference
            {
                Project = null;
            }

            if (Project == null)
            {
                Reference = VsxHelper.GetReference(mainProject, assemblyName);
            }
        }
 private IEnumerable<string> CollectPaths(VsProjectScope projectScope, ProjectItem projectItem)
 {
     var testPath = GetPath(projectScope, projectItem);
     if (testPath != null)
     {
         yield return testPath;
     }
     else
     {
         foreach (var subItemPath in VsxHelper.GetAllSubProjectItem(projectItem).Select(pi => GetPath(projectScope, pi)).Where(p => p != null))
         {
             yield return subItemPath;
         }
     }
 }
예제 #6
0
 public ProjectFeatureFilesTracker(VsProjectScope vsProjectScope) : base(vsProjectScope)
 {
     _filesTracker = CreateFilesTracker(this.vsProjectScope.Project, @"\.feature$");
     _testGeneratorForCodeBehindVersionDetection = new Lazy <ITestGenerator>(() => vsProjectScope.GeneratorServices.CreateTestGenerator(), true);
 }
예제 #7
0
 public BindingFilesTracker(VsProjectScope vsProjectScope) : base(vsProjectScope)
 {
     stepSuggestionBindingCollector = new VsBindingRegistryBuilder(vsProjectScope.Tracer);
 }
 public VsStepSuggestionProvider(VsProjectScope vsProjectScope)
     : base(VsSuggestionItemFactory.Instance, vsProjectScope)
 {
     this.vsProjectScope = vsProjectScope;
 }
 private string GetPath(VsProjectScope projectScope, ProjectItem projectItem)
 {
     var projectRelativePath = VsxHelper.GetProjectRelativePath(projectItem);
     if (projectRelativePath != null && projectRelativePath.EndsWith(".feature", StringComparison.InvariantCultureIgnoreCase))
     {
         var featureFileInfo = projectScope.FeatureFilesTracker.Files.FirstOrDefault(ffi => ffi.ProjectRelativePath == projectRelativePath);
         if (featureFileInfo == null)
         {
             tracer.Trace("Feature file info not found.", GetType().Name);
         }
         else if (featureFileInfo.ParsedFeature == null)
         {
             tracer.Trace("Feature file is not yet analyzed.", GetType().Name);
         }
         else
         {
             string path = string.Format("testpath:Feature:{0}", Escape(featureFileInfo.ParsedFeature.Title));
             return path;
         }
     }
     return null;
 }