protected override FeatureFileInput CreateFeatureFileInput(FeatureFileInput featureFile, ITestGenerator generator, SpecFlowProject specFlowProject)
        {
            var featureFileInput = base.CreateFeatureFileInput(featureFile, generator, specFlowProject);

            outputFile = task.PrepareOutputFile(generator.GetTestFullPath(featureFileInput));
            featureFileInput.GeneratedTestProjectRelativePath =
                FileSystemHelper.GetRelativePath(outputFile.FilePathForWriting, specFlowProject.ProjectSettings.ProjectFolder);
            return(featureFileInput);
        }
예제 #2
0
        protected override FeatureFileInput CreateFeatureFileInput(FeatureFileInput featureFile, ITestGenerator generator, SpecFlowProject specFlowProject)
        {
            var featureFileInput = base.CreateFeatureFileInput(featureFile, generator, specFlowProject);

            outputFile = task.PrepareOutputFile(generator.GetTestFullPath(featureFileInput));
            featureFileInput.GeneratedTestProjectRelativePath =
                FileSystemHelper.GetRelativePath(outputFile.FilePathForWriting, specFlowProject.ProjectSettings.ProjectFolder);
            return featureFileInput;
        }
        public TestFileGeneratorResult GenerateCodeBehindFile(string featureFile)
        {
            var featureFileInput         = new FeatureFileInput(featureFile);
            var generatedFeatureFileName = Path.GetFileName(_testGenerator.GetTestFullPath(featureFileInput));

            var testGeneratorResult = _testGenerator.GenerateTestFile(featureFileInput, new GenerationSettings());

            return(new TestFileGeneratorResult(testGeneratorResult, generatedFeatureFileName));
        }
예제 #4
0
        public GeneratedCodeBehindFile GenerateCodeBehindFile(string featureFile)
        {
            var featureFileInput         = new FeatureFileInput(featureFile);
            var generatedFeatureFileName = Path.GetFileName(_testGenerator.GetTestFullPath(featureFileInput));

            var testGeneratorResult = _testGenerator.GenerateTestFile(featureFileInput, new GenerationSettings());

            string outputFileContent;

            if (testGeneratorResult.Success)
            {
                outputFileContent = testGeneratorResult.GeneratedTestCode;
            }
            else
            {
                outputFileContent = GenerateError(testGeneratorResult, _codeDomHelper);
            }

            return(new GeneratedCodeBehindFile()
            {
                Filename = generatedFeatureFileName,
                Content = outputFileContent
            });
        }
예제 #5
0
 public string GetTestFullPath(FeatureFileInput featureFileInput)
 {
     return(innerGenerator.GetTestFullPath(featureFileInput));
 }