protected override void Analyze(FeatureFileInfo featureFileInfo, ProjectItem projectItem) { vsProjectScope.VisualStudioTracer.Trace("Analyzing feature file: " + featureFileInfo.ProjectRelativePath, "ProjectFeatureFilesTracker"); AnalyzeCodeBehind(featureFileInfo, projectItem); var fileContent = VsxHelper.GetFileContent(projectItem, loadLastSaved: true); featureFileInfo.ParsedFeature = ParseGherkinFile(fileContent, featureFileInfo.ProjectRelativePath, vsProjectScope.GherkinDialectServices.DefaultLanguage); }
private void AnalyzeCodeBehind(FeatureFileInfo featureFileInfo, ProjectItem projectItem) { var codeBehindItem = GetCodeBehindItem(projectItem); if (codeBehindItem != null) { string codeBehind = VsxHelper.GetFileContent(codeBehindItem); featureFileInfo.GeneratorVersion = SpecFlowGenerator.GetGeneratedFileSpecFlowVersion(new StringReader(codeBehind)); } }
protected override string GetConfigFileContent() { ProjectItem projectItem = VsxHelper.FindProjectItemByProjectRelativePath(project, "app.config"); if (projectItem == null) { return(null); } return(VsxHelper.GetFileContent(projectItem, true)); }
protected override void Analyze(FeatureFileInfo featureFileInfo, ProjectItem projectItem) { vsProjectScope.Tracer.Trace("Analyzing feature file: " + featureFileInfo.ProjectRelativePath, "ProjectFeatureFilesTracker"); var codeBehindChangeDate = AnalyzeCodeBehind(featureFileInfo, projectItem); var fileContent = VsxHelper.GetFileContent(projectItem, loadLastSaved: true); featureFileInfo.ParsedFeature = ParseGherkinFile(fileContent, featureFileInfo.ProjectRelativePath, vsProjectScope.GherkinDialectServices.DefaultLanguage); var featureLastChangeDate = VsxHelper.GetLastChangeDate(projectItem) ?? DateTime.MinValue; featureFileInfo.LastChangeDate = featureLastChangeDate > codeBehindChangeDate ? featureLastChangeDate : codeBehindChangeDate; }
private DateTime AnalyzeCodeBehind(FeatureFileInfo featureFileInfo, ProjectItem projectItem) { var codeBehindItem = GetCodeBehindItem(projectItem); if (codeBehindItem != null) { string codeBehindContent = VsxHelper.GetFileContent(codeBehindItem); DetectGeneratedTestVersion(featureFileInfo, codeBehindContent); var lastChangeDate = VsxHelper.GetLastChangeDate(codeBehindItem) ?? DateTime.MinValue; return(lastChangeDate); } return(DateTime.MinValue); }
private void AnalyzeCodeBehind(FeatureFileInfo featureFileInfo, ProjectItem projectItem) { var codeBehindItem = GetCodeBehindItem(projectItem); if (codeBehindItem != null) { string codeBehind = VsxHelper.GetFileContent(codeBehindItem); using (var testGenerator = vsProjectScope.GeneratorServices.CreateTestGenerator()) { featureFileInfo.GeneratorVersion = testGenerator.DetectGeneratedTestVersion( new FeatureFileInput(featureFileInfo.ProjectRelativePath) { GeneratedTestFileContent = codeBehind }); } } }