Ejemplo n.º 1
0
 public void SetupTestClass()
 {
     GenerationContext.TestClass.IsPartial       = true;
     GenerationContext.TestClass.TypeAttributes |= TypeAttributes.Public;
     _codeDomHelper.AddLinePragmaInitial(GenerationContext.TestClass, GenerationContext.Document.SourceFilePath, _specFlowConfiguration);
     _testGeneratorProvider.SetTestClass(GenerationContext, GenerationContext.Feature.Name, GenerationContext.Feature.Description);
     _decoratorRegistry.DecorateTestClass(GenerationContext, out List <string> unprocessedTags);
     if (!unprocessedTags.Any())
     {
         return;
     }
     _testGeneratorProvider.SetTestClassCategories(GenerationContext, unprocessedTags);
 }
Ejemplo n.º 2
0
        private void SetupTestClass(TestClassGenerationContext generationContext)
        {
            generationContext.TestClass.IsPartial       = true;
            generationContext.TestClass.TypeAttributes |= TypeAttributes.Public;

            AddLinePragmaInitial(generationContext.TestClass, generationContext.Document.SourceFilePath);

            _testGeneratorProvider.SetTestClass(generationContext, generationContext.Feature.Name, generationContext.Feature.Description);

            _decoratorRegistry.DecorateTestClass(generationContext, out var featureCategories);

            if (featureCategories.Any())
            {
                _testGeneratorProvider.SetTestClassCategories(generationContext, featureCategories);
            }
        }
        private void SetupTestClass(TestClassGenerationContext generationContext)
        {
            generationContext.TestClass.IsPartial       = true;
            generationContext.TestClass.TypeAttributes |= TypeAttributes.Public;

            //  AddLinePragmaInitial(generationContext.TestClass, generationContext.Feature.SourceFile);

            testGeneratorProvider.SetTestClass(generationContext, generationContext.Feature.Title, generationContext.Feature.Description);

            List <string> featureCategories;

            decoratorRegistry.DecorateTestClass(generationContext, out featureCategories);

            if (featureCategories.Any())
            {
                testGeneratorProvider.SetTestClassCategories(generationContext, featureCategories);
            }

            DeclareTestRunnerMember(generationContext);
        }
Ejemplo n.º 4
0
        private void SetupTestClass(TestClassGenerationContext generationContext)
        {
            generationContext.TestClass.IsPartial       = true;
            generationContext.TestClass.TypeAttributes |= TypeAttributes.Public;

            _linePragmaHandler.AddLinePragmaInitial(generationContext.TestClass, generationContext.Document.SourceFilePath);

            _testGeneratorProvider.SetTestClass(generationContext, generationContext.Feature.Name, generationContext.Feature.Description);

            _decoratorRegistry.DecorateTestClass(generationContext, out var featureCategories);

            if (featureCategories.Any())
            {
                _testGeneratorProvider.SetTestClassCategories(generationContext, featureCategories);
            }

            var featureTagsField = new CodeMemberField(typeof(string[]), "_featureTags");

            featureTagsField.InitExpression = _scenarioPartHelper.GetStringArrayExpression(generationContext.Feature.Tags);

            generationContext.TestClass.Members.Add(featureTagsField);
        }