From b05cd8e044107db94822fb1ddc74eda685c4d28d Mon Sep 17 00:00:00 2001 From: Josh Keegan Date: Wed, 8 May 2019 10:31:13 +0100 Subject: [PATCH] Make XUnitTestGeneratorProvider consts & method protected & virtual (#1556) * Make XUnitTestGeneratorProvider protected & virtual changes required for retry generator plugin * All private constants to protected in XUnit test generator providers --- .../XUnit2TestGeneratorProvider.cs | 20 +++++++++---------- .../XUnitTestGeneratorProvider.cs | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnit2TestGeneratorProvider.cs b/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnit2TestGeneratorProvider.cs index b17b47820..2ff8206ae 100644 --- a/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnit2TestGeneratorProvider.cs +++ b/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnit2TestGeneratorProvider.cs @@ -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) diff --git a/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnitTestGeneratorProvider.cs b/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnitTestGeneratorProvider.cs index 8652dcbab..e9661f870 100644 --- a/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnitTestGeneratorProvider.cs +++ b/TechTalk.SpecFlow.Generator/UnitTestProvider/XUnitTestGeneratorProvider.cs @@ -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; @@ -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 scenarioCategories) + public virtual void SetTestMethodCategories(TestClassGenerationContext generationContext, CodeMemberMethod testMethod, IEnumerable scenarioCategories) { foreach (string str in scenarioCategories) SetProperty((CodeTypeMember)testMethod, "Category", str);