Exemplo n.º 1
0
        protected override void DoExecute()
        {
            if (DebugTask)
            {
                System.Diagnostics.Debugger.Launch();
            }

            ITraceListener traceListener = VerboseOutput ? (ITraceListener) new TextWriterTraceListener(GetMessageWriter(MessageImportance.High), "SpecFlow: ") : new NullListener();

            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            BatchGenerator batchGenerator = new MsBuildBatchGenerator(traceListener, new TestGeneratorFactory(), this);

            batchGenerator.OnError +=
                delegate(FeatureFileInput featureFileInput, TestGeneratorResult result)
            {
                foreach (var testGenerationError in result.Errors)
                {
                    RecordError(testGenerationError.Message,
                                featureFileInput.GetFullPath(specFlowProject.ProjectSettings), testGenerationError.Line, testGenerationError.LinePosition);
                }
            };
            batchGenerator.OnSuccess +=
                (featureFileInput, result) => generatedFiles.Add(
                    new TaskItem(featureFileInput.GetGeneratedTestFullPath(specFlowProject.ProjectSettings)));

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
Exemplo n.º 2
0
        protected override void DoExecute()
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            BatchGenerator batchGenerator = new MsBuildBatchGenerator(
                GetMessageWriter(MessageImportance.High), VerboseOutput, this);
            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
Exemplo n.º 3
0
        protected override void DoExecute()
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            BatchGenerator batchGenerator = new MsBuildBatchGenerator(
                GetMessageWriter(MessageImportance.High), VerboseOutput, this);

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
Exemplo n.º 4
0
        protected override void DoExecute()
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            ITraceListener traceListener  = VerboseOutput ? (ITraceListener) new TextWriterTraceListener(GetMessageWriter(MessageImportance.High), "SpecFlow: ") : new NullListener();
            BatchGenerator batchGenerator = new MsBuildBatchGenerator(traceListener, new TestGeneratorFactory(), this);

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
Exemplo n.º 5
0
        protected override void DoExecute()
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            ITraceListener traceListener = VerboseOutput ? (ITraceListener)new TextWriterTraceListener(GetMessageWriter(MessageImportance.High), "SpecFlow: ") : new NullListener();
            BatchGenerator batchGenerator = new MsBuildBatchGenerator(traceListener, new TestGeneratorFactory(), this);
            batchGenerator.OnError +=
                delegate(FeatureFileInput featureFileInput, TestGeneratorResult result)
                    {
                        foreach (var testGenerationError in result.Errors)
                        {
                            RecordError(testGenerationError.Message, 
                                featureFileInput.GetFullPath(specFlowProject.ProjectSettings), testGenerationError.Line, testGenerationError.LinePosition);
                        }
                    };
            batchGenerator.OnSuccess +=
                (featureFileInput, result) => generatedFiles.Add(
                    new TaskItem(featureFileInput.GetGeneratedTestFullPath(specFlowProject.ProjectSettings)));

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }