diff --git a/build/Build.cs b/build/Build.cs index 1ad1cb9ad..1310fbbdf 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -17,10 +17,9 @@ using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.NuGet; using Nuke.Common.Utilities.Collections; -using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; -[CheckBuildProjectConfigurations] + [ShutdownDotNetAfterServerBuild] class Build : NukeBuild { @@ -68,13 +67,13 @@ public static int Main() .Before(Test) .Executes(() => { - SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory); - EnsureCleanDirectory(ArtifactsDirectory); - EnsureCleanDirectory(DeployDirectory); - EnsureCleanDirectory(DeployDirectory / "zip"); - EnsureCleanDirectory(DeployDirectory / "nuget"); - EnsureCleanDirectory(OutputDirectory); - EnsureCleanDirectory(DocsOutputDirectory); + //SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(CreateOrCleanDirectory); + ArtifactsDirectory.CreateOrCleanDirectory(); + DeployDirectory.CreateOrCleanDirectory(); + (DeployDirectory / "zip").CreateOrCleanDirectory(); + (DeployDirectory / "nuget").CreateOrCleanDirectory(); + DeployDirectory.CreateOrCleanDirectory(); + DocsOutputDirectory.CreateOrCleanDirectory(); }); Target Test => _ => _ diff --git a/build/_build.csproj b/build/_build.csproj index 99bd19737..262aa0b57 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -1,8 +1,8 @@ - + Exe - net6.0 + net10.0 CS0649;CS0169 .. @@ -12,11 +12,14 @@ - - - - - + + + + + + + + diff --git a/global.json b/global.json deleted file mode 100644 index 9eab5eadd..000000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "6.0.302" - } -} \ No newline at end of file diff --git a/src/Pickles.CommandLine.UnitTests/Pickles.CommandLine.UnitTests.csproj b/src/Pickles.CommandLine.UnitTests/Pickles.CommandLine.UnitTests.csproj index 819734178..01fd1d6a0 100644 --- a/src/Pickles.CommandLine.UnitTests/Pickles.CommandLine.UnitTests.csproj +++ b/src/Pickles.CommandLine.UnitTests/Pickles.CommandLine.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.CommandLine.UnitTests PicklesDoc.Pickles.CommandLine.UnitTests - net6.0 + net10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False @@ -24,9 +24,9 @@ - - - + + + @@ -38,13 +38,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + \ No newline at end of file diff --git a/src/Pickles.CommandLine.UnitTests/WhenParsingCommandLineArguments.cs b/src/Pickles.CommandLine.UnitTests/WhenParsingCommandLineArguments.cs index b7ff462c9..6d37034ee 100644 --- a/src/Pickles.CommandLine.UnitTests/WhenParsingCommandLineArguments.cs +++ b/src/Pickles.CommandLine.UnitTests/WhenParsingCommandLineArguments.cs @@ -165,15 +165,15 @@ public void ThenCanParseLongFormArgumentsSuccessfully() bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null); Check.That(shouldContinue).IsTrue(); - Check.That(configuration.FeatureFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.FromDirectoryName("features").FullName); - Check.That(configuration.OutputFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.FromDirectoryName("features-output").FullName); + Check.That(configuration.FeatureFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.New("features").FullName); + Check.That(configuration.OutputFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.New("features-output").FullName); } [Test] public void ThenCanParseResultsFileWithLongFormSuccessfully() { FileSystem.AddFile(@"results.xml", ""); - var resultPath = FileSystem.FileInfo.FromFileName("results.xml").FullName; + var resultPath = FileSystem.FileInfo.New("results.xml").FullName; var args = new[] { @"-link-results-file=" + resultPath }; var configuration = new Configuration(); @@ -189,9 +189,9 @@ public void ThenCanParseResultsFileWithLongFormSuccessfully() public void ThenCanParseResultsFileAsSemicolonSeparatedList() { FileSystem.AddFile(@"results1.xml", ""); - var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName; + var result1path = FileSystem.FileInfo.New("results1.xml").FullName; FileSystem.AddFile(@"results2.xml", ""); - var result2path = FileSystem.FileInfo.FromFileName("results2.xml").FullName; + var result2path = FileSystem.FileInfo.New("results2.xml").FullName; var args = new[] { $"-link-results-file={result1path};{result2path}" }; @@ -210,7 +210,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedList() public void ThenCanParseResultsFileAsSemicolonSeparatedListAndTestResultsFileContainsTheFirstElementOfTestResultsFiles() { FileSystem.AddFile("results1.xml", ""); - var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName; + var result1path = FileSystem.FileInfo.New("results1.xml").FullName; FileSystem.AddFile("results2.xml", ""); var args = new[] { "-link-results-file=results1.xml;results2.xml" }; @@ -229,7 +229,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListAndTestResultsFileCon public void ThenCanParseResultsFileAsSemicolonSeparatedListThatStartsWithASemicolon() { FileSystem.AddFile(@"results1.xml", ""); - var result1Path = FileSystem.FileInfo.FromFileName("results1.xml").FullName; + var result1Path = FileSystem.FileInfo.New("results1.xml").FullName; var args = new[] { @"-link-results-file=;results1.xml" }; var configuration = new Configuration(); @@ -246,7 +246,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListThatStartsWithASemico [Test] public void ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolon() { - var fileInfo = FileSystem.FileInfo.FromFileName("results1.xml"); + var fileInfo = FileSystem.FileInfo.New("results1.xml"); FileSystem.AddFile(@"results1.xml", ""); var args = new[] { $"-link-results-file={fileInfo.FullName};" }; @@ -265,9 +265,9 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolo public void ThenCanParseMultipleResultsFilesWithWildCard() { FileSystem.AddFile("results1.xml", ""); - var result1FileInfo = FileSystem.FileInfo.FromFileName("results1.xml"); + var result1FileInfo = FileSystem.FileInfo.New("results1.xml"); FileSystem.AddFile("results2.xml", ""); - var result2FileInfo = FileSystem.FileInfo.FromFileName("results2.xml"); + var result2FileInfo = FileSystem.FileInfo.New("results2.xml"); var args = new[] { @"-link-results-file=results*.xml" }; @@ -286,9 +286,9 @@ public void ThenCanParseMultipleResultsFilesWithWildCard() public void ThenCanParseMultipleResultsFilesWithWildCardWhereNoMatchIsExcluded() { FileSystem.AddFile(@"results1.xml", ""); - var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName; + var result1path = FileSystem.FileInfo.New("results1.xml").FullName; FileSystem.AddFile(@"results2.xml", ""); - var result2path = FileSystem.FileInfo.FromFileName("results2.xml").FullName; + var result2path = FileSystem.FileInfo.New("results2.xml").FullName; FileSystem.AddFile(@"nomatch_results3.xml", ""); var args = new[] { @"-link-results-file=results*.xml" }; @@ -308,11 +308,11 @@ public void ThenCanParseMultipleResultsFilesWithWildCardWhereNoMatchIsExcluded() public void ThenCanParseMultipleResultsFilesWithWildCardAndSemicolon() { FileSystem.AddFile(@"results_foo1.xml", ""); - var foo1Path = FileSystem.FileInfo.FromFileName("results_foo1.xml").FullName; + var foo1Path = FileSystem.FileInfo.New("results_foo1.xml").FullName; FileSystem.AddFile(@"results_foo2.xml", ""); - var foo2Path = FileSystem.FileInfo.FromFileName("results_foo2.xml").FullName; + var foo2Path = FileSystem.FileInfo.New("results_foo2.xml").FullName; FileSystem.AddFile(@"results_bar.xml", ""); - var resultsPath = FileSystem.FileInfo.FromFileName("results_bar.xml").FullName; + var resultsPath = FileSystem.FileInfo.New("results_bar.xml").FullName; var args = new[] { @"-link-results-file=results_foo*.xml;results_bar.xml" }; @@ -368,7 +368,7 @@ public void ThenNoExceptionIsThrownWhenResultsFileIsDir() public void ThenCanParseResultsFilesWithMultipleMatchesResolvingInSingleMatch() { FileSystem.AddFile(@"results_foo.xml", ""); - var fileInfo=FileSystem.FileInfo.FromFileName("results_foo.xml"); + var fileInfo=FileSystem.FileInfo.New("results_foo.xml"); var args = new[] { $"-link-results-file={FileSystem.Path.Combine(fileInfo.Directory.FullName,"results*.xml")};*foo.xml" }; diff --git a/src/Pickles.CommandLine/CommandLineArgumentParser.cs b/src/Pickles.CommandLine/CommandLineArgumentParser.cs index ef90fd894..677d674e3 100644 --- a/src/Pickles.CommandLine/CommandLineArgumentParser.cs +++ b/src/Pickles.CommandLine/CommandLineArgumentParser.cs @@ -77,7 +77,7 @@ public CommandLineArgumentParser(IFileSystem fileSystem) public bool Parse(string[] args, IConfiguration configuration, TextWriter stdout) { var currentDirectory = - this.fileSystem.DirectoryInfo.FromDirectoryName(this.fileSystem.Directory.GetCurrentDirectory()); + this.fileSystem.DirectoryInfo.New(this.fileSystem.Directory.GetCurrentDirectory()); configuration.FeatureFolder = currentDirectory; configuration.OutputFolder = currentDirectory; @@ -96,12 +96,12 @@ public bool Parse(string[] args, IConfiguration configuration, TextWriter stdout if (!string.IsNullOrEmpty(this.featureDirectory)) { - configuration.FeatureFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.featureDirectory); + configuration.FeatureFolder = this.fileSystem.DirectoryInfo.New(this.featureDirectory); } if (!string.IsNullOrEmpty(this.outputDirectory)) { - configuration.OutputFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.outputDirectory); + configuration.OutputFolder = this.fileSystem.DirectoryInfo.New(this.outputDirectory); } if (!string.IsNullOrEmpty(this.testResultsFormat)) diff --git a/src/Pickles.CommandLine/Pickles.CommandLine.csproj b/src/Pickles.CommandLine/Pickles.CommandLine.csproj index 535f56157..efe2c537b 100644 --- a/src/Pickles.CommandLine/Pickles.CommandLine.csproj +++ b/src/Pickles.CommandLine/Pickles.CommandLine.csproj @@ -4,7 +4,7 @@ Exe PicklesDoc.Pickles.CommandLine Pickles - net6.0 + net10.0 true pickles ./nupkg @@ -73,9 +73,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/AutomationLayer/StepDefinitions.cs b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/AutomationLayer/StepDefinitions.cs index b8381c52b..57f2a18f6 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/AutomationLayer/StepDefinitions.cs +++ b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/AutomationLayer/StepDefinitions.cs @@ -46,10 +46,10 @@ public sealed class StepDefinitions : BaseFixture /* God object antipattern */ [Given(@"I have this feature description placed in a folder '(.*)' in a file '(.*)'")] public void GivenIHaveThisFeatureDescriptionPlacedInAFolder(string featureFolder, string featureFile, string multilineText) { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName(featureFolder); + var directoryInfo = FileSystem.DirectoryInfo.New(featureFolder); directoryInfo.Create(); var fileName = FileSystem.Path.Combine(featureFolder,featureFile); - var fileInfo = FileSystem.FileInfo.FromFileName(fileName); + var fileInfo = FileSystem.FileInfo.New(fileName); using var writer = fileInfo.CreateText(); { writer.Write(multilineText); @@ -66,7 +66,7 @@ public void GivenIHaveThisFeatureDescriptionPlacedInAFolder(string featureFolder featureNodeFactory, FileSystem); this.nodes = - crawler.Crawl(FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Directory.GetCurrentDirectory()), + crawler.Crawl(FileSystem.DirectoryInfo.New(FileSystem.Directory.GetCurrentDirectory()), new ParsingReport()); } [Given("I have this feature description")] @@ -76,7 +76,7 @@ public void IHaveThisFeatureDescription(string featureDescription) var feature = parser.Parse(new StringReader(featureDescription)); - this.nodes = new Tree(new FeatureNode(FileSystem.DirectoryInfo.FromDirectoryName(@"output"), string.Empty, feature)); + this.nodes = new Tree(new FeatureNode(FileSystem.DirectoryInfo.New(@"output"), string.Empty, feature)); } [When(@"I generate the documentation")] diff --git a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/CucumberDocumentationBuilderTests.cs b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/CucumberDocumentationBuilderTests.cs index f304b6754..51db9668e 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/CucumberDocumentationBuilderTests.cs +++ b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/CucumberDocumentationBuilderTests.cs @@ -49,7 +49,7 @@ Then the screen should be empty var fileSystem = new FileSystem(); fileSystem.Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); - var IFileSystemInfo = fileSystem.DirectoryInfo.FromDirectoryName(@"./"); + var IFileSystemInfo = fileSystem.DirectoryInfo.New(@"./"); var configuration = new Configuration { OutputFolder = IFileSystemInfo diff --git a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FeatureTest/SettingUriForAFeature.feature.cs b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FeatureTest/SettingUriForAFeature.feature.cs index cfef060fd..18702ead4 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FeatureTest/SettingUriForAFeature.feature.cs +++ b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FeatureTest/SettingUriForAFeature.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Cucumber.UnitTests.FeatureTes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Setting uri for aFeature in a folder")] @@ -26,7 +26,7 @@ public partial class SettingUriForAFeatureInAFolderFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "SettingUriForAFeature.feature" #line hidden @@ -35,7 +35,7 @@ public partial class SettingUriForAFeatureInAFolderFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "FeatureTest", "Setting uri for aFeature in a folder", null, ProgrammingLanguage.CSharp, ((string[])(null))); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "FeatureTest", "Setting uri for aFeature in a folder", null, ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -47,28 +47,28 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } @@ -76,26 +76,16 @@ public virtual void ScenarioCleanup() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A simple feature in a folder without base uri set")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void ASimpleFeatureInAFolderWithoutBaseUriSet() + public void ASimpleFeatureInAFolderWithoutBaseUriSet() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder without base uri set", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder without base uri set", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 4 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -121,26 +111,16 @@ public virtual void ASimpleFeatureInAFolderWithoutBaseUriSet() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A simple feature in a folder with file base uri")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void ASimpleFeatureInAFolderWithFileBaseUri() + public void ASimpleFeatureInAFolderWithFileBaseUri() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with file base uri", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with file base uri", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 21 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -169,26 +149,16 @@ public virtual void ASimpleFeatureInAFolderWithFileBaseUri() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A simple feature in a folder with folder base uri")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void ASimpleFeatureInAFolderWithFolderBaseUri() + public void ASimpleFeatureInAFolderWithFolderBaseUri() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with folder base uri", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with folder base uri", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 39 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -217,26 +187,16 @@ public virtual void ASimpleFeatureInAFolderWithFolderBaseUri() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A simple feature in a folder with an absolute base uri")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void ASimpleFeatureInAFolderWithAnAbsoluteBaseUri() + public void ASimpleFeatureInAFolderWithAnAbsoluteBaseUri() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with an absolute base uri", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature in a folder with an absolute base uri", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 57 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FormattingAFeature.feature.cs b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FormattingAFeature.feature.cs index f590146e2..8a58cd7f9 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FormattingAFeature.feature.cs +++ b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/FormattingAFeature.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Cucumber.UnitTests using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Formatting A Feature")] @@ -26,7 +26,7 @@ public partial class FormattingAFeatureFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "FormattingAFeature.feature" #line hidden @@ -35,7 +35,7 @@ public partial class FormattingAFeatureFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting A Feature", null, ProgrammingLanguage.CSharp, ((string[])(null))); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting A Feature", null, ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -47,28 +47,28 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } @@ -76,26 +76,16 @@ public virtual void ScenarioCleanup() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A simple feature")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void ASimpleFeature() + public void ASimpleFeature() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A simple feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 4 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -147,26 +137,16 @@ When I press C [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("A feature with a table")] [NUnit.Framework.CategoryAttribute("cucumber")] - public virtual void AFeatureWithATable() + public void AFeatureWithATable() { string[] tagsOfScenario = new string[] { "cucumber"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A feature with a table", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A feature with a table", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 89 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/Pickles.DocumentationBuilders.Cucumber.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/Pickles.DocumentationBuilders.Cucumber.UnitTests.csproj index 233d54258..d6e201091 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/Pickles.DocumentationBuilders.Cucumber.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Cucumber.UnitTests/Pickles.DocumentationBuilders.Cucumber.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Cucumber.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Cucumber.UnitTests - net6.0 + net10.0 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages @@ -21,13 +21,13 @@ - - - - - - - + + + + + + + diff --git a/src/Pickles.DocumentationBuilders.Cucumber/Pickles.DocumentationBuilders.Cucumber.csproj b/src/Pickles.DocumentationBuilders.Cucumber/Pickles.DocumentationBuilders.Cucumber.csproj index 9f1860645..a88207716 100644 --- a/src/Pickles.DocumentationBuilders.Cucumber/Pickles.DocumentationBuilders.Cucumber.csproj +++ b/src/Pickles.DocumentationBuilders.Cucumber/Pickles.DocumentationBuilders.Cucumber.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Cucumber PicklesDoc.Pickles.DocumentationBuilders.Cucumber - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Cucumber A Pickles output formatter that outputs Cucmber JSON documents bin\$(Configuration)\ @@ -24,15 +24,15 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/Pickles.DocumentationBuilders.Dhtml.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/Pickles.DocumentationBuilders.Dhtml.UnitTests.csproj index ce9aa7c43..7474fce90 100644 --- a/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/Pickles.DocumentationBuilders.Dhtml.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/Pickles.DocumentationBuilders.Dhtml.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Dhtml.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Dhtml.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Dhtml.UnitTests Unit tests for the Pickles output formatter that outputs DHTML documents bin\$(Configuration)\ @@ -21,9 +21,9 @@ - - - + + + diff --git a/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/WhenDoingSomeIntegrationTests.cs b/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/WhenDoingSomeIntegrationTests.cs index 026543ac1..ac1e0647e 100644 --- a/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/WhenDoingSomeIntegrationTests.cs +++ b/src/Pickles.DocumentationBuilders.Dhtml.UnitTests/WhenDoingSomeIntegrationTests.cs @@ -35,7 +35,7 @@ public class WhenDoingSomeIntegrationTests : BaseFixture public void TestTheResourceWriter() { var conf = new Configuration(); - conf.OutputFolder = FileSystem.DirectoryInfo.FromDirectoryName(@"d:\output"); + conf.OutputFolder = FileSystem.DirectoryInfo.New(@"d:\output"); var resourceWriter = new DhtmlResourceWriter(FileSystem, conf); resourceWriter.WriteTo(conf.OutputFolder.FullName); } diff --git a/src/Pickles.DocumentationBuilders.Dhtml/Pickles.DocumentationBuilders.Dhtml.csproj b/src/Pickles.DocumentationBuilders.Dhtml/Pickles.DocumentationBuilders.Dhtml.csproj index a77e56e86..895151b4a 100644 --- a/src/Pickles.DocumentationBuilders.Dhtml/Pickles.DocumentationBuilders.Dhtml.csproj +++ b/src/Pickles.DocumentationBuilders.Dhtml/Pickles.DocumentationBuilders.Dhtml.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Dhtml PicklesDoc.Pickles.DocumentationBuilders.Dhtml - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Dhtml A Pickles output formatter that outputs DHTML documents bin\$(Configuration)\ @@ -149,7 +149,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/Pickles.DocumentationBuilders.Excel.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Excel.UnitTests/Pickles.DocumentationBuilders.Excel.UnitTests.csproj index 6fa0203a3..05a5bcdb0 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/Pickles.DocumentationBuilders.Excel.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/Pickles.DocumentationBuilders.Excel.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Excel.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Excel.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Excel.UnitTests Unit Tests for the Pickles output formatter that outputs MS Excel documents bin\$(Configuration)\ @@ -21,9 +21,9 @@ - - - + + + diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingADocumentStringToAWorksheet.cs b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingADocumentStringToAWorksheet.cs index cc2530332..818e04ae5 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingADocumentStringToAWorksheet.cs +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingADocumentStringToAWorksheet.cs @@ -47,9 +47,9 @@ public void ThenDocumentStringAddedSuccessfully() int row = 7; excelDocumentStringFormatter.Format(worksheet, documentString, ref row); - Check.That(worksheet.Cell("D7").Value).IsEqualTo("This is an example"); - Check.That(worksheet.Cell("D8").Value).IsEqualTo("document string for use"); - Check.That(worksheet.Cell("D9").Value).IsEqualTo("in testing"); + Check.That(worksheet.Cell("D7").GetValue()).IsEqualTo("This is an example"); + Check.That(worksheet.Cell("D8").GetValue()).IsEqualTo("document string for use"); + Check.That(worksheet.Cell("D9").GetValue()).IsEqualTo("in testing"); Check.That(row).IsEqualTo(10); } } diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAFeatureToAWorksheet.cs b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAFeatureToAWorksheet.cs index cefed1d8c..f3c3c67dc 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAFeatureToAWorksheet.cs +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAFeatureToAWorksheet.cs @@ -54,9 +54,9 @@ public void Then_feature_is_added_successfully() IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1"); excelFeatureFormatter.Format(worksheet, feature); - Check.That(worksheet.Cell("A1").Value).IsEqualTo(feature.Name); - Check.That(worksheet.Cell("C2").Value).IsEqualTo("tag1, tag2"); - Check.That(worksheet.Cell("B3").Value).IsEqualTo(feature.Description); + Check.That(worksheet.Cell("A1").GetValue()).IsEqualTo(feature.Name); + Check.That(worksheet.Cell("C2").GetValue()).IsEqualTo("tag1, tag2"); + Check.That(worksheet.Cell("B3").GetValue()).IsEqualTo(feature.Description); } } @@ -87,10 +87,10 @@ public void Then_feature_with_background_is_added_successfully() { IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1"); excelFeatureFormatter.Format(worksheet, feature); - Check.That(worksheet.Cell("B5").Value).IsEqualTo(background.Name); - Check.That(worksheet.Cell("C6").Value).IsEqualTo("tag1, tag2"); - Check.That(worksheet.Cell("C7").Value).IsEqualTo(background.Description); - Check.That(worksheet.Cell("D8").Value).IsEqualTo(given.Name); + Check.That(worksheet.Cell("B5").GetValue()).IsEqualTo(background.Name); + Check.That(worksheet.Cell("C6").GetValue()).IsEqualTo("tag1, tag2"); + Check.That(worksheet.Cell("C7").GetValue()).IsEqualTo(background.Description); + Check.That(worksheet.Cell("D8").GetValue()).IsEqualTo(given.Name); } } @@ -122,10 +122,10 @@ public void Then_feature_without_background_adds_first_scenario_on_correct_row() IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1"); excelFeatureFormatter.Format(worksheet, feature); - Check.That(worksheet.Cell("B5").Value).IsEqualTo(scenario.Name); - Check.That(worksheet.Cell("C6").Value).IsEqualTo("tag1, tag2"); - Check.That(worksheet.Cell("C7").Value).IsEqualTo(scenario.Description); - Check.That(worksheet.Cell("D8").Value).IsEqualTo(given.Name); + Check.That(worksheet.Cell("B5").GetValue()).IsEqualTo(scenario.Name); + Check.That(worksheet.Cell("C6").GetValue()).IsEqualTo("tag1, tag2"); + Check.That(worksheet.Cell("C7").GetValue()).IsEqualTo(scenario.Description); + Check.That(worksheet.Cell("D8").GetValue()).IsEqualTo(given.Name); } } } diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAScenarioToAWorksheet.cs b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAScenarioToAWorksheet.cs index 6534cbff5..0e7954a81 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAScenarioToAWorksheet.cs +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAScenarioToAWorksheet.cs @@ -63,22 +63,22 @@ public void ThenSingleScenarioAddedSuccessfully() int row = 3; excelScenarioFormatter.Format(worksheet, scenario, ref row); - Check.That(worksheet.Cell("B3").Value).IsEqualTo(scenario.Name); - Check.That(worksheet.Cell("C4").Value).IsEqualTo("tag1, tag2"); - Check.That(worksheet.Cell("C5").Value).IsEqualTo(scenario.Description); - Check.That(worksheet.Cell("B7").Value).IsEqualTo("Examples"); - Check.That(worksheet.Cell("D8").Value).IsEqualTo("Var1"); - Check.That(worksheet.Cell("E8").Value).IsEqualTo("Var2"); - Check.That(worksheet.Cell("F8").Value).IsEqualTo("Var3"); - Check.That(worksheet.Cell("G8").Value).IsEqualTo("Var4"); - Check.That(worksheet.Cell("D9").Value).IsEqualTo(1.0); - Check.That(worksheet.Cell("E9").Value).IsEqualTo(2.0); - Check.That(worksheet.Cell("F9").Value).IsEqualTo(3.0); - Check.That(worksheet.Cell("G9").Value).IsEqualTo(4.0); - Check.That(worksheet.Cell("D10").Value).IsEqualTo(5.0); - Check.That(worksheet.Cell("E10").Value).IsEqualTo(6.0); - Check.That(worksheet.Cell("F10").Value).IsEqualTo(7.0); - Check.That(worksheet.Cell("G10").Value).IsEqualTo(8.0); + Check.That(worksheet.Cell("B3").GetValue()).IsEqualTo(scenario.Name); + Check.That(worksheet.Cell("C4").GetValue()).IsEqualTo("tag1, tag2"); + Check.That(worksheet.Cell("C5").GetValue()).IsEqualTo(scenario.Description); + Check.That(worksheet.Cell("B7").GetValue()).IsEqualTo("Examples"); + Check.That(worksheet.Cell("D8").GetValue()).IsEqualTo("Var1"); + Check.That(worksheet.Cell("E8").GetValue()).IsEqualTo("Var2"); + Check.That(worksheet.Cell("F8").GetValue()).IsEqualTo("Var3"); + Check.That(worksheet.Cell("G8").GetValue()).IsEqualTo("Var4"); + Check.That(worksheet.Cell("D9").GetValue()).IsEqualTo("1"); + Check.That(worksheet.Cell("E9").GetValue()).IsEqualTo("2"); + Check.That(worksheet.Cell("F9").GetValue()).IsEqualTo("3"); + Check.That(worksheet.Cell("G9").GetValue()).IsEqualTo("4"); + Check.That(worksheet.Cell("D10").GetValue()).IsEqualTo("5"); + Check.That(worksheet.Cell("E10").GetValue()).IsEqualTo("6"); + Check.That(worksheet.Cell("F10").GetValue()).IsEqualTo("7"); + Check.That(worksheet.Cell("G10").GetValue()).IsEqualTo("8"); Check.That(row).IsEqualTo(11); } } @@ -112,21 +112,21 @@ public void ThenSingleScenarioWithStepsAddedSuccessfully() int row = 3; excelScenarioFormatter.Format(worksheet, scenario, ref row); - Check.That(worksheet.Cell("B3").Value).IsEqualTo(scenario.Name); - Check.That(worksheet.Cell("C4").Value).IsEqualTo(scenario.Description); - Check.That(worksheet.Cell("B9").Value).IsEqualTo("Examples"); - Check.That(worksheet.Cell("D10").Value).IsEqualTo("Var1"); - Check.That(worksheet.Cell("E10").Value).IsEqualTo("Var2"); - Check.That(worksheet.Cell("F10").Value).IsEqualTo("Var3"); - Check.That(worksheet.Cell("G10").Value).IsEqualTo("Var4"); - Check.That(worksheet.Cell("D11").Value).IsEqualTo(1.0); - Check.That(worksheet.Cell("E11").Value).IsEqualTo(2.0); - Check.That(worksheet.Cell("F11").Value).IsEqualTo(3.0); - Check.That(worksheet.Cell("G11").Value).IsEqualTo(4.0); - Check.That(worksheet.Cell("D12").Value).IsEqualTo(5.0); - Check.That(worksheet.Cell("E12").Value).IsEqualTo(6.0); - Check.That(worksheet.Cell("F12").Value).IsEqualTo(7.0); - Check.That(worksheet.Cell("G12").Value).IsEqualTo(8.0); + Check.That(worksheet.Cell("B3").GetValue()).IsEqualTo(scenario.Name); + Check.That(worksheet.Cell("C4").GetValue()).IsEqualTo(scenario.Description); + Check.That(worksheet.Cell("B9").GetValue()).IsEqualTo("Examples"); + Check.That(worksheet.Cell("D10").GetValue()).IsEqualTo("Var1"); + Check.That(worksheet.Cell("E10").GetValue()).IsEqualTo("Var2"); + Check.That(worksheet.Cell("F10").GetValue()).IsEqualTo("Var3"); + Check.That(worksheet.Cell("G10").GetValue()).IsEqualTo("Var4"); + Check.That(worksheet.Cell("D11").GetValue()).IsEqualTo("1"); + Check.That(worksheet.Cell("E11").GetValue()).IsEqualTo("2"); + Check.That(worksheet.Cell("F11").GetValue()).IsEqualTo("3"); + Check.That(worksheet.Cell("G11").GetValue()).IsEqualTo("4"); + Check.That(worksheet.Cell("D12").GetValue()).IsEqualTo("5"); + Check.That(worksheet.Cell("E12").GetValue()).IsEqualTo("6"); + Check.That(worksheet.Cell("F12").GetValue()).IsEqualTo("7"); + Check.That(worksheet.Cell("G12").GetValue()).IsEqualTo("8"); Check.That(row).IsEqualTo(13); } } @@ -147,7 +147,7 @@ public void ThenDutchScenarioWithScenarioContainsVoorbeelden() int row = 3; excelScenarioFormatter.Format(worksheet, scenario, ref row); - Check.That(worksheet.Cell("B5").Value).IsEqualTo("Voorbeelden"); + Check.That(worksheet.Cell("B5").GetValue()).IsEqualTo("Voorbeelden"); } } diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAStepToAWorksheet.cs b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAStepToAWorksheet.cs index 390fcd7c4..e8902f731 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAStepToAWorksheet.cs +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingAStepToAWorksheet.cs @@ -50,8 +50,8 @@ public void ThenStepAddedSuccessfully() int row = 5; excelStepFormatter.Format(worksheet, step, ref row); - Check.That(worksheet.Cell("C5").Value).IsEqualTo(step.NativeKeyword); - Check.That(worksheet.Cell("D5").Value).IsEqualTo(step.Name); + Check.That(worksheet.Cell("C5").GetValue()).IsEqualTo(step.NativeKeyword); + Check.That(worksheet.Cell("D5").GetValue()).IsEqualTo(step.Name); } } @@ -79,9 +79,9 @@ public void ThenStepCommentsAreAddedSuccessfully() int row = 5; excelStepFormatter.Format(worksheet, step, ref row); - Check.That(worksheet.Cell("C5").Value).IsEqualTo(step.Comments.First().Text); - Check.That(worksheet.Cell("C6").Value).IsEqualTo(step.NativeKeyword); - Check.That(worksheet.Cell("D6").Value).IsEqualTo(step.Name); + Check.That(worksheet.Cell("C5").GetValue()).IsEqualTo(step.Comments.First().Text); + Check.That(worksheet.Cell("C6").GetValue()).IsEqualTo(step.NativeKeyword); + Check.That(worksheet.Cell("D6").GetValue()).IsEqualTo(step.Name); } } @@ -114,10 +114,10 @@ public void ThenMultilineStepCommentsAreAddedSuccessfully() int row = 5; excelStepFormatter.Format(worksheet, step, ref row); - Check.That(worksheet.Cell("C5").Value).IsEqualTo(step.Comments[0].Text); - Check.That(worksheet.Cell("C6").Value).IsEqualTo(step.Comments[1].Text); - Check.That(worksheet.Cell("C7").Value).IsEqualTo(step.NativeKeyword); - Check.That(worksheet.Cell("D7").Value).IsEqualTo(step.Name); + Check.That(worksheet.Cell("C5").GetValue()).IsEqualTo(step.Comments[0].Text); + Check.That(worksheet.Cell("C6").GetValue()).IsEqualTo(step.Comments[1].Text); + Check.That(worksheet.Cell("C7").GetValue()).IsEqualTo(step.NativeKeyword); + Check.That(worksheet.Cell("D7").GetValue()).IsEqualTo(step.Name); } } @@ -150,10 +150,10 @@ public void ThenCommentsAfterTheLastStepAreAddedSuccessfully() int row = 5; excelStepFormatter.Format(worksheet, step, ref row); - Check.That(worksheet.Cell("C5").Value).IsEqualTo(step.Comments.First(o => o.Type == CommentType.StepComment).Text); - Check.That(worksheet.Cell("C6").Value).IsEqualTo(step.NativeKeyword); - Check.That(worksheet.Cell("D6").Value).IsEqualTo(step.Name); - Check.That(worksheet.Cell("C7").Value).IsEqualTo(step.Comments.First(o => o.Type == CommentType.AfterLastStepComment).Text); + Check.That(worksheet.Cell("C5").GetValue()).IsEqualTo(step.Comments.First(o => o.Type == CommentType.StepComment).Text); + Check.That(worksheet.Cell("C6").GetValue()).IsEqualTo(step.NativeKeyword); + Check.That(worksheet.Cell("D6").GetValue()).IsEqualTo(step.Name); + Check.That(worksheet.Cell("C7").GetValue()).IsEqualTo(step.Comments.First(o => o.Type == CommentType.AfterLastStepComment).Text); } } } diff --git a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingATableToAWorksheet.cs b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingATableToAWorksheet.cs index 1fb5dcb54..7e2165066 100644 --- a/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingATableToAWorksheet.cs +++ b/src/Pickles.DocumentationBuilders.Excel.UnitTests/WhenAddingATableToAWorksheet.cs @@ -52,18 +52,18 @@ public void ThenTableAddedSuccessfully() int row = 6; excelTableFormatter.Format(worksheet, table, ref row); - Check.That(worksheet.Cell("D6").Value).IsEqualTo("Var1"); - Check.That(worksheet.Cell("E6").Value).IsEqualTo("Var2"); - Check.That(worksheet.Cell("F6").Value).IsEqualTo("Var3"); - Check.That(worksheet.Cell("G6").Value).IsEqualTo("Var4"); - Check.That(worksheet.Cell("D7").Value).IsEqualTo(1.0); - Check.That(worksheet.Cell("E7").Value).IsEqualTo(2.0); - Check.That(worksheet.Cell("F7").Value).IsEqualTo(3.0); - Check.That(worksheet.Cell("G7").Value).IsEqualTo(4.0); - Check.That(worksheet.Cell("D8").Value).IsEqualTo(5.0); - Check.That(worksheet.Cell("E8").Value).IsEqualTo(6.0); - Check.That(worksheet.Cell("F8").Value).IsEqualTo(7.0); - Check.That(worksheet.Cell("G8").Value).IsEqualTo(8.0); + Check.That(worksheet.Cell("D6").GetValue()).IsEqualTo("Var1"); + Check.That(worksheet.Cell("E6").GetValue()).IsEqualTo("Var2"); + Check.That(worksheet.Cell("F6").GetValue()).IsEqualTo("Var3"); + Check.That(worksheet.Cell("G6").GetValue()).IsEqualTo("Var4"); + Check.That(worksheet.Cell("D7").GetValue()).IsEqualTo("1"); + Check.That(worksheet.Cell("E7").GetValue()).IsEqualTo("2"); + Check.That(worksheet.Cell("F7").GetValue()).IsEqualTo("3"); + Check.That(worksheet.Cell("G7").GetValue()).IsEqualTo("4"); + Check.That(worksheet.Cell("D8").GetValue()).IsEqualTo("5"); + Check.That(worksheet.Cell("E8").GetValue()).IsEqualTo("6"); + Check.That(worksheet.Cell("F8").GetValue()).IsEqualTo("7"); + Check.That(worksheet.Cell("G8").GetValue()).IsEqualTo("8"); Check.That(row).IsEqualTo(9); } } diff --git a/src/Pickles.DocumentationBuilders.Excel/ExcelTableOfContentsFormatter.cs b/src/Pickles.DocumentationBuilders.Excel/ExcelTableOfContentsFormatter.cs index 5f45d744a..f0c25bbad 100644 --- a/src/Pickles.DocumentationBuilders.Excel/ExcelTableOfContentsFormatter.cs +++ b/src/Pickles.DocumentationBuilders.Excel/ExcelTableOfContentsFormatter.cs @@ -31,7 +31,7 @@ public class ExcelTableOfContentsFormatter private void WriteFileCell(IXLWorksheet worksheet, ref int row, int column, IXLWorksheet featureWorksheet) { worksheet.Cell(row, column).Value = featureWorksheet.Cell("A1").Value; - worksheet.Cell(row++, column).Hyperlink = new XLHyperlink(featureWorksheet.Name + "!A1"); + worksheet.Cell(row++, column).SetHyperlink(new XLHyperlink(featureWorksheet.Name + "!A1")); } private void WriteDirectoryCell(IXLWorksheet worksheet, ref int row, int column, string directoryName) diff --git a/src/Pickles.DocumentationBuilders.Excel/Pickles.DocumentationBuilders.Excel.csproj b/src/Pickles.DocumentationBuilders.Excel/Pickles.DocumentationBuilders.Excel.csproj index e529e13fa..ca11448bc 100644 --- a/src/Pickles.DocumentationBuilders.Excel/Pickles.DocumentationBuilders.Excel.csproj +++ b/src/Pickles.DocumentationBuilders.Excel/Pickles.DocumentationBuilders.Excel.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Excel PicklesDoc.Pickles.DocumentationBuilders.Excel - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Excel A Pickles output formatter that outputs MS Excel documents bin\$(Configuration)\ @@ -24,18 +24,18 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + diff --git a/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeature.feature.cs b/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeature.feature.cs index 82d3b4887..5319e6bb1 100644 --- a/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeature.feature.cs +++ b/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeature.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Html.UnitTests using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Formatting a Feature")] @@ -26,7 +26,7 @@ public partial class FormattingAFeatureFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "FormattingAFeature.feature" #line hidden @@ -35,7 +35,7 @@ public partial class FormattingAFeatureFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting a Feature", null, ProgrammingLanguage.CSharp, ((string[])(null))); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting a Feature", null, ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -47,53 +47,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Description should be Formatted as Markdown")] - public virtual void DescriptionShouldBeFormattedAsMarkdown() + public void DescriptionShouldBeFormattedAsMarkdown() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description should be Formatted as Markdown", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description should be Formatted as Markdown", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 3 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -163,25 +153,15 @@ to describe text

[NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Markdown Tables should be Formatted as HTML Tables")] - public virtual void MarkdownTablesShouldBeFormattedAsHTMLTables() + public void MarkdownTablesShouldBeFormattedAsHTMLTables() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Markdown Tables should be Formatted as HTML Tables", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Markdown Tables should be Formatted as HTML Tables", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 63 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -241,25 +221,15 @@ I want to see the descriptions written in markdown rendered with tables

[NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Somewhat malformed Markdown Tables should be formatted as HTML Tables as well")] - public virtual void SomewhatMalformedMarkdownTablesShouldBeFormattedAsHTMLTablesAsWell() + public void SomewhatMalformedMarkdownTablesShouldBeFormattedAsHTMLTablesAsWell() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Somewhat malformed Markdown Tables should be formatted as HTML Tables as well", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Somewhat malformed Markdown Tables should be formatted as HTML Tables as well", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 113 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeatureUsingStrike.feature.cs b/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeatureUsingStrike.feature.cs index 0f2888dc0..9bacd93f8 100644 --- a/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeatureUsingStrike.feature.cs +++ b/src/Pickles.DocumentationBuilders.Html.UnitTests/FormattingAFeatureUsingStrike.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Html.UnitTests using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Formatting a Feature Using Strike")] @@ -26,7 +26,7 @@ public partial class FormattingAFeatureUsingStrikeFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "FormattingAFeatureUsingStrike.feature" #line hidden @@ -35,7 +35,7 @@ public partial class FormattingAFeatureUsingStrikeFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting a Feature Using Strike", null, ProgrammingLanguage.CSharp, ((string[])(null))); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "", "Formatting a Feature Using Strike", null, ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -47,28 +47,28 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } @@ -76,26 +76,16 @@ public virtual void ScenarioCleanup() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Description with image should render correctly")] [NUnit.Framework.CategoryAttribute("enableExperimentalFeatures")] - public virtual void DescriptionWithImageShouldRenderCorrectly() + public void DescriptionWithImageShouldRenderCorrectly() { string[] tagsOfScenario = new string[] { "enableExperimentalFeatures"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description with image should render correctly", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description with image should render correctly", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 4 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -119,25 +109,15 @@ public virtual void DescriptionWithImageShouldRenderCorrectly() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Description with image with extra attributes should render correctly")] - public virtual void DescriptionWithImageWithExtraAttributesShouldRenderCorrectly() + public void DescriptionWithImageWithExtraAttributesShouldRenderCorrectly() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description with image with extra attributes should render correctly", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Description with image with extra attributes should render correctly", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 22 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Html.UnitTests/Pickles.DocumentationBuilders.Html.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Html.UnitTests/Pickles.DocumentationBuilders.Html.UnitTests.csproj index 507ba2043..2056bf959 100644 --- a/src/Pickles.DocumentationBuilders.Html.UnitTests/Pickles.DocumentationBuilders.Html.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Html.UnitTests/Pickles.DocumentationBuilders.Html.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Html.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Html.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Html A Pickles output formatter that outputs HTML documents bin\$(Configuration)\ @@ -35,12 +35,12 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Html/HtmlTableOfContentsFormatter.cs b/src/Pickles.DocumentationBuilders.Html/HtmlTableOfContentsFormatter.cs index 865e11116..29c45737d 100644 --- a/src/Pickles.DocumentationBuilders.Html/HtmlTableOfContentsFormatter.cs +++ b/src/Pickles.DocumentationBuilders.Html/HtmlTableOfContentsFormatter.cs @@ -84,7 +84,7 @@ private XElement AddNodeForDirectory(XNamespace xmlns, Uri file, Tree childNode) private XElement AddNodeForHome(XNamespace xmlns, Uri file, IDirectoryInfo rootFolder) { var rootfile = - (IFileInfo) this.fileSystem.FileInfo.FromFileName( + (IFileInfo) this.fileSystem.FileInfo.New( this.fileSystem.Path.Combine(rootFolder.FullName, "index.html")); var xElement = new XElement(xmlns + "li", new XAttribute("class", "file"), new XAttribute("id", "root")); @@ -108,7 +108,7 @@ private XElement AddNodeForHome(XNamespace xmlns, Uri file, IDirectoryInfo rootF private bool DetermineWhetherFileIsTheRootFile(Uri file, IFileInfo rootfile) { - var fileInfo = this.fileSystem.FileInfo.FromFileName(file.LocalPath); + var fileInfo = this.fileSystem.FileInfo.New(file.LocalPath); if (rootfile.DirectoryName != fileInfo.DirectoryName) { diff --git a/src/Pickles.DocumentationBuilders.Html/Pickles.DocumentationBuilders.Html.csproj b/src/Pickles.DocumentationBuilders.Html/Pickles.DocumentationBuilders.Html.csproj index 556996d04..e6dfade3a 100644 --- a/src/Pickles.DocumentationBuilders.Html/Pickles.DocumentationBuilders.Html.csproj +++ b/src/Pickles.DocumentationBuilders.Html/Pickles.DocumentationBuilders.Html.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Html PicklesDoc.Pickles.DocumentationBuilders.Html - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Html A Pickles output formatter that outputs HTML documents bin\$(Configuration)\ @@ -66,18 +66,18 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - - + + + diff --git a/src/Pickles.DocumentationBuilders.Json.UnitTests/AutomationLayer/StepDefinitions.cs b/src/Pickles.DocumentationBuilders.Json.UnitTests/AutomationLayer/StepDefinitions.cs index facb07411..fa5471850 100644 --- a/src/Pickles.DocumentationBuilders.Json.UnitTests/AutomationLayer/StepDefinitions.cs +++ b/src/Pickles.DocumentationBuilders.Json.UnitTests/AutomationLayer/StepDefinitions.cs @@ -46,14 +46,14 @@ public void IHaveThisFeatureDescription(string featureDescription) var feature = parser.Parse(new StringReader(featureDescription)); - this.nodes = new Tree(new FeatureNode(this.FileSystem.DirectoryInfo.FromDirectoryName(@"c:\output\"), string.Empty, feature)); + this.nodes = new Tree(new FeatureNode(this.FileSystem.DirectoryInfo.New(@"c:\output\"), string.Empty, feature)); } [When(@"I generate the documentation")] public void WhenIGenerateTheJsonDocumentation() { var configuration = this.Configuration; - configuration.OutputFolder = this.FileSystem.DirectoryInfo.FromDirectoryName(@"c:\output\"); + configuration.OutputFolder = this.FileSystem.DirectoryInfo.New(@"c:\output\"); var jsonDocumentationBuilder = this.Container.Resolve(); jsonDocumentationBuilder.Build(this.nodes); diff --git a/src/Pickles.DocumentationBuilders.Json.UnitTests/IJsonFeatureElementExtensionsTests.cs b/src/Pickles.DocumentationBuilders.Json.UnitTests/IJsonFeatureElementExtensionsTests.cs index 0af21fc3e..cfdc17a15 100644 --- a/src/Pickles.DocumentationBuilders.Json.UnitTests/IJsonFeatureElementExtensionsTests.cs +++ b/src/Pickles.DocumentationBuilders.Json.UnitTests/IJsonFeatureElementExtensionsTests.cs @@ -42,7 +42,7 @@ public void AllTags_NoTagsInFeatureElementAndInFeature_ReturnsEmptyList() IReadOnlyList tags = scenario.AllTags(); - Assert.IsEmpty(tags); + Assert.That(tags, Is.Empty); } [Test] @@ -60,7 +60,7 @@ public void AllTags_TagsInFeatureElement_ReturnsTags() IReadOnlyList tags = scenario.AllTags(); - CollectionAssert.AreEquivalent(new[] { "tag1", "tag2" }, tags); + Assert.That(tags, Is.EquivalentTo(new[] { "tag1", "tag2" })); } [Test] @@ -80,7 +80,7 @@ public void AllTags_TagsInScenarioElement_ReturnsTags() IReadOnlyList tags = scenario.AllTags(); - CollectionAssert.AreEquivalent(new[] { "tag1", "tag2" }, tags); + Assert.That(tags, Is.EquivalentTo(new[] { "tag1", "tag2" })); } [Test] @@ -103,7 +103,7 @@ public void AllTags_TagsBothInScenarioAndInFeatureElement_ReturnsEachTagOnlyOnce IReadOnlyList tags = scenario.AllTags(); - CollectionAssert.AreEquivalent(new[] { "tag1" }, tags); + Assert.That(tags, Is.EquivalentTo(new[] { "tag1" })); } } } \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Json.UnitTests/Pickles.DocumentationBuilders.Json.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Json.UnitTests/Pickles.DocumentationBuilders.Json.UnitTests.csproj index 777fab298..64a260030 100644 --- a/src/Pickles.DocumentationBuilders.Json.UnitTests/Pickles.DocumentationBuilders.Json.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Json.UnitTests/Pickles.DocumentationBuilders.Json.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Json.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Json.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Json.UnitTests Unit tests for the Pickles output formatter that outputs Json documents bin\$(Configuration)\ @@ -33,9 +33,9 @@ - - - - + + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Json/Pickles.DocumentationBuilders.Json.csproj b/src/Pickles.DocumentationBuilders.Json/Pickles.DocumentationBuilders.Json.csproj index 391863235..8b02902b6 100644 --- a/src/Pickles.DocumentationBuilders.Json/Pickles.DocumentationBuilders.Json.csproj +++ b/src/Pickles.DocumentationBuilders.Json/Pickles.DocumentationBuilders.Json.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Json PicklesDoc.Pickles.DocumentationBuilders.Json - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Json A Pickles output formatter that outputs Json documents bin\$(Configuration)\ @@ -24,17 +24,17 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Background.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Background.feature.cs index cb6ea4f7f..d7cdc958d 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Background.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Background.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Background Steps")] @@ -26,7 +26,7 @@ public partial class BackgroundStepsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Feature Background.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Background Steps", " In order to document the background Gherkin steps run before each scenario\r\n " + " As a reader of the generated documentation\r\n I want the background steps t" + - "o be included in the Markdown output.", ProgrammingLanguage.CSharp, ((string[])(null))); + "o be included in the Markdown output.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has background given step for feature")] - public virtual void OutputHasBackgroundGivenStepForFeature() + public void OutputHasBackgroundGivenStepForFeature() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has background given step for feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has background given step for feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Description.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Description.feature.cs index 936df5f87..150896b46 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Description.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Description.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Feature Description")] @@ -26,7 +26,7 @@ public partial class FeatureDescriptionFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Feature Description.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Feature Description", " In order include the description (In order, As a, I want) for each feature\r\n " + " As a reader of the generated documentation\r\n I want the feature descriptio" + - "n included below the feature heading.", ProgrammingLanguage.CSharp, ((string[])(null))); + "n included below the feature heading.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has feature description for feature")] - public virtual void OutputHasFeatureDescriptionForFeature() + public void OutputHasFeatureDescriptionForFeature() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has feature description for feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has feature description for feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Heading.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Heading.feature.cs index 597a3961f..e9a534190 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Heading.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Heading.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Feature Heading")] @@ -26,7 +26,7 @@ public partial class FeatureHeadingFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Feature Heading.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Feature Heading", " In order to identify each feature file in the documentation\r\n As a reader " + "of the generated documentation\r\n I want the feature title visually differenti" + - "ated from the other text.", ProgrammingLanguage.CSharp, ((string[])(null))); + "ated from the other text.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has feature section for each feature")] - public virtual void OutputHasFeatureSectionForEachFeature() + public void OutputHasFeatureSectionForEachFeature() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has feature section for each feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has feature section for each feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Tags.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Tags.feature.cs index adae98902..14a7ff85e 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Tags.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Feature Tags.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Feature Tags")] @@ -26,7 +26,7 @@ public partial class FeatureTagsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Feature Tags.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Feature Tags", " In order to include the tags for each feature\r\n As a reader of the generat" + "ed documentation\r\n I want the feature tags included in single line above the " + - "feature heading.", ProgrammingLanguage.CSharp, ((string[])(null))); + "feature heading.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has tags for feature")] - public virtual void OutputHasTagsForFeature() + public void OutputHasTagsForFeature() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has tags for feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has tags for feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/File Location.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/File Location.feature.cs index cabc343c6..2918acf1f 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/File Location.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/File Location.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("File Location")] @@ -26,7 +26,7 @@ public partial class FileLocationFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "File Location.feature" #line hidden @@ -36,7 +36,7 @@ public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "File Location", " In order to control where the document is created\r\n As a document reader\r\n" + - " I want a to be able to specify an output folder for the document", ProgrammingLanguage.CSharp, ((string[])(null))); + " I want a to be able to specify an output folder for the document", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -48,53 +48,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output is written to specified location")] - public virtual void OutputIsWrittenToSpecifiedLocation() + public void OutputIsWrittenToSpecifiedLocation() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output is written to specified location", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output is written to specified location", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 7 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Heading.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Heading.feature.cs index e0bd4379f..456c7a8d0 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Heading.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Heading.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Heading")] @@ -26,7 +26,7 @@ public partial class ScenarioHeadingFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Scenario Heading.feature" #line hidden @@ -36,7 +36,7 @@ public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Scenario Heading", " In order identify each scenario\r\n As a reader of the generated documentati" + - "on\r\n I want the heading included in the output.", ProgrammingLanguage.CSharp, ((string[])(null))); + "on\r\n I want the heading included in the output.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -48,53 +48,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has scenario heading")] - public virtual void OutputHasScenarioHeading() + public void OutputHasScenarioHeading() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 7 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -123,25 +113,15 @@ public virtual void OutputHasScenarioHeading() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has scenario heading for each scenario in different features")] - public virtual void OutputHasScenarioHeadingForEachScenarioInDifferentFeatures() + public void OutputHasScenarioHeadingForEachScenarioInDifferentFeatures() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading for each scenario in different features", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading for each scenario in different features", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 19 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -182,25 +162,15 @@ public virtual void OutputHasScenarioHeadingForEachScenarioInDifferentFeatures() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has scenario heading for each scenario in same feature")] - public virtual void OutputHasScenarioHeadingForEachScenarioInSameFeature() + public void OutputHasScenarioHeadingForEachScenarioInSameFeature() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading for each scenario in same feature", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has scenario heading for each scenario in same feature", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 37 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature index 3455592cb..dd2ef64ab 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature @@ -1,4 +1,6 @@ -Feature: Scenario Outlines +# language: en + +Feature: Scenario Outlines In order to document the Scenario Outlines As a reader of the generated documentation I want the scenario outlines to appear with steps and examples below the feature heading. diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature.cs index 95b82d390..e2fc76995 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Outline.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Outlines")] @@ -26,7 +26,7 @@ public partial class ScenarioOutlinesFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Scenario Outline.feature" #line hidden @@ -35,9 +35,9 @@ public partial class ScenarioOutlinesFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Scenario Outlines", " In order to document the Scenario Outlines\r\n As a reader of the generated " + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Features", "Scenario Outlines", " In order to document the Scenario Outlines\r\n As a reader of the generated " + "documentation\r\n I want the scenario outlines to appear with steps and example" + - "s below the feature heading.", ProgrammingLanguage.CSharp, ((string[])(null))); + "s below the feature heading.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,63 +49,53 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has simple scenario outline")] - public virtual void OutputHasSimpleScenarioOutline() + public void OutputHasSimpleScenarioOutline() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple scenario outline", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 6 + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple scenario outline", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 8 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } else { this.ScenarioStart(); -#line 8 +#line 10 testRunner.Given("I have a feature called \'My Scenario Outline Feature\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 10 +#line 12 testRunner.And("I have a scenario outline called \'Scenario Outline with Single Example\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { @@ -117,7 +107,7 @@ public virtual void OutputHasSimpleScenarioOutline() table11.AddRow(new string[] { "And", "I have second given for "}); -#line 12 +#line 14 testRunner.And("I have the scenario steps", ((string)(null)), table11, "And "); #line hidden TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { @@ -136,10 +126,10 @@ public virtual void OutputHasSimpleScenarioOutline() "Third", "three", "tree"}); -#line 17 +#line 19 testRunner.And("I have an examples table", ((string)(null)), table12, "And "); #line hidden -#line 23 +#line 25 testRunner.When("I generate Markdown output", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { @@ -170,7 +160,7 @@ public virtual void OutputHasSimpleScenarioOutline() "> | Second | two | too |"}); table13.AddRow(new string[] { "> | Third | three | tree |"}); -#line 25 +#line 27 testRunner.Then("the Markdown output has the lines in the following order", ((string)(null)), table13, "Then "); #line hidden } @@ -179,35 +169,25 @@ public virtual void OutputHasSimpleScenarioOutline() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has table step scenario outline")] - public virtual void OutputHasTableStepScenarioOutline() + public void OutputHasTableStepScenarioOutline() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has table step scenario outline", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 41 + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has table step scenario outline", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 43 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } else { this.ScenarioStart(); -#line 43 +#line 45 testRunner.Given("I have a feature called \'My Scenario Outline Feature\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 45 +#line 47 testRunner.And("I have a scenario outline called \'Scenario Outline with table step\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { @@ -219,7 +199,7 @@ public virtual void OutputHasTableStepScenarioOutline() table14.AddRow(new string[] { "TDA2", ""}); -#line 47 +#line 49 testRunner.And("I have the scenario step with table \'Given I have a table\'", ((string)(null)), table14, "And "); #line hidden TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { @@ -238,10 +218,10 @@ public virtual void OutputHasTableStepScenarioOutline() "Third", "three", "tree"}); -#line 52 +#line 54 testRunner.And("I have an examples table", ((string)(null)), table15, "And "); #line hidden -#line 58 +#line 60 testRunner.When("I generate Markdown output", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { @@ -278,7 +258,7 @@ public virtual void OutputHasTableStepScenarioOutline() "> | Second | two | too |"}); table16.AddRow(new string[] { "> | Third | three | tree |"}); -#line 60 +#line 62 testRunner.Then("the Markdown output has the lines in the following order", ((string)(null)), table16, "Then "); #line hidden } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature index 2aa4e8843..56093d69b 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature @@ -1,4 +1,6 @@ -Feature: Scenario Status Icons +# language: en + +Feature: Scenario Status Icons In order to display the outcome of Scenarios and Scenario Outlines As a reader of the generated documentation I want the result to indicated as Pass, Fail, or Inconclusive by an appropriate icon. diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature.cs index 74165a0e5..47b92cc56 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Status Icons.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Status Icons")] @@ -26,7 +26,7 @@ public partial class ScenarioStatusIconsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Scenario Status Icons.feature" #line hidden @@ -35,9 +35,9 @@ public partial class ScenarioStatusIconsFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Scenario Status Icons", " In order to display the outcome of Scenarios and Scenario Outlines\r\n As a " + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Features", "Scenario Status Icons", " In order to display the outcome of Scenarios and Scenario Outlines\r\n As a " + "reader of the generated documentation\r\n I want the result to indicated as Pas" + - "s, Fail, or Inconclusive by an appropriate icon.", ProgrammingLanguage.CSharp, ((string[])(null))); + "s, Fail, or Inconclusive by an appropriate icon.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,72 +49,62 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Status icons are written to specified location")] - public virtual void StatusIconsAreWrittenToSpecifiedLocation() + public void StatusIconsAreWrittenToSpecifiedLocation() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Status icons are written to specified location", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 7 + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Status icons are written to specified location", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 9 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } else { this.ScenarioStart(); -#line 9 +#line 11 testRunner.Given("I specify the output folder as \'C:\\testing\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 11 +#line 13 testRunner.When("I generate Markdown output", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 13 +#line 15 testRunner.Then("the file \'C:\\testing\\pass.png\' exists", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 14 +#line 16 testRunner.And("the file \'C:\\testing\\fail.png\' exists", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 15 +#line 17 testRunner.And("the file \'C:\\testing\\inconclusive.png\' exists", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden } @@ -126,51 +116,41 @@ public virtual void StatusIconsAreWrittenToSpecifiedLocation() [NUnit.Framework.TestCaseAttribute("Passed", "passed", "pass.png", null)] [NUnit.Framework.TestCaseAttribute("Failed", "failed", "fail.png", null)] [NUnit.Framework.TestCaseAttribute("Inconclusive", "inconclusive", "inconclusive.png", null)] - public virtual void ScenarioDisplaysResultsIcon(string outcome_Label, string outcome, string outcome_Image, string[] exampleTags) + public void ScenarioDisplaysResultsIcon(string outcome_Label, string outcome, string outcome_Image, string[] exampleTags) { string[] tagsOfScenario = exampleTags; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); argumentsOfScenario.Add("outcome_label", outcome_Label); argumentsOfScenario.Add("outcome", outcome); argumentsOfScenario.Add("outcome_image", outcome_Image); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Scenario displays results icon", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 18 + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Scenario displays results icon", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 20 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } else { this.ScenarioStart(); -#line 19 +#line 21 testRunner.Given("I have a feature called \'My Scenario Results Feature\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 20 +#line 22 testRunner.And("I have a scenario called \'Scenario with result\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 21 +#line 23 testRunner.And(string.Format("the scenario test run outcome was {0}", outcome), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 23 +#line 25 testRunner.When("I generate Markdown output", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { "Content"}); table17.AddRow(new string[] { string.Format("#### Scenario: ![{0}]({1}) Scenario with result", outcome_Label, outcome_Image)}); -#line 25 +#line 27 testRunner.Then("the Markdown output has the lines in the following order", ((string)(null)), table17, "Then "); #line hidden } @@ -179,35 +159,25 @@ public virtual void ScenarioDisplaysResultsIcon(string outcome_Label, string out [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Outline Example displays results icon")] - public virtual void ScenarioOutlineExampleDisplaysResultsIcon() + public void ScenarioOutlineExampleDisplaysResultsIcon() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Scenario Outline Example displays results icon", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 36 + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Scenario Outline Example displays results icon", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 38 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } else { this.ScenarioStart(); -#line 37 +#line 39 testRunner.Given("I have a feature called \'My Scenario Outline Results Feature\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 38 +#line 40 testRunner.And("I have a scenario outline called \'Scenario Outline with result\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { @@ -230,10 +200,10 @@ public virtual void ScenarioOutlineExampleDisplaysResultsIcon() "three", "tree", "inconclusive"}); -#line 39 +#line 41 testRunner.And("I have an examples table with results", ((string)(null)), table18, "And "); #line hidden -#line 45 +#line 47 testRunner.When("I generate Markdown output", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { @@ -252,7 +222,7 @@ public virtual void ScenarioOutlineExampleDisplaysResultsIcon() "> | Second | two | too | ![Failed](fail.png) |"}); table19.AddRow(new string[] { "> | Third | three | tree | ![Inconclusive](inconclusive.png) |"}); -#line 47 +#line 49 testRunner.Then("the Markdown output has the lines in the following order", ((string)(null)), table19, "Then "); #line hidden } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Steps.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Steps.feature.cs index ff5d916c3..9d2c8a298 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Steps.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Steps.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Steps")] @@ -26,7 +26,7 @@ public partial class ScenarioStepsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Scenario Steps.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Scenario Steps", " In order to document the Gherkin steps\r\n As a reader of the generated docu" + "mentation\r\n I want the scenario steps to appear in order below the scenario h" + - "eading.", ProgrammingLanguage.CSharp, ((string[])(null))); + "eading.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has simple given step for scenario")] - public virtual void OutputHasSimpleGivenStepForScenario() + public void OutputHasSimpleGivenStepForScenario() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple given step for scenario", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple given step for scenario", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -137,25 +127,15 @@ public virtual void OutputHasSimpleGivenStepForScenario() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has simple given & and step for scenario")] - public virtual void OutputHasSimpleGivenAndStepForScenario() + public void OutputHasSimpleGivenAndStepForScenario() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple given & and step for scenario", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has simple given & and step for scenario", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 22 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -204,25 +184,15 @@ public virtual void OutputHasSimpleGivenAndStepForScenario() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has a step with a table for scenario")] - public virtual void OutputHasAStepWithATableForScenario() + public void OutputHasAStepWithATableForScenario() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has a step with a table for scenario", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has a step with a table for scenario", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 41 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Tags.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Tags.feature.cs index 6bb53f6d9..2d9395dd5 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Tags.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Scenario Tags.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Scenario Tags")] @@ -26,7 +26,7 @@ public partial class ScenarioTagsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Scenario Tags.feature" #line hidden @@ -37,7 +37,7 @@ public virtual void FeatureSetup() testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Scenario Tags", " In order to include the tags for each scenario\r\n As a reader of the genera" + "ted documentation\r\n I want the scenario tags included in single line above th" + - "e scenario heading.", ProgrammingLanguage.CSharp, ((string[])(null))); + "e scenario heading.", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -49,53 +49,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has tags for scenario")] - public virtual void OutputHasTagsForScenario() + public void OutputHasTagsForScenario() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has tags for scenario", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has tags for scenario", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Title.feature.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Title.feature.cs index 4653aa512..7883f5fa4 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Title.feature.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Features/Title.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.7.0.0 -// SpecFlow Generator Version:3.7.0.0 +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests.Feat using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Title")] @@ -26,7 +26,7 @@ public partial class TitleFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "Title.feature" #line hidden @@ -36,7 +36,7 @@ public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Title", " In order to easily tell that this file is a Gherkin output file\r\n As a doc" + - "ument reader\r\n I want a title in the document as the first line", ProgrammingLanguage.CSharp, ((string[])(null))); + "ument reader\r\n I want a title in the document as the first line", ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -48,53 +48,43 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Output has title on first line")] - public virtual void OutputHasTitleOnFirstLine() + public void OutputHasTitleOnFirstLine() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has title on first line", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Output has title on first line", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 6 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Pickles.DocumentationBuilders.Markdown.AcceptanceTests.csproj b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Pickles.DocumentationBuilders.Markdown.AcceptanceTests.csproj index 3a4ee932f..c042cc2de 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Pickles.DocumentationBuilders.Markdown.AcceptanceTests.csproj +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Pickles.DocumentationBuilders.Markdown.AcceptanceTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests PicklesDoc.Pickles.DocumentationBuilders.Markdown.AcceptanceTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Markdown.AcceptanceTests Acceptance tests for the Pickles output formatter that outputs Markdown documents bin\$(Configuration)\ @@ -61,10 +61,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/GherkinTreeSteps.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/GherkinTreeSteps.cs index 34c65122c..57728f3b0 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/GherkinTreeSteps.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/GherkinTreeSteps.cs @@ -44,7 +44,7 @@ public void GivenIHaveAFeatureCalled(string p0) newFeature.Name = p0; var relPath = "fakedir"; - var location = FileSystem.FileInfo.FromFileName(@"c:\"); + var location = FileSystem.FileInfo.New(@"c:\"); INode newNode = new FeatureNode(location, relPath, newFeature); diff --git a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/MarkdownSteps.cs b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/MarkdownSteps.cs index bb1182479..553516ede 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/MarkdownSteps.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.AcceptanceTests/Steps/MarkdownSteps.cs @@ -42,7 +42,7 @@ public MarkdownSteps(ScenarioContext scenarioContext) [Given(@"I specify the output folder as '(.*)'")] public void Given_I_Specify_The_Output_File_As(string outputFolder) { - Configuration.OutputFolder = this.FileSystem.DirectoryInfo.FromDirectoryName(outputFolder); + Configuration.OutputFolder = this.FileSystem.DirectoryInfo.New(outputFolder); } [When(@"I generate Markdown output")] @@ -73,8 +73,9 @@ public void Then_The_Markdown_Output_Has_The_Line(Table table) var expectedValue = check["Content"]; var expectedRow = int.Parse(check["Line No."]); - Assert.IsTrue(resultArray.Length >= expectedRow, "Not enough lines in output"); - Assert.AreEqual(expectedValue, resultArray[expectedRow-1]); + + Assert.That(resultArray.Length >= expectedRow, Is.True); + Assert.That(expectedValue, Is.EqualTo(resultArray[expectedRow - 1])); } } @@ -85,7 +86,7 @@ public void ThenTheMarkdownOutputHasTheLines(Table table) var resultArray = actualResult.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.IsTrue(resultArray.Length >= table.RowCount, "Not enough lines in output"); + Assert.That(resultArray.Length >= table.RowCount, Is.True); foreach (var check in table.Rows) { @@ -100,7 +101,7 @@ public void ThenTheMarkdownOutputHasTheLines(Table table) } } - Assert.IsTrue(found, string.Format("Line \"{0}\" not found in output", expectedValue)); + Assert.That(found, Is.True); } } @@ -111,7 +112,7 @@ public void Then_The_Markdown_Output_Has_The_Lines_In_The_Following_Order(Table var resultArray = actualResult.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.IsTrue(resultArray.Length >= table.RowCount, "Not enough lines in output"); + Assert.That(resultArray.Length >= table.RowCount, Is.True); var currentIndexPosition = 0; @@ -129,7 +130,7 @@ public void Then_The_Markdown_Output_Has_The_Lines_In_The_Following_Order(Table currentIndexPosition++; } - Assert.IsTrue(found, string.Format("Line \"{0}\" not found or later than expected", expectedValue)); + Assert.That(found, Is.True); } } @@ -138,7 +139,7 @@ public void Then_The_Markdown_Output_Has_The_Lines_In_The_Following_Order(Table public void Then_The_File_Exists(string expectedFile, string expectedFolder) { this.filePath = FileSystem.Path.Combine(expectedFolder,expectedFile); - Assert.IsTrue(this.FileSystem.File.Exists(this.filePath),string.Format("File \"{0}\" not found",filePath)); + Assert.That(this.FileSystem.File.Exists(this.filePath), Is.True); } // Duplicated logic from Builder class, should be moved to it's own class? diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/BackgroundBlock_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/BackgroundBlock_Tests.cs index f981a4ca2..760c1e08f 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/BackgroundBlock_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/BackgroundBlock_Tests.cs @@ -44,8 +44,9 @@ public void A_New_BackgroundBlock_Has_Background_Heading_On_First_Line() var backgroundBlock = new BackgroundBlock(scenario,mockStyle); var actualString = backgroundBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(expectedString, actualString[0]); - Assert.AreEqual(2, actualString.Length); + + Assert.That(expectedString, Is.EqualTo(actualString[0])); + Assert.That(2, Is.EqualTo(actualString.Length)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/Block_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/Block_Tests.cs index 56ac232e5..8f10851fe 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/Block_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/Block_Tests.cs @@ -35,7 +35,7 @@ public void ToString_Returns_Blocks_Markdown_Content() (mockBlock as MockBlock).Add("Hello, World"); - Assert.AreEqual("Hello, World"+Environment.NewLine, mockBlock.ToString()); + Assert.That("Hello, World"+Environment.NewLine, Is.EqualTo(mockBlock.ToString())); } [Test] @@ -46,7 +46,7 @@ public void Lines_Returns_A_Collection_Of_All_Block_Lines() (mockBlock as MockBlock).Add("Hello, World"); - Assert.AreEqual(1, mockBlock.Lines.Count); + Assert.That(1, Is.EqualTo(mockBlock.Lines.Count)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/FeatureBlock_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/FeatureBlock_Tests.cs index 16fd58c32..77513dd2c 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/FeatureBlock_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/FeatureBlock_Tests.cs @@ -44,8 +44,8 @@ public void A_New_FeatureBlock_Has_Feature_Heading_On_First_Line() var featureBlock = new FeatureBlock(feature,mockStyle); var actualString = featureBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(expectedString, actualString[0]); - Assert.AreEqual(3, actualString.Length); + Assert.That(expectedString, Is.EqualTo(actualString[0])); + Assert.That(3, Is.EqualTo(actualString.Length)); } [Test] @@ -67,11 +67,12 @@ public void When_Feature_Description_Available_It_Is_Placed_Below_Feature_Headin var featureBlock = new FeatureBlock(feature, mockStyle); var actualString = featureBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("FeatureHeading: Feature with description", actualString[0]); - Assert.AreEqual("In order to determine that world is flat", actualString[2]); - Assert.AreEqual("As a captain of a ship", actualString[4]); - Assert.AreEqual("I want to sail beyond the horizion", actualString[6]); - Assert.AreEqual(9, actualString.Length); + + Assert.That("FeatureHeading: Feature with description", Is.EqualTo(actualString[0])); + Assert.That("In order to determine that world is flat", Is.EqualTo(actualString[2])); + Assert.That("As a captain of a ship", Is.EqualTo(actualString[4])); + Assert.That("I want to sail beyond the horizion", Is.EqualTo(actualString[6])); + Assert.That(9, Is.EqualTo(actualString.Length)); } [Test] @@ -92,9 +93,9 @@ public void When_Feature_Tags_Available_They_Are_Placed_On_Single_Line_Before_He var featureBlock = new FeatureBlock(feature, mockStyle); var actualString = featureBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(">>>tagone<<< >>>tagtwo<<<", actualString[0]); - Assert.AreEqual("FeatureHeading: Feature with Tags", actualString[2]); - Assert.AreEqual(5, actualString.Length); + Assert.That(">>>tagone<<< >>>tagtwo<<<", Is.EqualTo(actualString[0])); + Assert.That("FeatureHeading: Feature with Tags", Is.EqualTo(actualString[2])); + Assert.That(5, Is.EqualTo(actualString.Length)); } [Test] @@ -114,9 +115,9 @@ public void When_Scenario_Is_Available_It_Is_Included_After_Heading() var featureBlock = new FeatureBlock(feature, mockStyle); var actualString = featureBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("FeatureHeading: Feature with Scenario", actualString[0]); - Assert.AreEqual("ScenarioHeading: My Scenario", actualString[2]); - Assert.AreEqual(5, actualString.Length); + Assert.That("FeatureHeading: Feature with Scenario", Is.EqualTo(actualString[0])); + Assert.That("ScenarioHeading: My Scenario", Is.EqualTo(actualString[2])); + Assert.That(5, Is.EqualTo(actualString.Length)); } [Test] @@ -137,10 +138,10 @@ public void When_Mutiple_Scenarios_Are_Available_They_Are_Included_After_Heading var featureBlock = new FeatureBlock(feature, mockStyle); var actualString = featureBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("FeatureHeading: Feature with Scenario", actualString[0]); - Assert.AreEqual("ScenarioHeading: My Scenario one", actualString[2]); - Assert.AreEqual("ScenarioHeading: My Scenario two", actualString[4]); - Assert.AreEqual(7, actualString.Length); + Assert.That("FeatureHeading: Feature with Scenario", Is.EqualTo(actualString[0])); + Assert.That("ScenarioHeading: My Scenario one", Is.EqualTo(actualString[2])); + Assert.That("ScenarioHeading: My Scenario two", Is.EqualTo(actualString[4])); + Assert.That(7, Is.EqualTo(actualString.Length)); } [Test] @@ -166,9 +167,9 @@ public void When_A_Background_Is_Present_Its_Included_In_Markdown_Output() i++; } - Assert.AreEqual("FeatureHeading: Feature with Background", results[0]); - Assert.AreEqual("BackgroundHeading:", results[2]); - Assert.AreEqual(3, results.Length); + Assert.That("FeatureHeading: Feature with Background", Is.EqualTo(results[0])); + Assert.That("BackgroundHeading:", Is.EqualTo(results[2])); + Assert.That(3, Is.EqualTo(results.Length)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/ScenarioBlock_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/ScenarioBlock_Tests.cs index e12883045..e0815d875 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/ScenarioBlock_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/ScenarioBlock_Tests.cs @@ -44,8 +44,8 @@ public void A_New_ScenarioBlock_Has_Scenario_Heading_On_First_Line() var scenarioBlock = new ScenarioBlock(scenario,mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(expectedString, actualString[0]); - Assert.AreEqual(2, actualString.Length); + Assert.That(expectedString, Is.EqualTo(actualString[0])); + Assert.That(2, Is.EqualTo(actualString.Length)); } [Test] @@ -66,9 +66,9 @@ public void When_Scenario_Tags_Available_They_Are_Placed_On_Single_Line_Before_H var scenarioBlock = new ScenarioBlock(scenario, mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(">>>tagone<<< >>>tagtwo<<<", actualString[0]); - Assert.AreEqual("ScenarioHeading: Scenario with Tags", actualString[2]); - Assert.AreEqual(4, actualString.Length); + Assert.That(">>>tagone<<< >>>tagtwo<<<", Is.EqualTo(actualString[0])); + Assert.That("ScenarioHeading: Scenario with Tags", Is.EqualTo(actualString[2])); + Assert.That(4, Is.EqualTo(actualString.Length)); } [Test] @@ -88,9 +88,9 @@ public void When_A_Scenario_Step_Is_Available_It_Is_Placed_On_Single_Line_After_ var scenarioBlock = new ScenarioBlock(scenario, mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("ScenarioHeading: Scenario with Step", actualString[0]); - Assert.AreEqual("Keyword: Natkey Step: I am a step", actualString[2]); - Assert.AreEqual(4, actualString.Length); + Assert.That("ScenarioHeading: Scenario with Step", Is.EqualTo(actualString[0])); + Assert.That("Keyword: Natkey Step: I am a step", Is.EqualTo(actualString[2])); + Assert.That(4, Is.EqualTo(actualString.Length)); } [Test] @@ -110,8 +110,8 @@ public void When_A_Scenario_Step_Has_A_Result__The_Result_Is_Included() var scenarioBlock = new ScenarioBlock(scenario, mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("ScenarioHeading: result Scenario with Step", actualString[0]); - Assert.AreEqual(2, actualString.Length); + Assert.That("ScenarioHeading: result Scenario with Step", Is.EqualTo(actualString[0])); + Assert.That(2, Is.EqualTo(actualString.Length)); } [Test] @@ -131,9 +131,9 @@ public void When_A_Scenario_Step_Is_Available_It_Has_Escape_Characters_For_Place var scenarioBlock = new ScenarioBlock(scenario, mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("ScenarioHeading: Scenario with placeholder Step", actualString[0]); - Assert.AreEqual(@"Keyword: Natkey Step: I am a \ step", actualString[2]); - Assert.AreEqual(4, actualString.Length); + Assert.That("ScenarioHeading: Scenario with placeholder Step", Is.EqualTo(actualString[0])); + Assert.That(@"Keyword: Natkey Step: I am a \ step", Is.EqualTo(actualString[2])); + Assert.That(4, Is.EqualTo(actualString.Length)); } [Test] @@ -174,13 +174,13 @@ public void Examples_Are_Included_As_Table() var scenarioBlock = new ScenarioBlock(scenario, mockStyle); var actualString = scenarioBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("ScenarioHeading: Scenario with Examples", actualString[0]); - Assert.AreEqual("ExampleHeading: My Examples", actualString[2]); - Assert.AreEqual("> | example | val_one | val_two |", actualString[4]); - Assert.AreEqual("> | --- | --- | --- |", actualString[5]); - Assert.AreEqual("> | ex.one | one.one | one.two |", actualString[6]); - Assert.AreEqual("> | ex.two | two.one | two.two |", actualString[7]); - Assert.AreEqual(9, actualString.Length); + Assert.That("ScenarioHeading: Scenario with Examples", Is.EqualTo(actualString[0])); + Assert.That("ExampleHeading: My Examples", Is.EqualTo(actualString[2])); + Assert.That("> | example | val_one | val_two |", Is.EqualTo(actualString[4])); + Assert.That("> | --- | --- | --- |", Is.EqualTo(actualString[5])); + Assert.That("> | ex.one | one.one | one.two |", Is.EqualTo(actualString[6])); + Assert.That("> | ex.two | two.one | two.two |", Is.EqualTo(actualString[7])); + Assert.That(9, Is.EqualTo(actualString.Length)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/StepBlock_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/StepBlock_Tests.cs index dd1a96fb2..a4ec1be65 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/StepBlock_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/StepBlock_Tests.cs @@ -40,8 +40,8 @@ public void The_Step_Is_Formatted() var stepBlock = new StepBlock(step, mockStyle); var actualString = stepBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("Keyword: Natkey Step: I am a step", actualString[0]); - Assert.AreEqual(2, actualString.Length); + Assert.That("Keyword: Natkey Step: I am a step", Is.EqualTo(actualString[0])); + Assert.That(2, Is.EqualTo(actualString.Length)); } [Test] @@ -63,13 +63,13 @@ public void A_Step_Table_Is_Formatted() var stepBlock = new StepBlock(step, mockStyle); var actualString = stepBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("Keyword: Natkey Step: I am a step", actualString[0]); - Assert.AreEqual(">", actualString[1]); - Assert.AreEqual("> | Col1 | Col2 |", actualString[2]); - Assert.AreEqual("> | --- | --- |", actualString[3]); - Assert.AreEqual("> | Col1Row1 | Col2Row1 |", actualString[4]); - Assert.AreEqual("> | Col1Row2 | Col2Row2 |", actualString[5]); - Assert.AreEqual(7, actualString.Length); + Assert.That("Keyword: Natkey Step: I am a step", Is.EqualTo(actualString[0])); + Assert.That(">", Is.EqualTo(actualString[1])); + Assert.That("> | Col1 | Col2 |", Is.EqualTo(actualString[2])); + Assert.That("> | --- | --- |", Is.EqualTo(actualString[3])); + Assert.That("> | Col1Row1 | Col2Row1 |", Is.EqualTo(actualString[4])); + Assert.That("> | Col1Row2 | Col2Row2 |", Is.EqualTo(actualString[5])); + Assert.That(7, Is.EqualTo(actualString.Length)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/TableBlock_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/TableBlock_Tests.cs index 70284a37c..0fad4706f 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/TableBlock_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Blocks_Tests/TableBlock_Tests.cs @@ -44,11 +44,11 @@ public void A_Table_Is_Formatted() var tableBlock = new TableBlock(table, mockStyle); var actualString = tableBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("> | Col1 | Col2 |", actualString[0]); - Assert.AreEqual("> | --- | --- |", actualString[1]); - Assert.AreEqual("> | Col1Row1 | Col2Row1 |", actualString[2]); - Assert.AreEqual("> | Col1Row2 | Col2Row2 |", actualString[3]); - Assert.AreEqual(5, actualString.Length); + Assert.That("> | Col1 | Col2 |", Is.EqualTo(actualString[0])); + Assert.That("> | --- | --- |", Is.EqualTo(actualString[1])); + Assert.That("> | Col1Row1 | Col2Row1 |", Is.EqualTo(actualString[2])); + Assert.That("> | Col1Row2 | Col2Row2 |", Is.EqualTo(actualString[3])); + Assert.That(5, Is.EqualTo(actualString.Length)); } [Test] @@ -67,11 +67,11 @@ public void A_Table_Is_Formatted_With_Placeholders() var tableBlock = new TableBlock(table, mockStyle); var actualString = tableBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("> | Col1 | Col2 |", actualString[0]); - Assert.AreEqual("> | --- | --- |", actualString[1]); - Assert.AreEqual(@"> | Col1Row1 | \ |", actualString[2]); - Assert.AreEqual(@"> | \ | Col2Row2 |", actualString[3]); - Assert.AreEqual(5, actualString.Length); + Assert.That("> | Col1 | Col2 |", Is.EqualTo(actualString[0])); + Assert.That("> | --- | --- |", Is.EqualTo(actualString[1])); + Assert.That(@"> | Col1Row1 | \ |", Is.EqualTo(actualString[2])); + Assert.That(@"> | \ | Col2Row2 |", Is.EqualTo(actualString[3])); + Assert.That(5, Is.EqualTo(actualString.Length)); } [Test] @@ -92,13 +92,13 @@ public void A_Table_Is_Formatted_With_Results() var tableBlock = new TableBlock(table, mockStyle, true); var actualString = tableBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual("> | Col1 | Col2 | Result |", actualString[0]); - Assert.AreEqual("> | --- | --- | --- |", actualString[1]); - Assert.AreEqual("> | Col1Row1 | Col2Row1 | ![Passed](pass.png) |", actualString[2]); - Assert.AreEqual("> | Col1Row2 | Col2Row2 | ![Failed](fail.png) |", actualString[3]); - Assert.AreEqual("> | Col1Row3 | Col2Row3 | ![Inconclusive](inconclusive.png) |", actualString[4]); - Assert.AreEqual("> | Col1Row4 | Col2Row4 | |", actualString[5]); - Assert.AreEqual(7, actualString.Length); + Assert.That("> | Col1 | Col2 | Result |", Is.EqualTo(actualString[0])); + Assert.That("> | --- | --- | --- |", Is.EqualTo(actualString[1])); + Assert.That("> | Col1Row1 | Col2Row1 | ![Passed](pass.png) |", Is.EqualTo(actualString[2])); + Assert.That("> | Col1Row2 | Col2Row2 | ![Failed](fail.png) |", Is.EqualTo(actualString[3])); + Assert.That("> | Col1Row3 | Col2Row3 | ![Inconclusive](inconclusive.png) |", Is.EqualTo(actualString[4])); + Assert.That("> | Col1Row4 | Col2Row4 | |", Is.EqualTo(actualString[5])); + Assert.That(7, Is.EqualTo(actualString.Length)); } private void AddRowWithResult(Table table,string[] data, TestResult result) diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Documentation_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Documentation_Tests.cs index 974cd4817..6b77d4654 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Documentation_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Documentation_Tests.cs @@ -40,8 +40,10 @@ public void New_Documentation_Produces_Default_Single_Page() var actualPageCount = documentation.PageCount; var actualPage = documentation.CurrentPage; - Assert.AreEqual(1, documentation.PageCount); - Assert.Contains("# Features", actualPage.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)); + Assert.That(1, Is.EqualTo(documentation.PageCount)); + Assert.That( + actualPage.Split(new string[] { Environment.NewLine }, StringSplitOptions.None), + Has.Member("# Features")); } [Test] @@ -50,7 +52,7 @@ public void New_Documentation_With_Feature_Produces_Single_Page() var simpleFeature = new Feature(); simpleFeature.Name = "My Feature"; var relPath = "fakedir"; - var location = fileSystem.FileInfo.FromFileName(@"c:\"); + var location = fileSystem.FileInfo.New(@"c:\"); var newNode = new FeatureNode(location, relPath, simpleFeature); var featureTree = new Tree(new FolderNode(location, relPath)); featureTree.Add(newNode); @@ -59,9 +61,10 @@ public void New_Documentation_With_Feature_Produces_Single_Page() var actualPageCount = documentation.PageCount; var actualPage = documentation.CurrentPage.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - Assert.AreEqual(1, documentation.PageCount); - Assert.Contains("# Features", actualPage); - Assert.Contains("### My Feature", actualPage); + Assert.That(1, Is.EqualTo(documentation.PageCount)); + + Assert.That(actualPage, Has.Member("# Features")); + Assert.That(actualPage, Has.Member("### My Feature")); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Lines_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Lines_Tests.cs index a58e8a110..b47b45a34 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Lines_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Lines_Tests.cs @@ -31,7 +31,7 @@ public void An_Empty_Lines_Object_Has_No_Lines() { var lines = new Lines(); - Assert.AreEqual(0, lines.Count); + Assert.That(0, Is.EqualTo(lines.Count)); } [Test] @@ -41,7 +41,7 @@ public void Adding_A_Line_Increases_Count() lines.Add("Hello, World"); - Assert.AreEqual(1, lines.Count); + Assert.That(1, Is.EqualTo(lines.Count)); } [Test] @@ -56,8 +56,8 @@ public void Adding_A_Lines_Object_Together_Combines_Them() lines.Add(moreLines); - Assert.AreEqual(3, lines.Count); - Assert.AreEqual(2, moreLines.Count); + Assert.That(3, Is.EqualTo(lines.Count)); + Assert.That(2, Is.EqualTo(moreLines.Count)); } [Test] @@ -67,7 +67,7 @@ public void Converting_Lines_Object_To_String_Returns_All_Lines_With_NewLine_Sep lines.Add("Hello"); lines.Add("World"); - Assert.AreEqual($"Hello{Environment.NewLine}World{Environment.NewLine}", lines.ToString()); + Assert.That($"Hello{Environment.NewLine}World{Environment.NewLine}", Is.EqualTo(lines.ToString())); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Localization_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Localization_Tests.cs index 9f6a5d5d6..237628f8d 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Localization_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Localization_Tests.cs @@ -30,9 +30,9 @@ public void Localization_Has_String_For_Title() { var title = Localization.Title; - Assert.IsNotNull(title); - Assert.IsNotEmpty(title); - Assert.AreEqual("Features", title); + Assert.That(title, Is.Not.Null); + Assert.That(title, Is.Not.Empty); + Assert.That("Features", Is.EqualTo(title)); } [Test] @@ -40,9 +40,9 @@ public void Localization_Has_String_For_GenerationDateTime() { var generationDateTime = Localization.GenerationDateTime; - Assert.IsNotNull(generationDateTime); - Assert.IsNotEmpty(generationDateTime); - Assert.AreEqual("Generated on: {0:dd MMMM yyyy} at {0:H:mm:ss}", generationDateTime); + Assert.That(generationDateTime, Is.Not.Null); + Assert.That(generationDateTime, Is.Not.Empty); + Assert.That("Generated on: {0:dd MMMM yyyy} at {0:H:mm:ss}", Is.EqualTo(generationDateTime)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/MarkdownDocumentationBuilder_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/MarkdownDocumentationBuilder_Tests.cs index 2cd1444a4..f0edd5229 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/MarkdownDocumentationBuilder_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/MarkdownDocumentationBuilder_Tests.cs @@ -43,7 +43,7 @@ public void New_MarkdownDocumentationBuilder_Is_An_Implementation_Of_IDocumentat var documentationBuilder = new MarkdownDocumentationBuilder(filesystem, configuration); - Assert.IsInstanceOf(documentationBuilder); + Assert.That(documentationBuilder, Is.InstanceOf()); } [Test] @@ -53,7 +53,7 @@ public void Autofac_Can_Resolve_MarkdownDocumentationBuilder_Request() var markdownDocumentationBuilder = container.Resolve(); - Assert.IsNotNull(markdownDocumentationBuilder); + Assert.That(markdownDocumentationBuilder, Is.Not.Null); } [Test] @@ -66,12 +66,12 @@ public void When_I_Build_Documentation_A_File_Is_Created() var fileSystem = (MockFileSystem)container.Resolve(); var defaultOutputFile = fileSystem.Path.Combine("output","features.md"); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(outputFolder); + configuration.OutputFolder = fileSystem.DirectoryInfo.New(outputFolder); var markdownDocumentationBuilder = container.Resolve(); markdownDocumentationBuilder.Build(null); - Assert.IsTrue(fileSystem.FileExists(defaultOutputFile)); + Assert.That(fileSystem.FileExists(defaultOutputFile), Is.True); } [Test] @@ -82,14 +82,14 @@ public void When_I_Build_Documentation_Icon_Files_Are_Created() var container = BuildContainer(); var configuration = container.Resolve(); var fileSystem = (MockFileSystem)container.Resolve(); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(outputFolder); + configuration.OutputFolder = fileSystem.DirectoryInfo.New(outputFolder); var markdownDocumentationBuilder = container.Resolve(); markdownDocumentationBuilder.Build(null); - Assert.IsTrue(fileSystem.FileExists(fileSystem.Path.Combine("output","pass.png"))); - Assert.IsTrue(fileSystem.FileExists(fileSystem.Path.Combine("output","fail.png"))); - Assert.IsTrue(fileSystem.FileExists(fileSystem.Path.Combine("output","inconclusive.png"))); + Assert.That(fileSystem.FileExists(fileSystem.Path.Combine("output", "pass.png")), Is.True); + Assert.That(fileSystem.FileExists(fileSystem.Path.Combine("output", "fail.png")), Is.True); + Assert.That(fileSystem.FileExists(fileSystem.Path.Combine("output", "inconclusive.png")), Is.True); } [Test] @@ -108,7 +108,7 @@ public void With_A_Null_Tree_The_Output_Has_Default_Content() var fileSystem = (MockFileSystem)container.Resolve(); var defaultOutputFile = fileSystem.Path.Combine("output","features.md"); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(outputFolder); + configuration.OutputFolder = fileSystem.DirectoryInfo.New(outputFolder); var markdownDocumentationBuilder = container.Resolve(); markdownDocumentationBuilder.Build(null); @@ -140,13 +140,13 @@ public void With_A_Simple_Feature_The_Output_Has_Default_Content() var fileSystem = (MockFileSystem)container.Resolve(); var defaultOutputFile = fileSystem.Path.Combine("output", "features.md"); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(outputFolder); + configuration.OutputFolder = fileSystem.DirectoryInfo.New(outputFolder); var markdownDocumentationBuilder = container.Resolve(); var simpleFeature = new Feature(); simpleFeature.Name = "Simple Feature"; var relPath = "fakedir"; - var location = fileSystem.FileInfo.FromFileName(fileSystem.Directory.GetCurrentDirectory()); + var location = fileSystem.FileInfo.New(fileSystem.Directory.GetCurrentDirectory()); var newNode = new FeatureNode(location, relPath, simpleFeature); var featureTree = new Tree(new FolderNode(location, relPath)); featureTree.Add(newNode); diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Pickles.DocumentationBuilders.Markdown.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Pickles.DocumentationBuilders.Markdown.UnitTests.csproj index f72e5a020..6ce4feed8 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Pickles.DocumentationBuilders.Markdown.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Pickles.DocumentationBuilders.Markdown.UnitTests.csproj @@ -1,8 +1,8 @@ - + PicklesDoc.Pickles.DocumentationBuilders.Markdown.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Markdown.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Markdown.UnitTests Unit tests for the Pickles output formatter that outputs Markdown documents bin\$(Configuration)\ @@ -27,13 +27,13 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Stylist_Tests.cs b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Stylist_Tests.cs index 2188d8d9b..4bb06aaea 100644 --- a/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Stylist_Tests.cs +++ b/src/Pickles.DocumentationBuilders.Markdown.UnitTests/Stylist_Tests.cs @@ -34,7 +34,7 @@ public void A_Stylist_Can_Style_A_Title() var actualStyle = style.AsTitle("Title"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -45,7 +45,7 @@ public void A_Stylist_Can_Style_A_Feature_Heading() var actualStyle = style.AsFeatureHeading("My Styled Feature"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -56,7 +56,7 @@ public void A_Stylist_Can_Style_A_Background_Heading() var actualStyle = style.AsBackgroundHeading("My Styled Background"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -67,7 +67,7 @@ public void A_Stylist_Can_Style_A_Background_Heading_Without_A_Name() var actualStyle = style.AsBackgroundHeading(null); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -78,7 +78,7 @@ public void A_Stylist_Can_Style_A_Scenario_Heading() var actualStyle = style.AsScenarioHeading("My Styled Scenario"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -89,7 +89,7 @@ public void A_Stylist_Can_Style_A_Scenario_Heading_With_Result() var actualStyle = style.AsScenarioHeading("My Styled Scenario", TestResult.Passed); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -100,7 +100,7 @@ public void A_Stylist_Can_Style_A_ScenarioOutline_Heading() var actualStyle = style.AsScenarioOutlineHeading("My Styled Scenario Outline"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -111,7 +111,7 @@ public void A_Stylist_Can_Style_An_Example_Heading() var actualStyle = style.AsExampleHeading("My Styled Example"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -122,7 +122,7 @@ public void A_Stylist_Can_Style_An_Example_Heading_Without_A_Name() var actualStyle = style.AsExampleHeading(string.Empty); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -133,7 +133,7 @@ public void A_Stylist_Can_Style_A_Tag() var actualStyle = style.AsTag("@Tag"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -144,7 +144,7 @@ public void A_Stylist_Can_Style_A_Step() var actualStyle = style.AsStep("Keyword", "Step"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -155,7 +155,7 @@ public void A_Stylist_Can_Style_A_Step_With_Angle_Brakets() var actualStyle = style.AsStep("Keyword", "Step "); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -166,7 +166,7 @@ public void A_Stylist_Can_Style_A_Step_Table() var actualStyle = style.AsStepTable("{0}HeadingOne{0}HeadingTwo{0}"); - Assert.AreEqual(expectedStyle, actualStyle); + Assert.That(expectedStyle, Is.EqualTo(actualStyle)); } [Test] @@ -174,8 +174,8 @@ public void A_Stylist_Can_Style_A_StepLine() { var style = new Stylist(); - Assert.AreEqual(">", style.AsStepLine(string.Empty)); - Assert.AreEqual("> Text", style.AsStepLine("Text")); + Assert.That(">", Is.EqualTo(style.AsStepLine(string.Empty))); + Assert.That("> Text", Is.EqualTo(style.AsStepLine("Text"))); } [Test] @@ -183,9 +183,9 @@ public void A_Stylist_Can_Style_A_Result() { var style = new Stylist(); - Assert.AreEqual("![Passed](pass.png)", style.AsResult(TestResult.Passed)); - Assert.AreEqual("![Failed](fail.png)", style.AsResult(TestResult.Failed)); - Assert.AreEqual("![Inconclusive](inconclusive.png)", style.AsResult(TestResult.Inconclusive)); + Assert.That("![Passed](pass.png)", Is.EqualTo(style.AsResult(TestResult.Passed))); + Assert.That("![Failed](fail.png)", Is.EqualTo(style.AsResult(TestResult.Failed))); + Assert.That("![Inconclusive](inconclusive.png)", Is.EqualTo(style.AsResult(TestResult.Inconclusive))); } [Test] @@ -193,7 +193,7 @@ public void A_Stylist_Can_Style_A_Table_Result_Heading() { var style = new Stylist(); - Assert.AreEqual("Result", style.TableResultHeading); + Assert.That("Result", Is.EqualTo(style.TableResultHeading)); } } } diff --git a/src/Pickles.DocumentationBuilders.Markdown/MarkdownDocumentationBuilder.cs b/src/Pickles.DocumentationBuilders.Markdown/MarkdownDocumentationBuilder.cs index 89d6163a4..c09ef3d25 100644 --- a/src/Pickles.DocumentationBuilders.Markdown/MarkdownDocumentationBuilder.cs +++ b/src/Pickles.DocumentationBuilders.Markdown/MarkdownDocumentationBuilder.cs @@ -45,7 +45,7 @@ public MarkdownDocumentationBuilder(IFileSystem fileSystem, IConfiguration confi if (configuration.OutputFolder == null) { - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName("testing"); + configuration.OutputFolder = fileSystem.DirectoryInfo.New("testing"); } if(!configuration.OutputFolder.Exists) configuration.OutputFolder.Create(); @@ -67,7 +67,7 @@ public void Build(Tree featureTree) // TODO: new class handles file system interaction private void WriteContentToFile(string filePath, string content) { - using (var file = fileSystem.FileInfo.FromFileName(filePath).CreateText()) + using (var file = fileSystem.FileInfo.New(filePath).CreateText()) { file.Write(content); diff --git a/src/Pickles.DocumentationBuilders.Markdown/Pickles.DocumentationBuilders.Markdown.csproj b/src/Pickles.DocumentationBuilders.Markdown/Pickles.DocumentationBuilders.Markdown.csproj index 427ee41c2..ef9633342 100644 --- a/src/Pickles.DocumentationBuilders.Markdown/Pickles.DocumentationBuilders.Markdown.csproj +++ b/src/Pickles.DocumentationBuilders.Markdown/Pickles.DocumentationBuilders.Markdown.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Markdown PicklesDoc.Pickles.DocumentationBuilders.Markdown - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Markdown A Pickles output formatter that outputs Markdown documents bin\$(Configuration)\ @@ -34,12 +34,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + \ No newline at end of file diff --git a/src/Pickles.DocumentationBuilders.Word.UnitTests/Pickles.DocumentationBuilders.Word.UnitTests.csproj b/src/Pickles.DocumentationBuilders.Word.UnitTests/Pickles.DocumentationBuilders.Word.UnitTests.csproj index c4eb9aea1..e349cf744 100644 --- a/src/Pickles.DocumentationBuilders.Word.UnitTests/Pickles.DocumentationBuilders.Word.UnitTests.csproj +++ b/src/Pickles.DocumentationBuilders.Word.UnitTests/Pickles.DocumentationBuilders.Word.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Word.UnitTests PicklesDoc.Pickles.DocumentationBuilders.Word.UnitTests - net6.0 + net10.0 Pickles.DocumentationBuilders.Word.UnitTests Unit Tests for the Pickles output formatter that outputs MS Word documents bin\$(Configuration)\ @@ -21,9 +21,9 @@ - - - + + + diff --git a/src/Pickles.DocumentationBuilders.Word.UnitTests/WhenBuildingWordDocuments.cs b/src/Pickles.DocumentationBuilders.Word.UnitTests/WhenBuildingWordDocuments.cs index 39d702a39..3fd44c938 100644 --- a/src/Pickles.DocumentationBuilders.Word.UnitTests/WhenBuildingWordDocuments.cs +++ b/src/Pickles.DocumentationBuilders.Word.UnitTests/WhenBuildingWordDocuments.cs @@ -51,11 +51,11 @@ public WhenBuildingWordDocuments() [SetUp] public void Setup() { - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(RootPath); + var rootPath = FileSystem.DirectoryInfo.New(RootPath); AddFakeFolderStructures(); - Configuration.OutputFolder = this.FileSystem.DirectoryInfo.FromDirectoryName(FileSystemPrefix); + Configuration.OutputFolder = this.FileSystem.DirectoryInfo.New(FileSystemPrefix); this.features = Container.Resolve().Crawl(rootPath, new ParsingReport()); this.builder = Container.Resolve(); } diff --git a/src/Pickles.DocumentationBuilders.Word/Pickles.DocumentationBuilders.Word.csproj b/src/Pickles.DocumentationBuilders.Word/Pickles.DocumentationBuilders.Word.csproj index d4be734c3..b2c58894a 100644 --- a/src/Pickles.DocumentationBuilders.Word/Pickles.DocumentationBuilders.Word.csproj +++ b/src/Pickles.DocumentationBuilders.Word/Pickles.DocumentationBuilders.Word.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.DocumentationBuilders.Word PicklesDoc.Pickles.DocumentationBuilders.Word - netstandard2.0 + net10.0 Pickles.DocumentationBuilders.Word A Pickles output formatter that outputs MS Word documents bin\$(Configuration)\ @@ -24,17 +24,17 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/src/Pickles.MSBuild/Pickles.MSBuild.csproj b/src/Pickles.MSBuild/Pickles.MSBuild.csproj index b461fc8db..a91c27e8f 100644 --- a/src/Pickles.MSBuild/Pickles.MSBuild.csproj +++ b/src/Pickles.MSBuild/Pickles.MSBuild.csproj @@ -3,7 +3,7 @@ 8.0.30703 PicklesDoc.Pickles.MSBuild PicklesDoc.Pickles.MSBuild.Tasks - netstandard2.0 + net10.0 ..\..\Pickles\ Pickles.MSBuild @@ -65,10 +65,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Pickles.MSBuild/Pickles.cs b/src/Pickles.MSBuild/Pickles.cs index d7edfc3e7..f9793cedc 100644 --- a/src/Pickles.MSBuild/Pickles.cs +++ b/src/Pickles.MSBuild/Pickles.cs @@ -88,8 +88,8 @@ public override bool Execute() private void CaptureConfiguration(IConfiguration configuration, IFileSystem fileSystem) { - configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.FeatureDirectory); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.OutputDirectory); + configuration.FeatureFolder = fileSystem.DirectoryInfo.New(this.FeatureDirectory); + configuration.OutputFolder = fileSystem.DirectoryInfo.New(this.OutputDirectory); if (!string.IsNullOrEmpty(this.Language)) { configuration.Language = this.Language; diff --git a/src/Pickles.ObjectModel/Pickles.ObjectModel.csproj b/src/Pickles.ObjectModel/Pickles.ObjectModel.csproj index 31bdf1d75..8b5282875 100644 --- a/src/Pickles.ObjectModel/Pickles.ObjectModel.csproj +++ b/src/Pickles.ObjectModel/Pickles.ObjectModel.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles PicklesDoc.Pickles.ObjectModel - netstandard2.0 + net10.0 PicklesDoc.Pickles.ObjectModel The object model for Pickles bin\$(Configuration)\ @@ -14,11 +14,11 @@ pdbonly - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + \ No newline at end of file diff --git a/src/Pickles.PowerShell/Pickle_Features.cs b/src/Pickles.PowerShell/Pickle_Features.cs index 965c1aaf7..ce9f35ef9 100644 --- a/src/Pickles.PowerShell/Pickle_Features.cs +++ b/src/Pickles.PowerShell/Pickle_Features.cs @@ -155,11 +155,11 @@ private IDirectoryInfo DetermineFeatureFolder(IFileSystem fileSystem, PathInfo c if (fileSystem.Path.IsPathRooted(directory)) { - result = fileSystem.DirectoryInfo.FromDirectoryName(directory); + result = fileSystem.DirectoryInfo.New(directory); } else { - result = fileSystem.DirectoryInfo.FromDirectoryName( + result = fileSystem.DirectoryInfo.New( fileSystem.Path.Combine(currentFileSystemLocation.Path, directory)); } diff --git a/src/Pickles.PowerShell/Pickles.PowerShell.csproj b/src/Pickles.PowerShell/Pickles.PowerShell.csproj index 4570990f4..1965cc726 100644 --- a/src/Pickles.PowerShell/Pickles.PowerShell.csproj +++ b/src/Pickles.PowerShell/Pickles.PowerShell.csproj @@ -3,7 +3,7 @@ 8.0.30703 PicklesDoc.Pickles.PowerShell PicklesDoc.Pickles.PowerShell - netstandard2.0 + net10.0 ..\..\Pickles\ Pickles.PowerShell @@ -60,10 +60,10 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/src/Pickles.Test/DirectoryCrawlers/FolderDirectoryTreeNodeTests.cs b/src/Pickles.Test/DirectoryCrawlers/FolderDirectoryTreeNodeTests.cs index 9fd33130d..0c43a264f 100644 --- a/src/Pickles.Test/DirectoryCrawlers/FolderDirectoryTreeNodeTests.cs +++ b/src/Pickles.Test/DirectoryCrawlers/FolderDirectoryTreeNodeTests.cs @@ -35,7 +35,7 @@ public class FolderDirectoryTreeNodeTests : BaseFixture [Test] public void Constructor_ValidFileSystemInfo_SetsOriginalLocation() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName(@"temp"); + var directoryInfo = FileSystem.DirectoryInfo.New(@"temp"); var node = new FolderNode(directoryInfo, ""); @@ -45,7 +45,7 @@ public void Constructor_ValidFileSystemInfo_SetsOriginalLocation() [Test] public void Constructor_ValidFileSystemInfo_SetsOriginalLocationUrl() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName(@"temp"); + var directoryInfo = FileSystem.DirectoryInfo.New(@"temp"); var node = new FolderNode(directoryInfo, ""); @@ -55,7 +55,7 @@ public void Constructor_ValidFileSystemInfo_SetsOriginalLocationUrl() [Test] public void Constructor_ValidRelativePath() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"); var node = new FolderNode(directoryInfo, "../"); @@ -65,7 +65,7 @@ public void Constructor_ValidRelativePath() [Test] public void GetRelativeUriTo_DirectoryToChildDirectory_ReturnsRelativePath() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"); var node = new FolderNode(directoryInfo, "../"); var uri =FileSystem.Path.Combine(directoryInfo.FullName,"child").ToFolderUri(); @@ -77,7 +77,7 @@ public void GetRelativeUriTo_DirectoryToChildDirectory_ReturnsRelativePath() [Test] public void GetRelativeUriTo_DirectoryToFileBelow_ReturnsCurrentDirectory() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"); var node = new FolderNode(directoryInfo, "../"); @@ -90,11 +90,11 @@ public void GetRelativeUriTo_DirectoryToFileBelow_ReturnsCurrentDirectory() [Test] public void GetRelativeUriTo_DirectoryToFileOutside_ReturnsRelativePath() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"); var node = new FolderNode(directoryInfo, "../"); - var uri =FileSystem.Path.Combine(FileSystem.DirectoryInfo.FromDirectoryName("temp2").FullName,"test2.html").ToFileUri(); + var uri =FileSystem.Path.Combine(FileSystem.DirectoryInfo.New("temp2").FullName,"test2.html").ToFileUri(); string relative = node.GetRelativeUriTo(uri); Check.That(relative).IsEqualTo("../temp/"); @@ -103,11 +103,11 @@ public void GetRelativeUriTo_DirectoryToFileOutside_ReturnsRelativePath() [Test] public void GetRelativeUriTo_DirectoryToParentDirectory_ReturnsRelativePath() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Path.Combine("temp","child")); + var directoryInfo = FileSystem.DirectoryInfo.New(FileSystem.Path.Combine("temp","child")); var node = new FolderNode(directoryInfo, "../"); - var uri = FileSystem.DirectoryInfo.FromDirectoryName("temp").FullName.ToFolderUri(); + var uri = FileSystem.DirectoryInfo.New("temp").FullName.ToFolderUri(); string relative = node.GetRelativeUriTo(uri); Check.That(relative).IsEqualTo("child/"); @@ -116,11 +116,11 @@ public void GetRelativeUriTo_DirectoryToParentDirectory_ReturnsRelativePath() [Test] public void GetRelativeUriTo_FileToDirectory_ReturnsNodesFileName() { - var fileInfo = FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine("temp","test1.html")); + var fileInfo = FileSystem.FileInfo.New(FileSystem.Path.Combine("temp","test1.html")); var node = new FolderNode(fileInfo, "../"); - var uri = FileSystem.FileInfo.FromFileName("temp").FullName.ToFolderUri(); + var uri = FileSystem.FileInfo.New("temp").FullName.ToFolderUri(); string relative = node.GetRelativeUriTo(uri); Check.That(relative).IsEqualTo("test1.html"); @@ -129,11 +129,11 @@ public void GetRelativeUriTo_FileToDirectory_ReturnsNodesFileName() [Test] public void GetRelativeUriTo_FileToFile_ReturnsNodesFileName() { - var fileInfo = FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine("temp","test1.html")); + var fileInfo = FileSystem.FileInfo.New(FileSystem.Path.Combine("temp","test1.html")); var node = new FolderNode(fileInfo, "../"); - var uri = FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine("temp","test2.html")).FullName.ToFileUri(); + var uri = FileSystem.FileInfo.New(FileSystem.Path.Combine("temp","test2.html")).FullName.ToFileUri(); string relative = node.GetRelativeUriTo(uri); Check.That(relative).IsEqualTo("test1.html"); @@ -143,13 +143,13 @@ public void GetRelativeUriTo_FileToFile_ReturnsNodesFileName() public void RealData() { var originalLocation = - FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Path.Combine( + FileSystem.DirectoryInfo.New(FileSystem.Path.Combine( "tfs","Dev.CAX","src","CAX_Main","src","net","Projects","Aim.Gain.GoldenCopy.FunctionalTesting","CAX","DistributionOfRights")); var node = new FolderNode(originalLocation, ""); var uri = - FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Path.Combine("tfs", "Dev.CAX", "src", "CAX_Main", "src", "net", "Projects", + FileSystem.DirectoryInfo.New(FileSystem.Path.Combine("tfs", "Dev.CAX", "src", "CAX_Main", "src", "net", "Projects", "Aim.Gain.GoldenCopy.FunctionalTesting", "CAX")).FullName.ToFolderUri(); string relative = node.GetRelativeUriTo(uri); diff --git a/src/Pickles.Test/DirectoryCrawlers/ImageFileDetectorTests.cs b/src/Pickles.Test/DirectoryCrawlers/ImageFileDetectorTests.cs index 55df8a532..ebe803deb 100644 --- a/src/Pickles.Test/DirectoryCrawlers/ImageFileDetectorTests.cs +++ b/src/Pickles.Test/DirectoryCrawlers/ImageFileDetectorTests.cs @@ -54,7 +54,7 @@ public void IsRelevant_ValidFile_ReturnsTrue(string imageName) ImageFileDetector fileDetector = CreateImageFileDetector(); var fileSystem = new MockFileSystem(); - var file = fileSystem.FileInfo.FromFileName(imageName); + var file = fileSystem.FileInfo.New(imageName); bool isRelevant = fileDetector.IsRelevant(file); @@ -67,7 +67,7 @@ public void IsRelevant_InvalidFile_ReturnsFalse() ImageFileDetector fileDetector = CreateImageFileDetector(); var fileSystem = new MockFileSystem(); - var file = fileSystem.FileInfo.FromFileName("image.pdf"); + var file = fileSystem.FileInfo.New("image.pdf"); bool isRelevant = fileDetector.IsRelevant(file); @@ -80,7 +80,7 @@ public void IsRelevant_ValidFileWithMixedCaseExtension_ReturnsTrue() ImageFileDetector fileDetector = CreateImageFileDetector(); var fileSystem = new MockFileSystem(); - var file = fileSystem.FileInfo.FromFileName("image.PnG"); + var file = fileSystem.FileInfo.New("image.PnG"); bool isRelevant = fileDetector.IsRelevant(file); diff --git a/src/Pickles.Test/DirectoryCrawlers/RelevantFileDetectorTests.cs b/src/Pickles.Test/DirectoryCrawlers/RelevantFileDetectorTests.cs index 91f8ff949..19789ac78 100644 --- a/src/Pickles.Test/DirectoryCrawlers/RelevantFileDetectorTests.cs +++ b/src/Pickles.Test/DirectoryCrawlers/RelevantFileDetectorTests.cs @@ -34,7 +34,7 @@ public void IsRelevant_ImageFileInfo_ReturnsTrue() var fileDetector = new RelevantFileDetector(); var fileSystem = new MockFileSystem(); - var file = fileSystem.FileInfo.FromFileName("image.png"); + var file = fileSystem.FileInfo.New("image.png"); bool isRelevant = fileDetector.IsRelevant(file); diff --git a/src/Pickles.Test/Extensions/UriExtensionsTests.cs b/src/Pickles.Test/Extensions/UriExtensionsTests.cs index ad388c9b2..f394a477e 100644 --- a/src/Pickles.Test/Extensions/UriExtensionsTests.cs +++ b/src/Pickles.Test/Extensions/UriExtensionsTests.cs @@ -32,7 +32,7 @@ public class UriExtensionsTests : BaseFixture [Test] public void ToFileUriCombined_ValidIntput_ValidOutput() { - var info = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var info = FileSystem.DirectoryInfo.New("temp"); Uri uri = info.ToFileUriCombined("test.txt", FileSystem); @@ -66,7 +66,7 @@ public void ToFolderUriString_WithoutTrailingSlash_ValidOutputWithTrailingSlash( [Test] public void ToUriDirectoryInfo_WithTrailingSlash_ProducesUriWithTrailingSlash() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"+Path.DirectorySeparatorChar); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"+Path.DirectorySeparatorChar); Uri uri = directoryInfo.ToUri(); @@ -76,7 +76,7 @@ public void ToUriDirectoryInfo_WithTrailingSlash_ProducesUriWithTrailingSlash() [Test] public void ToUriDirectoryInfo_WithoutTrailingSlash_ProducesUriWithTrailingSlash() { - var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var directoryInfo = FileSystem.DirectoryInfo.New("temp"); Uri uri = directoryInfo.ToUri(); @@ -86,7 +86,7 @@ public void ToUriDirectoryInfo_WithoutTrailingSlash_ProducesUriWithTrailingSlash [Test] public void ToUriFileInfo_NormalFilename_ProducesUri() { - var fileInfo = FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine("temp","test.txt")); + var fileInfo = FileSystem.FileInfo.New(FileSystem.Path.Combine("temp","test.txt")); Uri uri = fileInfo.ToUri(); @@ -96,7 +96,7 @@ public void ToUriFileInfo_NormalFilename_ProducesUri() [Test] public void ToUriFileSystemInfo_DirectoryWithTrailingSlash_ProducesUriWithTrailingSlash() { - var fsi = FileSystem.DirectoryInfo.FromDirectoryName("temp"); + var fsi = FileSystem.DirectoryInfo.New("temp"); Uri uri = fsi.ToUri(); @@ -106,7 +106,7 @@ public void ToUriFileSystemInfo_DirectoryWithTrailingSlash_ProducesUriWithTraili [Test] public void ToUriFileSystemInfo_FileInfo_ProducesUri() { - var fsi = FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine("temp","test.txt")); + var fsi = FileSystem.FileInfo.New(FileSystem.Path.Combine("temp","test.txt")); Uri uri = fsi.ToUri(); diff --git a/src/Pickles.Test/FeatureNodeFactoryTests.cs b/src/Pickles.Test/FeatureNodeFactoryTests.cs index ee9c283af..43029b390 100644 --- a/src/Pickles.Test/FeatureNodeFactoryTests.cs +++ b/src/Pickles.Test/FeatureNodeFactoryTests.cs @@ -42,7 +42,7 @@ public void Create_InvalidFeatureFile_AddsEntryToReport() var report = new ParsingReport(); - featureNodeFactory.Create(null, FileSystem.FileInfo.FromFileName(@"test.feature"), report); + featureNodeFactory.Create(null, FileSystem.FileInfo.New(@"test.feature"), report); Check.That(report.First()).Contains(@"test.feature"); } @@ -56,7 +56,7 @@ public void Create_MarkdownParsingError_AddsEntryToReport() var report = new ParsingReport(); - var fileInfo = FileSystem.FileInfo.FromFileName(@"test.md"); + var fileInfo = FileSystem.FileInfo.New(@"test.md"); featureNodeFactory.Create(null, fileInfo, report); Check.That(report.Count).Equals(1); @@ -89,7 +89,7 @@ public void Create_InvalidFileType_AddsEntryToReport() var report = new ParsingReport(); - featureNodeFactory.Create(null, FileSystem.FileInfo.FromFileName(@"c:\test.dll"), report); + featureNodeFactory.Create(null, FileSystem.FileInfo.New(@"c:\test.dll"), report); Check.That(report.First()).Contains(@"c:\test.dll"); } @@ -109,6 +109,33 @@ public void Create_BogusLocationType_AddsEntryToReport() private class BogusIFileSystemInfo : System.IO.Abstractions.IFileSystemInfo { internal string fullName; + public IFileSystem FileSystem => throw new NotImplementedException(); + + public FileAttributes Attributes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DateTime CreationTime { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DateTime CreationTimeUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public bool Exists => throw new NotImplementedException(); + + public string Extension => throw new NotImplementedException(); + + public string FullName => fullName; + + public DateTime LastAccessTime { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DateTime LastAccessTimeUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DateTime LastWriteTime { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DateTime LastWriteTimeUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public string LinkTarget => throw new NotImplementedException(); + + public string Name => throw new NotImplementedException(); + + public UnixFileMode UnixFileMode { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public void CreateAsSymbolicLink(string pathToTarget) + { + throw new NotImplementedException(); + } public void Delete() { @@ -120,26 +147,10 @@ public void Refresh() throw new NotImplementedException(); } - public IFileSystem FileSystem { get; set; } - - public FileAttributes Attributes { get; set; } - public DateTime CreationTime { get; set; } - public DateTime CreationTimeUtc { get; set; } - public bool Exists { get; } - public string Extension { get; } - - public string FullName + public IFileSystemInfo ResolveLinkTarget(bool returnFinalTarget) { - get { return this.fullName; } + throw new NotImplementedException(); } - - public DateTime LastAccessTime { get; set; } - public DateTime LastAccessTimeUtc { get; set; } - public DateTime LastWriteTime { get; set; } - public DateTime LastWriteTimeUtc { get; set; } - public string Name { get; } - - public string LinkTarget => throw new NotImplementedException(); } private class MockMarkdownProvider : IMarkdownProvider diff --git a/src/Pickles.Test/FileSystemBasedFeatureParserTests.cs b/src/Pickles.Test/FileSystemBasedFeatureParserTests.cs index 7848f1258..17611595f 100644 --- a/src/Pickles.Test/FileSystemBasedFeatureParserTests.cs +++ b/src/Pickles.Test/FileSystemBasedFeatureParserTests.cs @@ -35,7 +35,7 @@ public void Parse_InvalidFeatureFile_ThrowsFeatureParseExceptionWithFilename() { var filePath =FileSystem.Path.Combine("temp","featurefile.feature"); FileSystem.AddFile(filePath, new MockFileData("Invalid feature file")); - var fileInfo=FileSystem.FileInfo.FromFileName(filePath); + var fileInfo=FileSystem.FileInfo.New(filePath); var parser = new FileSystemBasedFeatureParser(new FeatureParser(Configuration), FileSystem); Check.ThatCode(() => parser.Parse(filePath)).Throws() diff --git a/src/Pickles.Test/FileSystemExtensions.cs b/src/Pickles.Test/FileSystemExtensions.cs index a2a0e04e4..8ba577694 100644 --- a/src/Pickles.Test/FileSystemExtensions.cs +++ b/src/Pickles.Test/FileSystemExtensions.cs @@ -26,7 +26,7 @@ public static class FileSystemExtensions { public static IDirectoryInfo GetOrCreateDirectory(this IFileSystem fileSystem, string directory) { - var directoryInfo = fileSystem.DirectoryInfo.FromDirectoryName(directory); + var directoryInfo = fileSystem.DirectoryInfo.New(directory); if(!directoryInfo.Exists) directoryInfo.Create(); return directoryInfo; diff --git a/src/Pickles.Test/Formatters/HtmlContentFormatterTests.cs b/src/Pickles.Test/Formatters/HtmlContentFormatterTests.cs index 373125d1f..b87f3f305 100644 --- a/src/Pickles.Test/Formatters/HtmlContentFormatterTests.cs +++ b/src/Pickles.Test/Formatters/HtmlContentFormatterTests.cs @@ -54,7 +54,7 @@ public void Format_ContentIsFeatureNode_UsesHtmlFeatureFormatterWithCorrectArgum var formatter = new HtmlContentFormatter(fakeHtmlFeatureFormatter, new HtmlIndexFormatter()); var featureNode = new FeatureNode( - FileSystem.FileInfo.FromFileName(@"c:\temp\test.feature"), + FileSystem.FileInfo.New(@"c:\temp\test.feature"), ".", new Feature()); diff --git a/src/Pickles.Test/Formatters/HtmlDocumentationBuilderTests.cs b/src/Pickles.Test/Formatters/HtmlDocumentationBuilderTests.cs index d1cefc0f9..42c2ef206 100644 --- a/src/Pickles.Test/Formatters/HtmlDocumentationBuilderTests.cs +++ b/src/Pickles.Test/Formatters/HtmlDocumentationBuilderTests.cs @@ -39,12 +39,12 @@ public HtmlDocumentationBuilderTests() [Test] public void ShouldNotBlowUpWHenParsingEmptyFolder() { - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(RootPath); + var rootPath = FileSystem.DirectoryInfo.New(RootPath); this.AddFakeFolderStructures(); var configuration = this.Configuration; - configuration.OutputFolder = this.FileSystem.DirectoryInfo.FromDirectoryName(FileSystemPrefix); + configuration.OutputFolder = this.FileSystem.DirectoryInfo.New(FileSystemPrefix); var features = Container.Resolve().Crawl(rootPath, new ParsingReport()); var builder = Container.Resolve(); diff --git a/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfo.cs b/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfo.cs index 49c6c6f92..a4ee4f764 100644 --- a/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfo.cs +++ b/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfo.cs @@ -47,7 +47,7 @@ public WhenCreatingAFeatureWithMetaInfo() public void Setup() { this.testFeature = new Feature { Name = "Test" }; - this.featureFileInfo = this.FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine(RootPath, FeaturePath)); + this.featureFileInfo = this.FileSystem.FileInfo.New(FileSystem.Path.Combine(RootPath, FeaturePath)); this.featureDirectoryNode = new FeatureNode(this.featureFileInfo, RelativePath, this.testFeature); this.featureWithMeta = new JsonFeatureWithMetaInfo(this.featureDirectoryNode, new LanguageServicesRegistry()); diff --git a/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs b/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs index 03491cb83..51048d6df 100644 --- a/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs +++ b/src/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs @@ -41,7 +41,7 @@ public class WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat : BaseF public string Setup() { string OutputDirectoryName =FileSystem.Path.Combine(FileSystemPrefix,"JSONFeatureOutput"); - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Path.Combine(FileSystemPrefix,"JSON","Features")); + var rootPath = FileSystem.DirectoryInfo.New(FileSystem.Path.Combine(FileSystemPrefix,"JSON","Features")); var TestResultFilePath = FileSystem.Path.Combine(FileSystemPrefix,"JSON","results-example-failing-and-pasing-mstest.trx"); @@ -63,7 +63,7 @@ public string Setup() Tree features = Container.Resolve().Crawl(rootPath, new ParsingReport()); - var outputDirectory = FileSystem.DirectoryInfo.FromDirectoryName(OutputDirectoryName); + var outputDirectory = FileSystem.DirectoryInfo.New(OutputDirectoryName); if (!outputDirectory.Exists) { outputDirectory.Create(); @@ -71,13 +71,13 @@ public string Setup() var configuration = new Configuration { - OutputFolder = FileSystem.DirectoryInfo.FromDirectoryName(OutputDirectoryName), + OutputFolder = FileSystem.DirectoryInfo.New(OutputDirectoryName), DocumentationFormat = DocumentationFormat.Json, TestResultsFormat = TestResultsFormat.MsTest, SystemUnderTestName = "SUT Name", SystemUnderTestVersion = "SUT Version" }; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName(TestResultFilePath)); + configuration.AddTestResultFile(FileSystem.FileInfo.New(TestResultFilePath)); ITestResults testResults = new MsTestResults(configuration, new MsTestSingleResultLoader(), new MsTestScenarioExampleMatcher()); var jsonDocumentationBuilder = new JsonDocumentationBuilder(configuration, testResults, FileSystem, new LanguageServicesRegistry()); diff --git a/src/Pickles.Test/Formatters/JSON/WhenFormattingAFolderStructureWithFeatures.cs b/src/Pickles.Test/Formatters/JSON/WhenFormattingAFolderStructureWithFeatures.cs index 2791f0b0d..5bd0ed78b 100644 --- a/src/Pickles.Test/Formatters/JSON/WhenFormattingAFolderStructureWithFeatures.cs +++ b/src/Pickles.Test/Formatters/JSON/WhenFormattingAFolderStructureWithFeatures.cs @@ -40,13 +40,13 @@ public WhenFormattingAFolderStructureWithFeatures() } public void Setup() { - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(FileSystemPrefix); + var rootPath = FileSystem.DirectoryInfo.New(FileSystemPrefix); this.AddFakeFolderStructures(); Tree features = Container.Resolve().Crawl(rootPath, new ParsingReport()); - var outputDirectory = FileSystem.DirectoryInfo.FromDirectoryName(OutputDirectory); + var outputDirectory = FileSystem.DirectoryInfo.New(OutputDirectory); if (!outputDirectory.Exists) { outputDirectory.Create(); @@ -54,7 +54,7 @@ public void Setup() var configuration = new Configuration { - OutputFolder = FileSystem.DirectoryInfo.FromDirectoryName(OutputDirectory), + OutputFolder = FileSystem.DirectoryInfo.New(OutputDirectory), DocumentationFormat = DocumentationFormat.Json }; diff --git a/src/Pickles.Test/Formatters/TableOfContentsShouldBeCreatedFromAFolderStructure.cs b/src/Pickles.Test/Formatters/TableOfContentsShouldBeCreatedFromAFolderStructure.cs index 085b0eb49..a47945adc 100644 --- a/src/Pickles.Test/Formatters/TableOfContentsShouldBeCreatedFromAFolderStructure.cs +++ b/src/Pickles.Test/Formatters/TableOfContentsShouldBeCreatedFromAFolderStructure.cs @@ -46,7 +46,7 @@ public TableOfContentsShouldBeCreatedFromAFolderStructure() } public void Setup() { - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(RootPath); + var rootPath = FileSystem.DirectoryInfo.New(RootPath); this.AddFakeFolderStructures(); @@ -56,7 +56,7 @@ public void Setup() this.toc = formatter.Format( features.ChildNodes[0].Data.OriginalLocationUrl, features, - FileSystem.DirectoryInfo.FromDirectoryName(RootPath)); + FileSystem.DirectoryInfo.New(RootPath)); } [Test] diff --git a/src/Pickles.Test/ObjectModel/Factory.cs b/src/Pickles.Test/ObjectModel/Factory.cs index 99c59430a..4aa45310b 100644 --- a/src/Pickles.Test/ObjectModel/Factory.cs +++ b/src/Pickles.Test/ObjectModel/Factory.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.Test.ObjectModel { internal class Factory { - private const G.Location AnyLocation = null; + private G.Location? AnyLocation = null; internal Mapper CreateMapper(string defaultLanguage = "en") { @@ -45,13 +45,16 @@ internal Mapper CreateMapper(IConfiguration configuration, string defaultLanguag internal G.TableCell CreateGherkinTableCell(string cellValue) { - return new G.TableCell(AnyLocation, cellValue); + // Ici, on récupère la valeur de AnyLocation ou un Location par défaut (ex: default(G.Location)) + var location = AnyLocation ?? default(G.Location); + return new G.TableCell(location, cellValue); } internal G.DocString CreateDocString(string docString = null) { + var location = AnyLocation ?? default(G.Location); return new G.DocString( - AnyLocation, + location, null, docString ?? @"My doc string line 1 My doc string line 2"); @@ -59,40 +62,45 @@ internal G.DocString CreateDocString(string docString = null) internal G.TableRow CreateGherkinTableRow(params string[] cellValues) { + var location = AnyLocation ?? default(G.Location); return new G.TableRow( - AnyLocation, + location, cellValues.Select(this.CreateGherkinTableCell).ToArray()); } internal G.DataTable CreateGherkinDataTable(IEnumerable rows) { - return new G.DataTable(rows.Select(this.CreateGherkinTableRow).ToArray()); + return new G.DataTable(rows.Select(this.CreateGherkinTableRow).ToList()); } internal G.Step CreateStep(string keyword, string text) { - return new G.Step(AnyLocation, keyword, text, null); + var location = AnyLocation ?? default(G.Location); + return new G.Step(location, keyword, Gherkin.StepKeywordType.Unspecified, text, null); } internal G.Step CreateStep(string keyword, string text, int locationLine, int locationColumn) { - var step = new G.Step(this.CreateLocation(locationLine, locationColumn), keyword, text, null); + var step = new G.Step(this.CreateLocation(locationLine, locationColumn), keyword, Gherkin.StepKeywordType.Unspecified, text, null); return step; } internal G.Step CreateStep(string keyword, string text, string docString) { - return new G.Step(AnyLocation, keyword, text, this.CreateDocString(docString)); + var location = AnyLocation ?? default(G.Location); + return new G.Step(location, keyword, Gherkin.StepKeywordType.Unspecified, text, this.CreateDocString(docString)); } internal G.Step CreateStep(string keyword, string text, IEnumerable rows) { - return new G.Step(AnyLocation, keyword, text, this.CreateGherkinDataTable(rows)); + var location = AnyLocation ?? default(G.Location); + return new G.Step(location, keyword, Gherkin.StepKeywordType.Unspecified, text, this.CreateGherkinDataTable(rows)); } internal G.Tag CreateTag(string tag) { - return new G.Tag(AnyLocation, tag); + var location = AnyLocation ?? default(G.Location); + return new G.Tag(location, tag); } internal G.Location CreateLocation(int line, int column) @@ -105,11 +113,12 @@ internal G.Comment CreateComment(string comment, int locationLine, int locationC return new G.Comment(this.CreateLocation(locationLine, locationColumn), comment); } - internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null) + internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location? location = null) { + var location2 = location ?? default(G.Location); G.Scenario scenario = new G.Scenario( tags.Select(this.CreateTag).ToArray(), - location ?? AnyLocation, + location2, "Scenario", name, description, @@ -120,9 +129,11 @@ internal G.Scenario CreateScenario(string[] tags, string name, string descriptio internal G.Examples CreateExamples(string name, string description, string[] headerCells, IEnumerable exampleRows, string[] tags = null) { + + var location = AnyLocation ?? default(G.Location); var examples = new G.Examples( tags?.Select(this.CreateTag).ToArray(), - AnyLocation, + location, "Examples", name, description, @@ -134,9 +145,10 @@ internal G.Examples CreateExamples(string name, string description, string[] hea internal G.Scenario CreateScenarioOutline(string[] tags, string name, string description, G.Step[] steps, G.Examples[] examples) { + var location = AnyLocation ?? default(G.Location); G.Scenario scenarioOutline = new G.Scenario( tags.Select(this.CreateTag).ToArray(), - AnyLocation, + location, "Scenario", name, description, @@ -147,8 +159,9 @@ internal G.Scenario CreateScenarioOutline(string[] tags, string name, string des internal G.Background CreateBackground(string name, string description, G.Step[] steps) { + var location = AnyLocation ?? default(G.Location); G.Background background = new G.Background( - AnyLocation, + location, "Background", name, description, @@ -156,14 +169,15 @@ internal G.Background CreateBackground(string name, string description, G.Step[] return background; } - internal G.GherkinDocument CreateGherkinDocument(string name, string description, string[] tags = null, G.Background background = null, G.IHasLocation [] scenarioDefinitions = null, G.Comment[] comments = null, G.Location location = null, string language = null) + internal G.GherkinDocument CreateGherkinDocument(string name, string description, string[] tags = null, G.Background background = null, G.IHasLocation [] scenarioDefinitions = null, G.Comment[] comments = null, G.Location? location = null, string language = null) { var nonNullScenarioDefinitions = scenarioDefinitions ?? new G.IHasLocation[0]; + var location2 = location ?? default(G.Location); return new G.GherkinDocument( new G.Feature( (tags ?? new string[0]).Select(this.CreateTag).ToArray(), - location, + location2, language, "Feature", name, diff --git a/src/Pickles.Test/ObjectModel/MapperTestsForDataTable.cs b/src/Pickles.Test/ObjectModel/MapperTestsForDataTable.cs index 733a870b9..c22306c60 100644 --- a/src/Pickles.Test/ObjectModel/MapperTestsForDataTable.cs +++ b/src/Pickles.Test/ObjectModel/MapperTestsForDataTable.cs @@ -47,7 +47,7 @@ public void MapToStringTableCell_NullTableCell_ReturnsNull() { var mapper = factory.CreateMapper(); - string result = mapper.MapToString((G.TableCell)null); + string result = mapper.MapToString((G.TableCell?)null); Check.That(result).IsNull(); } diff --git a/src/Pickles.Test/ObjectModel/MapperTestsForStep.cs b/src/Pickles.Test/ObjectModel/MapperTestsForStep.cs index 2ee25a1a1..793fcd9de 100644 --- a/src/Pickles.Test/ObjectModel/MapperTestsForStep.cs +++ b/src/Pickles.Test/ObjectModel/MapperTestsForStep.cs @@ -55,7 +55,8 @@ public void MapToStep_StepWithoutArgument_ReturnStep() Check.That(result.Name).IsEqualTo("I enter '50' in the calculator"); Check.That(result.DocStringArgument).IsNull(); Check.That(result.TableArgument).IsNull(); - Check.That(result.Location).IsNull(); + Check.That(result.Location.Line).IsEqualTo(0); + Check.That(result.Location.Column).IsEqualTo(0); Check.That(result.Comments).IsEmpty(); } @@ -73,7 +74,8 @@ public void MapToStep_StepWithWhen_ReturnStep() Check.That(result.Name).IsEqualTo("I press 'enter'"); Check.That(result.DocStringArgument).IsNull(); Check.That(result.TableArgument).IsNull(); - Check.That(result.Location).IsNull(); + Check.That(result.Location.Line).IsEqualTo(0); + Check.That(result.Location.Column).IsEqualTo(0); Check.That(result.Comments).IsEmpty(); } @@ -111,7 +113,8 @@ public void MapToStep_StepWithDocStringArgument_ReturnStepWithDocString() Check.That(result.Name).IsEqualTo("I see this value on the screen"); Check.That(result.DocStringArgument).IsEqualTo("120"); Check.That(result.TableArgument).IsNull(); - Check.That(result.Location).IsNull(); + Check.That(result.Location.Line).IsEqualTo(0); + Check.That(result.Location.Column).IsEqualTo(0); Check.That(result.Comments).IsEmpty(); } @@ -138,7 +141,8 @@ public void MapToStep_StepWithTableArgument_ReturnStepWithTable() Check.That(result.TableArgument.DataRows).HasSize(1); Check.That(result.TableArgument.DataRows[0].Cells).ContainsExactly("Value 1", "Value 2"); Check.That(result.DocStringArgument).IsNull(); - Check.That(result.Location).IsNull(); + Check.That(result.Location.Line).IsEqualTo(0); + Check.That(result.Location.Column).IsEqualTo(0); Check.That(result.Comments).IsEmpty(); } diff --git a/src/Pickles.Test/Pickles.Test.csproj b/src/Pickles.Test/Pickles.Test.csproj index cd24b1411..0a3ee1690 100644 --- a/src/Pickles.Test/Pickles.Test.csproj +++ b/src/Pickles.Test/Pickles.Test.csproj @@ -3,7 +3,7 @@ 8.0.30703 PicklesDoc.Pickles.Test PicklesDoc.Pickles.Test - net6.0 + net10.0 ..\ Pickles.Test Unit and integration tests for Pickles @@ -81,16 +81,16 @@ - + - - - - - - - - + + + + + + + + diff --git a/src/Pickles.Test/WhenCrawlingFoldersForFeatures.cs b/src/Pickles.Test/WhenCrawlingFoldersForFeatures.cs index d571d00e3..5c4807b1e 100644 --- a/src/Pickles.Test/WhenCrawlingFoldersForFeatures.cs +++ b/src/Pickles.Test/WhenCrawlingFoldersForFeatures.cs @@ -37,7 +37,7 @@ public void Then_can_crawl_all_folders_including_subfolders_for_features_success { this.AddFakeFolderStructures(); - var rootPath = FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Path.Combine(FileSystemPrefix,"FeatureCrawlerTests")); + var rootPath = FileSystem.DirectoryInfo.New(FileSystem.Path.Combine(FileSystemPrefix,"FeatureCrawlerTests")); Tree features = Container.Resolve().Crawl(rootPath, new ParsingReport()); Check.That(features).IsNotNull(); diff --git a/src/Pickles.Test/WhenDeterminingRelevantFilesToConsider.cs b/src/Pickles.Test/WhenDeterminingRelevantFilesToConsider.cs index 06a92bf4c..ad3905320 100644 --- a/src/Pickles.Test/WhenDeterminingRelevantFilesToConsider.cs +++ b/src/Pickles.Test/WhenDeterminingRelevantFilesToConsider.cs @@ -33,21 +33,21 @@ public class WhenDeterminingRelevantFilesToConsider : BaseFixture public void ThenCanDetectFeatureFilesSuccessfully() { var relevantFileDetector = Container.Resolve(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.feature"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.markdown"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.mdown"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.mkdn"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.md"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.mdwn"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.mdtext"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.mdtxt"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.text"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.txt"))).IsTrue(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.pdf"))).IsFalse(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.doc"))).IsFalse(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.docx"))).IsFalse(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("test.docx"))).IsFalse(); - Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.FromFileName("myproject.csproj.FileListAbsolute.txt"))).IsFalse(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.feature"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.markdown"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.mdown"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.mkdn"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.md"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.mdwn"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.mdtext"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.mdtxt"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.text"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.txt"))).IsTrue(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.pdf"))).IsFalse(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.doc"))).IsFalse(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.docx"))).IsFalse(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("test.docx"))).IsFalse(); + Check.That(relevantFileDetector.IsRelevant(FileSystem.FileInfo.New("myproject.csproj.FileListAbsolute.txt"))).IsFalse(); } } } diff --git a/src/Pickles.Test/WhenWorkingWithHtmlResources.cs b/src/Pickles.Test/WhenWorkingWithHtmlResources.cs index 19b66c424..d24ae543e 100644 --- a/src/Pickles.Test/WhenWorkingWithHtmlResources.cs +++ b/src/Pickles.Test/WhenWorkingWithHtmlResources.cs @@ -45,7 +45,7 @@ public void ThenCanDetectAllImagesSuccessfully() private HtmlResourceSet CreateHtmlResourceSet() { - var configuration = new Configuration { OutputFolder = FileSystem.DirectoryInfo.FromDirectoryName(@"c:\") }; + var configuration = new Configuration { OutputFolder = FileSystem.DirectoryInfo.New(@"c:\") }; var htmlResources = new HtmlResourceSet(configuration, FileSystem); return htmlResources; } diff --git a/src/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 760d8ced4..be356d4ad 100644 --- a/src/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.TestFrameworks.UnitTests PicklesDoc.Pickles.TestFrameworks.UnitTests - net6.0 + net10.0 PicklesDoc.Pickles.TestFrameworks.UnitTests Unit tests for the supported test frameworks for inputting test results to Pickles bin\$(Configuration)\ @@ -111,8 +111,8 @@ - - - + + + \ No newline at end of file diff --git a/src/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs b/src/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs index b2230fd86..f93afb815 100644 --- a/src/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs +++ b/src/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs @@ -62,7 +62,7 @@ protected void AddTestResultsToConfiguration() var configuration = Container.Resolve(); - configuration.AddTestResultFiles(this.resultsFileNames.Select(f => FileSystem.FileInfo.FromFileName(f))); + configuration.AddTestResultFiles(this.resultsFileNames.Select(f => FileSystem.FileInfo.New(f))); } } } diff --git a/src/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index 3f667121b..18d8d2e26 100644 --- a/src/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -98,7 +98,7 @@ private void SetConfiguration(string example, TestResultsFormat format) { var configuration = this.Container.Resolve(); configuration.TestResultsFormat = format; - configuration.AddTestResultFiles(new[] { this.FileSystem.FileInfo.FromFileName(example) }); + configuration.AddTestResultFiles(new[] { this.FileSystem.FileInfo.New(example) }); } } } diff --git a/src/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 954d27c8e..55b9ac344 100644 --- a/src/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -2,7 +2,7 @@ PicklesDoc.Pickles.TestFrameworks PicklesDoc.Pickles.TestFrameworks - netstandard2.0 + net10.0 PicklesDoc.Pickles.TestFrameworks Supported test frameworks for inputting test results to Pickles bin\$(Configuration)\ @@ -33,11 +33,11 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/src/Pickles/CultureAwareDialectProvider.cs b/src/Pickles/CultureAwareDialectProvider.cs index 35d196bd7..cb3e4ea84 100644 --- a/src/Pickles/CultureAwareDialectProvider.cs +++ b/src/Pickles/CultureAwareDialectProvider.cs @@ -33,7 +33,7 @@ public CultureAwareDialectProvider(string defaultLanguage) : base(defaultLanguag /// We need to override only this method. The overload without /// Dictionary internally calls this method. - public override GherkinDialect GetDialect(string language, Location location) + public override GherkinDialect GetDialect(string language, Location? location) { GherkinDialect result; diff --git a/src/Pickles/EncodingDetector.cs b/src/Pickles/EncodingDetector.cs index 55a020d6d..8172c4f28 100644 --- a/src/Pickles/EncodingDetector.cs +++ b/src/Pickles/EncodingDetector.cs @@ -23,7 +23,7 @@ public Encoding GetEncoding(string filename) if (this.fileSystem.File.Exists(filename)) { var bom = new byte[4]; - using (var file = this.fileSystem.FileInfo.FromFileName(filename).OpenRead()) + using (var file = this.fileSystem.FileInfo.New(filename).OpenRead()) { file.Read(bom, 0, 4); } diff --git a/src/Pickles/Extensions/FileSystemExtensions.cs b/src/Pickles/Extensions/FileSystemExtensions.cs index 0c6566a86..08c900620 100644 --- a/src/Pickles/Extensions/FileSystemExtensions.cs +++ b/src/Pickles/Extensions/FileSystemExtensions.cs @@ -28,8 +28,8 @@ public static class FileSystemExtensions public static Uri GetUri(this IFileSystem fileSystem, string path) { if(fileSystem.Directory.Exists(path)) - return fileSystem.DirectoryInfo.FromDirectoryName(path).FullName.ToFolderUri(); - return fileSystem.FileInfo.FromFileName(path).FullName.ToFileUri(); + return fileSystem.DirectoryInfo.New(path).FullName.ToFolderUri(); + return fileSystem.FileInfo.New(path).FullName.ToFileUri(); } } } \ No newline at end of file diff --git a/src/Pickles/Extensions/PathExtensions.cs b/src/Pickles/Extensions/PathExtensions.cs index 9a2fdf4e5..65f9fb0a2 100644 --- a/src/Pickles/Extensions/PathExtensions.cs +++ b/src/Pickles/Extensions/PathExtensions.cs @@ -83,7 +83,7 @@ public static IEnumerable GetAllFilesFromPathAndFileNameWithOptionalS var files = fileFullName.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); return files.SelectMany(f => GetAllFilesFromPathAndFileNameWithOptionalWildCards(f, fileSystem)) .Distinct() - .Select(f => fileSystem.FileInfo.FromFileName(f)); + .Select(f => fileSystem.FileInfo.New(f)); } } diff --git a/src/Pickles/FileSystemBasedFeatureParser.cs b/src/Pickles/FileSystemBasedFeatureParser.cs index 8798e5fff..c40d3bbd3 100644 --- a/src/Pickles/FileSystemBasedFeatureParser.cs +++ b/src/Pickles/FileSystemBasedFeatureParser.cs @@ -45,7 +45,7 @@ public Feature Parse(string filename) { Feature feature = null; var encoding = this.encodingDetector.GetEncoding(filename); - using (var fileStream = this.fileSystem.FileInfo.FromFileName(filename).OpenRead()) + using (var fileStream = this.fileSystem.FileInfo.New(filename).OpenRead()) { var specificEncoderReader = new StreamReader(fileStream, encoding); diff --git a/src/Pickles/ObjectModel/Mapper.cs b/src/Pickles/ObjectModel/Mapper.cs index 81a4f39f3..167a562cb 100644 --- a/src/Pickles/ObjectModel/Mapper.cs +++ b/src/Pickles/ObjectModel/Mapper.cs @@ -43,7 +43,12 @@ public Mapper(IConfiguration configuration, ILanguageServices languageServices) public string MapToString(G.TableCell cell) { - return cell?.Value; + return cell.Value; + } + + public string MapToString(G.TableCell? cell) + { + return cell.HasValue ? cell.Value.Value : null; // Exemple } public TableRow MapToTableRow(G.TableRow tableRow) @@ -185,9 +190,9 @@ public Comment MapToComment(G.Comment comment) }; } - public Location MapToLocation(G.Location location) + public Location MapToLocation(G.Location? location) { - return location != null ? new Location { Column = location.Column, Line = location.Line } : null; + return location.HasValue ? new Location { Column = location.Value.Column, Line = location.Value.Line } : null; } public Scenario MapToScenario(G.Scenario scenario, params string[] tagsToHide) diff --git a/src/Pickles/Pickles.csproj b/src/Pickles/Pickles.csproj index aa54f16fa..d4d267a50 100644 --- a/src/Pickles/Pickles.csproj +++ b/src/Pickles/Pickles.csproj @@ -3,7 +3,7 @@ 8.0.30703 PicklesDoc.Pickles Pickles.Library - netstandard2.0 + net10.0 Apache-2.0 ..\ Pickles @@ -50,21 +50,21 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + - + diff --git a/src/markdowndeep/markdowndeep.csproj b/src/markdowndeep/markdowndeep.csproj index 49adbf8c7..9890d9840 100644 --- a/src/markdowndeep/markdowndeep.csproj +++ b/src/markdowndeep/markdowndeep.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + net10.0 markdowndeep markdowndeep Copyright © 2021 @@ -13,11 +13,11 @@ pdbonly - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file