Beispiel #1
0
        private static UnitTestFeatureGeneratorProvider CreateUnitTestFeatureGeneratorProvider()
        {
            GeneratorConfiguration   generatorConfiguration   = new GeneratorConfiguration();
            CodeDomHelper            codeDomHelper            = new CodeDomHelper(CodeDomProviderLanguage.CSharp);
            UnitTestFeatureGenerator unitTestFeatureGenerator = new UnitTestFeatureGenerator(
                new NUnitTestGeneratorProvider(codeDomHelper), codeDomHelper, generatorConfiguration, new DecoratorRegistryStub());

            return(new UnitTestFeatureGeneratorProvider(unitTestFeatureGenerator));
        }
        private static UnitTestFeatureGeneratorProvider CreateUnitTestFeatureGeneratorProvider()
        {
            Configuration.SpecFlowConfiguration generatorSpecFlowConfiguration = ConfigurationLoader.GetDefault();
            CodeDomHelper            codeDomHelper            = new CodeDomHelper(CodeDomProviderLanguage.CSharp);
            UnitTestFeatureGenerator unitTestFeatureGenerator = new UnitTestFeatureGenerator(
                new NUnit3TestGeneratorProvider(codeDomHelper), codeDomHelper, generatorSpecFlowConfiguration, new DecoratorRegistryStub());

            return(new UnitTestFeatureGeneratorProvider(unitTestFeatureGenerator));
        }
        private static UnitTestFeatureGeneratorProvider CreateUnitTestFeatureGeneratorProvider()
        {
            GeneratorConfiguration generatorConfiguration = new GeneratorConfiguration();
            CodeDomHelper codeDomHelper = new CodeDomHelper(CodeDomProviderLanguage.CSharp);
            UnitTestFeatureGenerator unitTestFeatureGenerator = new UnitTestFeatureGenerator(
                new NUnitTestGeneratorProvider(codeDomHelper), codeDomHelper, generatorConfiguration, new DecoratorRegistryStub());

            return new UnitTestFeatureGeneratorProvider(unitTestFeatureGenerator);
        }
Beispiel #4
0
        protected TestGenerator CreateTestGenerator(ProjectSettings projectSettings)
        {
            Configuration.SpecFlowConfiguration generatorSpecFlowConfiguration = ConfigurationLoader.GetDefault();
            CodeDomHelper            codeDomHelper            = new CodeDomHelper(CodeDomProviderLanguage.CSharp);
            UnitTestFeatureGenerator unitTestFeatureGenerator = new UnitTestFeatureGenerator(new NUnitTestGeneratorProvider(codeDomHelper), codeDomHelper, generatorSpecFlowConfiguration, new DecoratorRegistryStub());

            var generatorRegistryStub = new Mock <IFeatureGeneratorRegistry>();

            generatorRegistryStub.Setup(r => r.CreateGenerator(It.IsAny <SpecFlowDocument>())).Returns(unitTestFeatureGenerator);

            return(new TestGenerator(generatorSpecFlowConfiguration, projectSettings, TestHeaderWriterStub.Object, TestUpToDateCheckerStub.Object, generatorRegistryStub.Object, codeDomHelper));
        }
 public SharedBackgroundFeatureGenerator(
     IUnitTestGeneratorProvider testGeneratorProvider,
     CodeDomHelper codeDomHelper,
     SpecFlowConfiguration generatorConfiguration,
     IDecoratorRegistry decoratorRegistry,
     ProjectSettings projectSettings,
     IGherkinParserFactory gherkinParserFactory)
 {
     _generatorConfiguration   = generatorConfiguration;
     _projectSettings          = projectSettings;
     _gherkinParserFactory     = gherkinParserFactory;
     _unitTestFeatureGenerator = new UnitTestFeatureGenerator(testGeneratorProvider, codeDomHelper, generatorConfiguration, decoratorRegistry);
 }
 public UnitTestFeatureGeneratorProvider(UnitTestFeatureGenerator unitTestFeatureGenerator)
 {
     this.unitTestFeatureGenerator = unitTestFeatureGenerator;
 }
        protected TestGenerator CreateTestGenerator(ProjectSettings projectSettings)
        {
            GeneratorConfiguration generatorConfiguration = new GeneratorConfiguration();
            CodeDomHelper codeDomHelper = new CodeDomHelper(CodeDomProviderLanguage.CSharp);
            UnitTestFeatureGenerator unitTestFeatureGenerator = new UnitTestFeatureGenerator(new NUnitTestGeneratorProvider(codeDomHelper), codeDomHelper, generatorConfiguration, new DecoratorRegistryStub());

            var generatorRegistryStub = new Mock<IFeatureGeneratorRegistry>();
            generatorRegistryStub.Setup(r => r.CreateGenerator(It.IsAny<SpecFlowDocument>())).Returns(unitTestFeatureGenerator);

            return new TestGenerator(generatorConfiguration, projectSettings, TestHeaderWriterStub.Object, TestUpToDateCheckerStub.Object, generatorRegistryStub.Object, codeDomHelper);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LiveTestFeatureGeneratorProvider" /> class.
 /// </summary>
 /// <param name="baseFeatureGenerator">The feature generator.</param>
 public LiveTestFeatureGeneratorProvider(UnitTestFeatureGenerator baseFeatureGenerator)
 {
     this.baseFeatureGenerator = baseFeatureGenerator;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LiveTestFeatureGeneratorProvider" /> class.
 /// </summary>
 /// <param name="baseFeatureGenerator">The feature generator.</param>
 public LiveTestFeatureGeneratorProvider(UnitTestFeatureGenerator baseFeatureGenerator)
 {
   this.baseFeatureGenerator = baseFeatureGenerator;
 }
 public UnitTestFeatureGeneratorProvider(UnitTestFeatureGenerator unitTestFeatureGenerator)
 {
     this.unitTestFeatureGenerator = unitTestFeatureGenerator;
 }