Skip to content

Commit

Permalink
Make XUnitTestGeneratorProvider consts & method protected & virtual (#…
Browse files Browse the repository at this point in the history
…1556)

* Make XUnitTestGeneratorProvider protected & virtual changes required for retry generator plugin

* All private constants to protected in XUnit test generator providers
  • Loading branch information
JoshKeegan authored and SabotageAndi committed May 8, 2019
1 parent 01d8c62 commit b05cd8e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Expand Up @@ -11,16 +11,16 @@ namespace TechTalk.SpecFlow.Generator.UnitTestProvider
{
public class XUnit2TestGeneratorProvider : XUnitTestGeneratorProvider
{
private new const string THEORY_ATTRIBUTE = "Xunit.TheoryAttribute";
private const string INLINEDATA_ATTRIBUTE = "Xunit.InlineDataAttribute";
private const string ICLASSFIXTURE_INTERFACE = "Xunit.IClassFixture";
private const string COLLECTION_ATTRIBUTE = "Xunit.CollectionAttribute";
private const string OUTPUT_INTERFACE = "Xunit.Abstractions.ITestOutputHelper";
private const string OUTPUT_INTERFACE_PARAMETER_NAME = "testOutputHelper";
private const string OUTPUT_INTERFACE_FIELD_NAME = "_testOutputHelper";
private const string FIXTUREDATA_PARAMETER_NAME = "fixtureData";
private const string COLLECTION_DEF = "Xunit.Collection";
private const string COLLECTION_TAG = "xunit:collection";
protected new const string THEORY_ATTRIBUTE = "Xunit.TheoryAttribute";
protected new const string INLINEDATA_ATTRIBUTE = "Xunit.InlineDataAttribute";
protected const string ICLASSFIXTURE_INTERFACE = "Xunit.IClassFixture";
protected const string COLLECTION_ATTRIBUTE = "Xunit.CollectionAttribute";
protected const string OUTPUT_INTERFACE = "Xunit.Abstractions.ITestOutputHelper";
protected const string OUTPUT_INTERFACE_PARAMETER_NAME = "testOutputHelper";
protected const string OUTPUT_INTERFACE_FIELD_NAME = "_testOutputHelper";
protected const string FIXTUREDATA_PARAMETER_NAME = "fixtureData";
protected const string COLLECTION_DEF = "Xunit.Collection";
protected const string COLLECTION_TAG = "xunit:collection";

public XUnit2TestGeneratorProvider(CodeDomHelper codeDomHelper)
:base(codeDomHelper)
Expand Down
Expand Up @@ -10,17 +10,17 @@ namespace TechTalk.SpecFlow.Generator.UnitTestProvider
public class XUnitTestGeneratorProvider : IUnitTestGeneratorProvider
{
protected const string FEATURE_TITLE_PROPERTY_NAME = "FeatureTitle";
private const string DESCRIPTION_PROPERTY_NAME = "Description";
protected const string DESCRIPTION_PROPERTY_NAME = "Description";
protected const string FACT_ATTRIBUTE = "Xunit.FactAttribute";
protected const string FACT_ATTRIBUTE_SKIP_PROPERTY_NAME = "Skip";
internal const string THEORY_ATTRIBUTE = "Xunit.Extensions.TheoryAttribute";
internal const string THEORY_ATTRIBUTE_SKIP_PROPERTY_NAME = "Skip";
private const string INLINEDATA_ATTRIBUTE = "Xunit.Extensions.InlineDataAttribute";
internal const string SKIP_REASON = "Ignored";
private const string TRAIT_ATTRIBUTE = "Xunit.TraitAttribute";
private const string IUSEFIXTURE_INTERFACE = "Xunit.IUseFixture";
private const string CATEGORY_PROPERTY_NAME = "Category";
private const string IGNORE_TAG = "@Ignore";
protected internal const string THEORY_ATTRIBUTE = "Xunit.Extensions.TheoryAttribute";
protected internal const string THEORY_ATTRIBUTE_SKIP_PROPERTY_NAME = "Skip";
protected const string INLINEDATA_ATTRIBUTE = "Xunit.Extensions.InlineDataAttribute";
protected internal const string SKIP_REASON = "Ignored";
protected const string TRAIT_ATTRIBUTE = "Xunit.TraitAttribute";
protected const string IUSEFIXTURE_INTERFACE = "Xunit.IUseFixture";
protected const string CATEGORY_PROPERTY_NAME = "Category";
protected const string IGNORE_TAG = "@Ignore";

private CodeTypeDeclaration _currentFixtureDataTypeDeclaration = null;

Expand Down Expand Up @@ -139,7 +139,7 @@ public virtual void SetRow(TestClassGenerationContext generationContext, CodeMem
CodeDomHelper.AddAttribute(testMethod, INLINEDATA_ATTRIBUTE, args.ToArray());
}

public void SetTestMethodCategories(TestClassGenerationContext generationContext, CodeMemberMethod testMethod, IEnumerable<string> scenarioCategories)
public virtual void SetTestMethodCategories(TestClassGenerationContext generationContext, CodeMemberMethod testMethod, IEnumerable<string> scenarioCategories)
{
foreach (string str in scenarioCategories)
SetProperty((CodeTypeMember)testMethod, "Category", str);
Expand Down

0 comments on commit b05cd8e

Please sign in to comment.