protected override string GenerateCode(string inputFileContent)
        {
            var generatorServices = new VsGeneratorServices(CurrentProject);

            using (var testGenerator = generatorServices.CreateTestGenerator())
            {
                string projectFolder = VsxHelper.GetProjectFolder(CurrentProject);
                var fullPath = Path.GetFullPath(Path.Combine(projectFolder, CodeFilePath));
                FeatureFileInput featureFileInput =
                    new FeatureFileInput(FileSystemHelper.GetRelativePath(fullPath, projectFolder))
                        {
                            FeatureFileContent = inputFileContent
                        };
                generationResult = testGenerator.GenerateTestFile(featureFileInput, new GenerationSettings());
                if (!generationResult.Success)
                    return null;

                return generationResult.GeneratedTestCode;
            }
        }
        protected override string GenerateCode(string inputFileContent)
        {
            IVisualStudioTracer tracer = VsxHelper.ResolveMefDependency<IVisualStudioTracer>(ServiceProvider.GlobalProvider);
            var generatorServices = new VsGeneratorServices(CurrentProject, new VsSpecFlowConfigurationReader(CurrentProject, tracer), tracer);

            using (var testGenerator = generatorServices.CreateTestGenerator())
            {
                string projectFolder = VsxHelper.GetProjectFolder(CurrentProject);
                var fullPath = Path.GetFullPath(Path.Combine(projectFolder, CodeFilePath));
                FeatureFileInput featureFileInput =
                    new FeatureFileInput(FileSystemHelper.GetRelativePath(fullPath, projectFolder))
                        {
                            FeatureFileContent = inputFileContent
                        };
                generationResult = testGenerator.GenerateTestFile(featureFileInput, new GenerationSettings());
                if (!generationResult.Success)
                    return null;

                return generationResult.GeneratedTestCode;
            }
        }
Esempio n. 3
0
        internal VsProjectScope(Project project, DteWithEvents dteWithEvents, GherkinFileEditorClassifications classifications, IVisualStudioTracer tracer, IIntegrationOptionsProvider integrationOptionsProvider)
        {
            Classifications = classifications;
            this.project = project;
            this.dteWithEvents = dteWithEvents;
            this.tracer = tracer;
            this.integrationOptionsProvider = integrationOptionsProvider;

            var integrationOptions = integrationOptionsProvider.GetOptions();

            parser = new GherkinTextBufferParser(this, tracer);
//TODO: enable when analizer is implemented
//            if (integrationOptions.EnableAnalysis)
//                analyzer = new GherkinScopeAnalyzer(this, visualStudioTracer);

            GherkinProcessingScheduler = new GherkinProcessingScheduler(tracer, integrationOptions.EnableAnalysis);

            GeneratorServices = new VsGeneratorServices(project, new VsSpecFlowConfigurationReader(project, tracer), tracer);
        }
Esempio n. 4
0
        internal VsProjectScope(Project project, DteWithEvents dteWithEvents, GherkinFileEditorClassifications classifications, IVisualStudioTracer visualStudioTracer, IIntegrationOptionsProvider integrationOptionsProvider, IBindingSkeletonProviderFactory bindingSkeletonProviderFactory)
        {
            Classifications = classifications;
            this.project = project;
            this.dteWithEvents = dteWithEvents;
            this.visualStudioTracer = visualStudioTracer;
            this.integrationOptionsProvider = integrationOptionsProvider;
            this.bindingSkeletonProviderFactory = bindingSkeletonProviderFactory;

            var integrationOptions = integrationOptionsProvider.GetOptions();

            parser = new GherkinTextBufferParser(this, visualStudioTracer);
//TODO: enable when analizer is implemented
//            if (integrationOptions.EnableAnalysis)
//                analyzer = new GherkinScopeAnalyzer(this, visualStudioTracer);

            GherkinProcessingScheduler = new GherkinProcessingScheduler(visualStudioTracer, integrationOptions.EnableAnalysis);

            GeneratorServices = new VsGeneratorServices(project);
        }