From b072d7abb08da61e19da8780aa386f865d3a5674 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 20 Jul 2018 20:14:25 +0200 Subject: [PATCH] Version 2.19.0 --- CHANGELOG.md | 12 + build.bat | 2 +- docs/Output/Dhtml/pickledFeatures.js | 4 +- docs/Output/Excel/features.xlsx | Bin 38739 -> 38739 bytes .../Features/00BasicGherkin/BasicGherkin.html | 6 +- .../Html/Features/00BasicGherkin/index.html | 6 +- .../TestRunnerIsNotImportant.html | 6 +- .../Html/Features/01TestRunner/index.html | 6 +- .../Html/Features/02TagsAndHooks/Hooks.html | 6 +- .../Html/Features/02TagsAndHooks/TagDemo.html | 6 +- .../Html/Features/02TagsAndHooks/index.html | 6 +- .../031ScenarioContext/ScenarioContext.html | 6 +- .../Features/031ScenarioContext/index.html | 6 +- .../FeatureContextFeatures.html | 6 +- .../Features/032FeatureContext/index.html | 6 +- .../03ScenarioOutline/ScenarioOutline.html | 6 +- .../Features/03ScenarioOutline/index.html | 6 +- .../04Background/BackgroundFeature.html | 6 +- .../Html/Features/04Background/index.html | 6 +- .../05TablesAndAssist/TableScenario.html | 6 +- .../Features/05TablesAndAssist/index.html | 6 +- .../Features/06CompareToAssist/CompareTo.html | 6 +- .../Features/06CompareToAssist/index.html | 6 +- .../Html/Features/07Localization/Svenska.html | 6 +- .../Html/Features/07Localization/Vlaams.html | 6 +- .../Html/Features/07Localization/index.html | 6 +- .../AttributeOverloading.html | 6 +- .../08AttributeOverloading/index.html | 6 +- .../CallingStepsFromSteps.html | 6 +- .../09CallingStepsFromSteps/index.html | 6 +- .../StepTransformation.html | 6 +- .../Features/10StepTransformation/index.html | 6 +- .../11ContextInjection/ContextInjection.html | 6 +- .../Features/11ContextInjection/index.html | 6 +- .../ChildChildFolder/NestedFolderExample.html | 6 +- .../ChildFolder/ChildChildFolder/index.html | 6 +- .../12NestedFolders/ChildFolder/index.html | 6 +- .../Html/Features/12NestedFolders/index.html | 6 +- .../MultilineFeatureExample.html | 6 +- .../Html/Features/13MultilineText/index.html | 6 +- .../14MarkdownExample/MarkdownExamples.html | 6 +- .../Features/14MarkdownExample/index.html | 6 +- .../15Pickles/InteractiveDHTMLView.html | 6 +- .../Output/Html/Features/15Pickles/index.html | 6 +- docs/Output/Html/Features/Arithmetic.html | 6 +- docs/Output/Html/Features/Trigonometry.html | 6 +- .../Features/Workflow/ClearingScreen.html | 6 +- docs/Output/Html/Features/Workflow/index.html | 6 +- docs/Output/Html/Features/index.html | 6 +- docs/Output/Html/index.html | 6 +- docs/Output/Html/readme.html | 6 +- docs/Output/JSON/pickledFeatures.json | 4 +- docs/Output/Word/Pickles.docx | Bin 14062 -> 14065 bytes docs/Output/Word/features.docx | Bin 14048 -> 14047 bytes docs/index.html | 2 +- .../WhenParsingCommandLineArguments.cs | 189 ++--------- .../CommandLineArgumentParser.cs | 45 ++- src/Pickles/Pickles.CommandLine/NLog.xsd | 22 +- ...ocumentationBuilders.Json.UnitTests.csproj | 18 +- .../app.config | 7 +- .../packages.config | 3 + src/Pickles/Pickles.MSBuild/Pickles.cs | 7 + .../Pickles.ObjectModel/IConfiguration.cs | 1 + .../Pickles.PowerShell/Pickle_Features.cs | 31 +- src/Pickles/Pickles.Test/BaseFixture.cs | 4 +- .../LevelOneRemoveTagsToHide.feature | 13 + src/Pickles/Pickles.Test/Pickles.Test.csproj | 5 + .../WhenCrawlingFoldersForFeatures.cs | 10 +- .../Pickles.Test/WhenParsingFeatureFiles.cs | 81 ++++- .../WhenResolvingADocumentationBuilder.cs | 71 ++-- .../StandardTestSuite.cs | 8 +- .../StandardTestSuiteForScenarioOutlines.cs | 26 +- ...gVsTestResultsFileWithIndividualResults.cs | 6 + .../WhenResolvingTestResults.cs | 315 +++--------------- .../VsTestScenarioOutlineExampleMatcher.cs | 23 +- .../XUnit2ScenarioOutlineExampleMatcher.cs | 16 +- .../Pickles.UserInterface/MainWindow.xaml | 46 +-- src/Pickles/Pickles.UserInterface/NLog.xsd | 22 +- .../Settings/MainModel.cs | 4 + .../ViewModel/MainViewModel.cs | 14 +- ...xts.cs => CommandLineArgumentHelpTexts.cs} | 5 +- src/Pickles/Pickles/Configuration.cs | 2 + src/Pickles/Pickles/ConfigurationReporter.cs | 1 + src/Pickles/Pickles/FeatureFilter.cs | 47 +++ src/Pickles/Pickles/FeatureParser.cs | 17 +- src/Pickles/Pickles/ObjectModel/Mapper.cs | 46 ++- src/Pickles/Pickles/Pickles.csproj | 3 +- src/Pickles/VersionInfo.cs | 8 +- 88 files changed, 677 insertions(+), 745 deletions(-) create mode 100644 src/Pickles/Pickles.Test/FakeFolderStructures/FeatureCrawlerTests/LevelOneRemoveTagsToHide.feature rename src/Pickles/Pickles/{CommandLinArgumentHelpTexts.cs => CommandLineArgumentHelpTexts.cs} (90%) create mode 100644 src/Pickles/Pickles/FeatureFilter.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d94ecb60..ee10c0a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,18 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Security +## [2.19.0] - 2018-07-20 + +### Added + +- Hide Tags from Living Documentation ([516](https://github.com/picklesdoc/pickles/pull/516)) (by [@spacehole1](https://github.com/spacehole1)) +- Exclude Feature Files that have no included scenarios ([453](https://github.com/picklesdoc/pickles/issues/453)) (by [@janosmagyar](https://github.com/janosmagyar)) + +### Fixed + +- Scenario Outline special characters workaround ([509](https://github.com/picklesdoc/pickles/pull/509)) (by [@DominikBaran](https://github.com/DominikBaran)) +- Fix example matching for VSTest ([528](https://github.com/picklesdoc/pickles/pull/528)) (by [@jvandertil](https://github.com/jvandertil)) + ## [2.18.2] - 2018-04-28 ### Changed diff --git a/build.bat b/build.bat index 79b45ef10..a0825c98f 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off -set "picklesVersion=2.18.2" +set "picklesVersion=2.19.0" cls diff --git a/docs/Output/Dhtml/pickledFeatures.js b/docs/Output/Dhtml/pickledFeatures.js index 1c15c2ecb..a40ef7078 100644 --- a/docs/Output/Dhtml/pickledFeatures.js +++ b/docs/Output/Dhtml/pickledFeatures.js @@ -3133,7 +3133,7 @@ jsonPWrapper ({ }, "Configuration": { "SutName": "Pickles", - "SutVersion": "2.18.1", - "GeneratedOn": "20 April 2018 22:33:00" + "SutVersion": "2.19.0", + "GeneratedOn": "20 Juli 2018 19:39:00" } }); \ No newline at end of file diff --git a/docs/Output/Excel/features.xlsx b/docs/Output/Excel/features.xlsx index 1c0ea039d5202a82bf7bc7581cd0e8b8e35451d7..9635a6ea7657ef01b70b4257d3ee5d1c71480031 100644 GIT binary patch delta 1047 zcmcb-j_L9`Cf)#VW)=|!1_lm>hjYGc@+$1GAQAt7H&PG2dH7BtoGe565BeS5`4#gRpS=p{IGXveR z`3~nZAu!{p%x*?7qgk#LBK2F5pB*g1tNE3Q59DZ`Dds-*ObiUOSSK&kliaMSlf?v9 zFilSaqGhAuMP{(db*Z=1?=dql91#YqTxrV50v4AIPhS`X6zAguiBC3YVcmSsvH_ww z(N-D4Xm_{?u`gp6*OpRN28JkQuqo}%3s}MSX?aeA7-#%RIUpG5AZ0eNg6F<<5C>%h z%wpmNxmf;I*`7L}g5Jp!9i%3|Z)e@C7rX=_wQA`Vt6regSCG`^pP@S-cCwuNV`c{w zUdTE*Fk5QU6rckmQXo?LnN}A+1EuD0gQPZRMax0l+a0$JqTtXD^Mw^a1zhYP1(O$a zv2M;woCk3de~L9kwQu@22*WM=ID{dPZ^Fz8a_x;T)4yd-o){;;Ij3j}L>qJI7glhB zxs^HV+2sFKX6i&HjmeB$GLz@mYHeOrEyE~ku4`lvVrXtB@c!FukSU2~7X& zcLvk;6CiXels*lm1t&tp!=dzCDE$~pYfgg5=R@hOQ2IBNcAN~6Z->%nC%b^{6PW^` zqoMR7DE$&j8%%}BmqY1&Q(chaA#sZ6WQA#(V3T~N*&>8GWT>302x`h?EnA( delta 1047 zcmcb-j_L9`Cf)#VW)=|!1_llWg)LJy@`^BX0BIlA-v{1q)?_wkRqN-?)c zHaAI5*__W}&KPfEU}>CUVrrCVVPRyFXl!a>k(QWdm~4?`WM-Udm}H<=P@J2RT%e@j znPRIHWSE$eoMf0}X<}?-WMW`puB4!EXQLmKnv+6fLGR>=4pNifx3g~63tj?|TDA0wRWDHLD@bbd&(IwZJ6X>CF|z{- zFJzq@m@PGF3ebTODG(|BOsk8Zfl_n0K~kHuqU9j&?T*_9QE+I7`N9gI0xoutg2@ZI zSU2Y-&Vx9KKgAlN+Bf|hgyEKb9KsODH(}-kx%S4F>EALZPmGh_oKrLfqK&!q3oAIm zygm?JGx>j&nL3e4V=^O`%;fpCTALSD%P@+X=o%S>7#Ua@8(SF|>X{mtn3@ zibF=XRv#SF@wGPvK#a-OeOB;vJGr*c5G=T{&l*g>@3RNfhW)N!y0YH_OmFFT0@FYH zox!yI1PI*%`A~W*l>QB+9VbKN+oAN?$u3~~M5aLK zXehl1O235C22&yOUsing And and But diff --git a/docs/Output/Html/Features/00BasicGherkin/index.html b/docs/Output/Html/Features/00BasicGherkin/index.html index 572887d72..6e2a56997 100644 --- a/docs/Output/Html/Features/00BasicGherkin/index.html +++ b/docs/Output/Html/Features/00BasicGherkin/index.html @@ -268,9 +268,9 @@

00 Basic Gherkin

diff --git a/docs/Output/Html/Features/01TestRunner/TestRunnerIsNotImportant.html b/docs/Output/Html/Features/01TestRunner/TestRunnerIsNotImportant.html index eb00e73fc..6fdf7678f 100644 --- a/docs/Output/Html/Features/01TestRunner/TestRunnerIsNotImportant.html +++ b/docs/Output/Html/Features/01TestRunner/TestRunnerIsNotImportant.html @@ -278,9 +278,9 @@

A couple of simple steps

diff --git a/docs/Output/Html/Features/01TestRunner/index.html b/docs/Output/Html/Features/01TestRunner/index.html index dab8c92c7..94ca61745 100644 --- a/docs/Output/Html/Features/01TestRunner/index.html +++ b/docs/Output/Html/Features/01TestRunner/index.html @@ -266,9 +266,9 @@

01 Test Runner

diff --git a/docs/Output/Html/Features/02TagsAndHooks/Hooks.html b/docs/Output/Html/Features/02TagsAndHooks/Hooks.html index 176b7ec4e..cdf351cf1 100644 --- a/docs/Output/Html/Features/02TagsAndHooks/Hooks.html +++ b/docs/Output/Html/Features/02TagsAndHooks/Hooks.html @@ -340,9 +340,9 @@

Hooking into pre conditions for Steps in SpecFlow

diff --git a/docs/Output/Html/Features/02TagsAndHooks/TagDemo.html b/docs/Output/Html/Features/02TagsAndHooks/TagDemo.html index d3dea1e83..da9e4043e 100644 --- a/docs/Output/Html/Features/02TagsAndHooks/TagDemo.html +++ b/docs/Output/Html/Features/02TagsAndHooks/TagDemo.html @@ -358,9 +358,9 @@

A scenario with 2 tags

diff --git a/docs/Output/Html/Features/02TagsAndHooks/index.html b/docs/Output/Html/Features/02TagsAndHooks/index.html index 2b8cf4a80..1e14b407b 100644 --- a/docs/Output/Html/Features/02TagsAndHooks/index.html +++ b/docs/Output/Html/Features/02TagsAndHooks/index.html @@ -275,9 +275,9 @@

02 Tags And Hooks

diff --git a/docs/Output/Html/Features/031ScenarioContext/ScenarioContext.html b/docs/Output/Html/Features/031ScenarioContext/ScenarioContext.html index 3be6ad800..00a702ab7 100644 --- a/docs/Output/Html/Features/031ScenarioContext/ScenarioContext.html +++ b/docs/Output/Html/Features/031ScenarioContext/ScenarioContext.html @@ -344,9 +344,9 @@

Pending step

diff --git a/docs/Output/Html/Features/031ScenarioContext/index.html b/docs/Output/Html/Features/031ScenarioContext/index.html index 250601b3a..8cc6ac1bc 100644 --- a/docs/Output/Html/Features/031ScenarioContext/index.html +++ b/docs/Output/Html/Features/031ScenarioContext/index.html @@ -266,9 +266,9 @@

031 Scenario Context

diff --git a/docs/Output/Html/Features/032FeatureContext/FeatureContextFeatures.html b/docs/Output/Html/Features/032FeatureContext/FeatureContextFeatures.html index d90eb6208..6a4dcda75 100644 --- a/docs/Output/Html/Features/032FeatureContext/FeatureContextFeatures.html +++ b/docs/Output/Html/Features/032FeatureContext/FeatureContextFeatures.html @@ -295,9 +295,9 @@

Showing information of the feature

diff --git a/docs/Output/Html/Features/032FeatureContext/index.html b/docs/Output/Html/Features/032FeatureContext/index.html index 87ff6dffd..71ce134de 100644 --- a/docs/Output/Html/Features/032FeatureContext/index.html +++ b/docs/Output/Html/Features/032FeatureContext/index.html @@ -266,9 +266,9 @@

032 Feature Context

diff --git a/docs/Output/Html/Features/03ScenarioOutline/ScenarioOutline.html b/docs/Output/Html/Features/03ScenarioOutline/ScenarioOutline.html index a0f468357..3c97ec15b 100644 --- a/docs/Output/Html/Features/03ScenarioOutline/ScenarioOutline.html +++ b/docs/Output/Html/Features/03ScenarioOutline/ScenarioOutline.html @@ -434,9 +434,9 @@

Examples: more than 100

diff --git a/docs/Output/Html/Features/03ScenarioOutline/index.html b/docs/Output/Html/Features/03ScenarioOutline/index.html index aedfc47b3..06d78bda6 100644 --- a/docs/Output/Html/Features/03ScenarioOutline/index.html +++ b/docs/Output/Html/Features/03ScenarioOutline/index.html @@ -266,9 +266,9 @@

03 Scenario Outline

diff --git a/docs/Output/Html/Features/04Background/BackgroundFeature.html b/docs/Output/Html/Features/04Background/BackgroundFeature.html index b511262fa..25f5d62b2 100644 --- a/docs/Output/Html/Features/04Background/BackgroundFeature.html +++ b/docs/Output/Html/Features/04Background/BackgroundFeature.html @@ -305,9 +305,9 @@

Add 2 to the sum

diff --git a/docs/Output/Html/Features/04Background/index.html b/docs/Output/Html/Features/04Background/index.html index da901e7bb..86598f802 100644 --- a/docs/Output/Html/Features/04Background/index.html +++ b/docs/Output/Html/Features/04Background/index.html @@ -266,9 +266,9 @@

04 Background

diff --git a/docs/Output/Html/Features/05TablesAndAssist/TableScenario.html b/docs/Output/Html/Features/05TablesAndAssist/TableScenario.html index daa58ecd4..70a818473 100644 --- a/docs/Output/Html/Features/05TablesAndAssist/TableScenario.html +++ b/docs/Output/Html/Features/05TablesAndAssist/TableScenario.html @@ -326,9 +326,9 @@

Example of a wide table

diff --git a/docs/Output/Html/Features/05TablesAndAssist/index.html b/docs/Output/Html/Features/05TablesAndAssist/index.html index c90c79949..28bf65518 100644 --- a/docs/Output/Html/Features/05TablesAndAssist/index.html +++ b/docs/Output/Html/Features/05TablesAndAssist/index.html @@ -266,9 +266,9 @@

05 Tables And Assist

diff --git a/docs/Output/Html/Features/06CompareToAssist/CompareTo.html b/docs/Output/Html/Features/06CompareToAssist/CompareTo.html index 5d6fc4d59..3ebb42362 100644 --- a/docs/Output/Html/Features/06CompareToAssist/CompareTo.html +++ b/docs/Output/Html/Features/06CompareToAssist/CompareTo.html @@ -298,9 +298,9 @@

CompareToSet

diff --git a/docs/Output/Html/Features/06CompareToAssist/index.html b/docs/Output/Html/Features/06CompareToAssist/index.html index bd7010072..e48c9576d 100644 --- a/docs/Output/Html/Features/06CompareToAssist/index.html +++ b/docs/Output/Html/Features/06CompareToAssist/index.html @@ -266,9 +266,9 @@

06 Compare To Assist

diff --git a/docs/Output/Html/Features/07Localization/Svenska.html b/docs/Output/Html/Features/07Localization/Svenska.html index 4222a8169..77744276f 100644 --- a/docs/Output/Html/Features/07Localization/Svenska.html +++ b/docs/Output/Html/Features/07Localization/Svenska.html @@ -280,9 +280,9 @@

Summera 5 och 7 ska vara 12

diff --git a/docs/Output/Html/Features/07Localization/Vlaams.html b/docs/Output/Html/Features/07Localization/Vlaams.html index 515ed1ddc..3604544ce 100644 --- a/docs/Output/Html/Features/07Localization/Vlaams.html +++ b/docs/Output/Html/Features/07Localization/Vlaams.html @@ -277,9 +277,9 @@

Het Scenario

diff --git a/docs/Output/Html/Features/07Localization/index.html b/docs/Output/Html/Features/07Localization/index.html index 49fa0e65f..1fcf10902 100644 --- a/docs/Output/Html/Features/07Localization/index.html +++ b/docs/Output/Html/Features/07Localization/index.html @@ -273,9 +273,9 @@

07 Localization

diff --git a/docs/Output/Html/Features/08AttributeOverloading/AttributeOverloading.html b/docs/Output/Html/Features/08AttributeOverloading/AttributeOverloading.html index 0499c2197..849b62668 100644 --- a/docs/Output/Html/Features/08AttributeOverloading/AttributeOverloading.html +++ b/docs/Output/Html/Features/08AttributeOverloading/AttributeOverloading.html @@ -286,9 +286,9 @@

Checking number for evenness

diff --git a/docs/Output/Html/Features/08AttributeOverloading/index.html b/docs/Output/Html/Features/08AttributeOverloading/index.html index 05b7a23ea..d829e4063 100644 --- a/docs/Output/Html/Features/08AttributeOverloading/index.html +++ b/docs/Output/Html/Features/08AttributeOverloading/index.html @@ -266,9 +266,9 @@

08 Attribute Overloading

diff --git a/docs/Output/Html/Features/09CallingStepsFromSteps/CallingStepsFromSteps.html b/docs/Output/Html/Features/09CallingStepsFromSteps/CallingStepsFromSteps.html index ea421a6bc..feaeade71 100644 --- a/docs/Output/Html/Features/09CallingStepsFromSteps/CallingStepsFromSteps.html +++ b/docs/Output/Html/Features/09CallingStepsFromSteps/CallingStepsFromSteps.html @@ -298,9 +298,9 @@

Do something meaningful

diff --git a/docs/Output/Html/Features/09CallingStepsFromSteps/index.html b/docs/Output/Html/Features/09CallingStepsFromSteps/index.html index 5c27cbe36..cf01a81a7 100644 --- a/docs/Output/Html/Features/09CallingStepsFromSteps/index.html +++ b/docs/Output/Html/Features/09CallingStepsFromSteps/index.html @@ -266,9 +266,9 @@

09 Calling Steps From Steps

diff --git a/docs/Output/Html/Features/10StepTransformation/StepTransformation.html b/docs/Output/Html/Features/10StepTransformation/StepTransformation.html index 8f737f20b..895782309 100644 --- a/docs/Output/Html/Features/10StepTransformation/StepTransformation.html +++ b/docs/Output/Html/Features/10StepTransformation/StepTransformation.html @@ -278,9 +278,9 @@

Steps with non-string arguments

diff --git a/docs/Output/Html/Features/10StepTransformation/index.html b/docs/Output/Html/Features/10StepTransformation/index.html index 3210b3c91..632e44e45 100644 --- a/docs/Output/Html/Features/10StepTransformation/index.html +++ b/docs/Output/Html/Features/10StepTransformation/index.html @@ -266,9 +266,9 @@

10 Step Transformation

diff --git a/docs/Output/Html/Features/11ContextInjection/ContextInjection.html b/docs/Output/Html/Features/11ContextInjection/ContextInjection.html index 5734e7cb2..b076f6420 100644 --- a/docs/Output/Html/Features/11ContextInjection/ContextInjection.html +++ b/docs/Output/Html/Features/11ContextInjection/ContextInjection.html @@ -346,9 +346,9 @@

Feature with a dependent context

diff --git a/docs/Output/Html/Features/11ContextInjection/index.html b/docs/Output/Html/Features/11ContextInjection/index.html index d7a8f4885..0cf18a2cb 100644 --- a/docs/Output/Html/Features/11ContextInjection/index.html +++ b/docs/Output/Html/Features/11ContextInjection/index.html @@ -268,9 +268,9 @@

11 Context Injection

diff --git a/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/NestedFolderExample.html b/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/NestedFolderExample.html index f58594ed6..d588164d9 100644 --- a/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/NestedFolderExample.html +++ b/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/NestedFolderExample.html @@ -281,9 +281,9 @@

Nested - Add two numbers

diff --git a/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/index.html b/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/index.html index f46e8cf13..6cf643fd1 100644 --- a/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/index.html +++ b/docs/Output/Html/Features/12NestedFolders/ChildFolder/ChildChildFolder/index.html @@ -266,9 +266,9 @@

Child Child Folder

diff --git a/docs/Output/Html/Features/12NestedFolders/ChildFolder/index.html b/docs/Output/Html/Features/12NestedFolders/ChildFolder/index.html index cd6376810..e999b18ef 100644 --- a/docs/Output/Html/Features/12NestedFolders/ChildFolder/index.html +++ b/docs/Output/Html/Features/12NestedFolders/ChildFolder/index.html @@ -256,9 +256,9 @@

Child Folder

    diff --git a/docs/Output/Html/Features/12NestedFolders/index.html b/docs/Output/Html/Features/12NestedFolders/index.html index 82453ee61..a6174ed95 100644 --- a/docs/Output/Html/Features/12NestedFolders/index.html +++ b/docs/Output/Html/Features/12NestedFolders/index.html @@ -256,9 +256,9 @@

    12 Nested Folders

      diff --git a/docs/Output/Html/Features/13MultilineText/MultilineFeatureExample.html b/docs/Output/Html/Features/13MultilineText/MultilineFeatureExample.html index c440c95db..2fc251502 100644 --- a/docs/Output/Html/Features/13MultilineText/MultilineFeatureExample.html +++ b/docs/Output/Html/Features/13MultilineText/MultilineFeatureExample.html @@ -281,9 +281,9 @@

      Mutliline Output

    diff --git a/docs/Output/Html/Features/13MultilineText/index.html b/docs/Output/Html/Features/13MultilineText/index.html index 586d38821..bb38c5bba 100644 --- a/docs/Output/Html/Features/13MultilineText/index.html +++ b/docs/Output/Html/Features/13MultilineText/index.html @@ -266,9 +266,9 @@

    13 Multiline Text

diff --git a/docs/Output/Html/Features/14MarkdownExample/MarkdownExamples.html b/docs/Output/Html/Features/14MarkdownExample/MarkdownExamples.html index bf0b4915c..1ea8ef047 100644 --- a/docs/Output/Html/Features/14MarkdownExample/MarkdownExamples.html +++ b/docs/Output/Html/Features/14MarkdownExample/MarkdownExamples.html @@ -396,9 +396,9 @@

Examples:

diff --git a/docs/Output/Html/Features/14MarkdownExample/index.html b/docs/Output/Html/Features/14MarkdownExample/index.html index 1f56a81a7..e1c1812d2 100644 --- a/docs/Output/Html/Features/14MarkdownExample/index.html +++ b/docs/Output/Html/Features/14MarkdownExample/index.html @@ -298,9 +298,9 @@

14 Markdown Example

diff --git a/docs/Output/Html/Features/15Pickles/InteractiveDHTMLView.html b/docs/Output/Html/Features/15Pickles/InteractiveDHTMLView.html index 1f507b5fd..a962a57eb 100644 --- a/docs/Output/Html/Features/15Pickles/InteractiveDHTMLView.html +++ b/docs/Output/Html/Features/15Pickles/InteractiveDHTMLView.html @@ -278,9 +278,9 @@

Scenario with large data table

diff --git a/docs/Output/Html/Features/15Pickles/index.html b/docs/Output/Html/Features/15Pickles/index.html index 0997383af..7fe6ca04f 100644 --- a/docs/Output/Html/Features/15Pickles/index.html +++ b/docs/Output/Html/Features/15Pickles/index.html @@ -267,9 +267,9 @@

15 Pickles

diff --git a/docs/Output/Html/Features/Arithmetic.html b/docs/Output/Html/Features/Arithmetic.html index 657e02a16..e6acd9793 100644 --- a/docs/Output/Html/Features/Arithmetic.html +++ b/docs/Output/Html/Features/Arithmetic.html @@ -350,9 +350,9 @@

Divide two numbers

diff --git a/docs/Output/Html/Features/Trigonometry.html b/docs/Output/Html/Features/Trigonometry.html index 3df99d816..cd0c4d97b 100644 --- a/docs/Output/Html/Features/Trigonometry.html +++ b/docs/Output/Html/Features/Trigonometry.html @@ -317,9 +317,9 @@

Tangent

diff --git a/docs/Output/Html/Features/Workflow/ClearingScreen.html b/docs/Output/Html/Features/Workflow/ClearingScreen.html index 3e1cd36c8..fb6b185b6 100644 --- a/docs/Output/Html/Features/Workflow/ClearingScreen.html +++ b/docs/Output/Html/Features/Workflow/ClearingScreen.html @@ -281,9 +281,9 @@

Clear the screen

diff --git a/docs/Output/Html/Features/Workflow/index.html b/docs/Output/Html/Features/Workflow/index.html index 55415a7fe..fb101c5da 100644 --- a/docs/Output/Html/Features/Workflow/index.html +++ b/docs/Output/Html/Features/Workflow/index.html @@ -266,9 +266,9 @@

Workflow

diff --git a/docs/Output/Html/Features/index.html b/docs/Output/Html/Features/index.html index e10531d98..d76248f6b 100644 --- a/docs/Output/Html/Features/index.html +++ b/docs/Output/Html/Features/index.html @@ -278,9 +278,9 @@

Features

diff --git a/docs/Output/Html/index.html b/docs/Output/Html/index.html index a1920fc0f..0518db3b6 100644 --- a/docs/Output/Html/index.html +++ b/docs/Output/Html/index.html @@ -256,9 +256,9 @@

Examples

    diff --git a/docs/Output/Html/readme.html b/docs/Output/Html/readme.html index 118f0a5d7..fd74063b5 100644 --- a/docs/Output/Html/readme.html +++ b/docs/Output/Html/readme.html @@ -255,9 +255,9 @@

    In the Features-folders you'll find quite a large population of .feature files that you can use to test out pickles on.

    diff --git a/docs/Output/JSON/pickledFeatures.json b/docs/Output/JSON/pickledFeatures.json index f6173f013..b2147c040 100644 --- a/docs/Output/JSON/pickledFeatures.json +++ b/docs/Output/JSON/pickledFeatures.json @@ -3133,7 +3133,7 @@ }, "Configuration": { "SutName": "Pickles", - "SutVersion": "2.18.1", - "GeneratedOn": "20 April 2018 22:33:01" + "SutVersion": "2.19.0", + "GeneratedOn": "20 Juli 2018 19:39:02" } } \ No newline at end of file diff --git a/docs/Output/Word/Pickles.docx b/docs/Output/Word/Pickles.docx index 4326e155c5f62b4e226b5dbd1a1f99994636d37d..0210d9768f4e3ecb546e06f4ef911aac1a12669a 100644 GIT binary patch delta 1275 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 diff --git a/docs/index.html b/docs/index.html index 9505dc6fc..8b376e5b6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -159,7 +159,7 @@

    Download

- If you prefer to download the .zip files, you can so from the Github release page. + If you prefer to download the .zip files, you can so from the Github release page.

+ \ No newline at end of file diff --git a/src/Pickles/Pickles.DocumentationBuilders.Json.UnitTests/packages.config b/src/Pickles/Pickles.DocumentationBuilders.Json.UnitTests/packages.config index 315a489d8..20d33e431 100644 --- a/src/Pickles/Pickles.DocumentationBuilders.Json.UnitTests/packages.config +++ b/src/Pickles/Pickles.DocumentationBuilders.Json.UnitTests/packages.config @@ -1,8 +1,11 @@  + + + \ No newline at end of file diff --git a/src/Pickles/Pickles.MSBuild/Pickles.cs b/src/Pickles/Pickles.MSBuild/Pickles.cs index d9fbee1d0..d7edfc3e7 100644 --- a/src/Pickles/Pickles.MSBuild/Pickles.cs +++ b/src/Pickles/Pickles.MSBuild/Pickles.cs @@ -55,6 +55,8 @@ public class Pickles : Task public string ExcludeTags { get; set; } + public string HideTags { get; set; } + public override bool Execute() { try @@ -124,6 +126,11 @@ private void CaptureConfiguration(IConfiguration configuration, IFileSystem file configuration.ExcludeTags = this.ExcludeTags; } + if (!string.IsNullOrEmpty(this.HideTags)) + { + configuration.HideTags = this.HideTags; + } + bool shouldEnableExperimentalFeatures; if (bool.TryParse(this.IncludeExperimentalFeatures, out shouldEnableExperimentalFeatures)) diff --git a/src/Pickles/Pickles.ObjectModel/IConfiguration.cs b/src/Pickles/Pickles.ObjectModel/IConfiguration.cs index b5ddad121..11353f03c 100644 --- a/src/Pickles/Pickles.ObjectModel/IConfiguration.cs +++ b/src/Pickles/Pickles.ObjectModel/IConfiguration.cs @@ -48,6 +48,7 @@ public interface IConfiguration bool ShouldIncludeExperimentalFeatures { get; } string ExcludeTags { get; set; } + string HideTags { get; set; } void AddTestResultFile(FileInfoBase fileInfoBase); diff --git a/src/Pickles/Pickles.PowerShell/Pickle_Features.cs b/src/Pickles/Pickles.PowerShell/Pickle_Features.cs index 0fe5e8c0f..a9e84238b 100644 --- a/src/Pickles/Pickles.PowerShell/Pickle_Features.cs +++ b/src/Pickles/Pickles.PowerShell/Pickle_Features.cs @@ -33,39 +33,43 @@ namespace PicklesDoc.Pickles.PowerShell [Cmdlet("Pickle", "Features")] public class Pickle_Features : PSCmdlet { - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpFeatureDir, Mandatory = true)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpFeatureDir, Mandatory = true)] public string FeatureDirectory { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpOutputDir, Mandatory = true)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpOutputDir, Mandatory = true)] public string OutputDirectory { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpLanguageFeatureFiles, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpLanguageFeatureFiles, Mandatory = false)] public string Language { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpTestResultsFormat, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpTestResultsFormat, Mandatory = false)] public string TestResultsFormat { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpTestResultsFile, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpTestResultsFile, Mandatory = false)] public string TestResultsFile { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpSutName, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpSutName, Mandatory = false)] public string SystemUnderTestName { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpSutVersion, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpSutVersion, Mandatory = false)] public string SystemUnderTestVersion { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpDocumentationFormat, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpDocumentationFormat, Mandatory = false)] public string DocumentationFormat { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpIncludeExperimentalFeatures, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpIncludeExperimentalFeatures, Mandatory = false)] public SwitchParameter IncludeExperimentalFeatures { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpEnableComments, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpEnableComments, Mandatory = false)] public string EnableComments { get; set; } - [Parameter(HelpMessage = CommandLinArgumentHelpTexts.HelpExcludeTags, Mandatory = false)] + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpExcludeTags, Mandatory = false)] public string ExcludeTags { get; set; } + [Parameter(HelpMessage = CommandLineArgumentHelpTexts.HelpHideTags, Mandatory = false)] + public string HideTags { get; set; } + + protected override void ProcessRecord() { var builder = new ContainerBuilder(); @@ -131,6 +135,11 @@ private void ParseParameters(IConfiguration configuration, IFileSystem fileSyste configuration.ExcludeTags = this.ExcludeTags; } + if (!string.IsNullOrEmpty(this.HideTags)) + { + configuration.HideTags = this.HideTags; + } + bool shouldEnableComments; if (bool.TryParse(this.EnableComments, out shouldEnableComments)) diff --git a/src/Pickles/Pickles.Test/BaseFixture.cs b/src/Pickles/Pickles.Test/BaseFixture.cs index 60c1cd4e8..a2f4635f0 100644 --- a/src/Pickles/Pickles.Test/BaseFixture.cs +++ b/src/Pickles/Pickles.Test/BaseFixture.cs @@ -55,7 +55,7 @@ protected IContainer Container { var builder = new ContainerBuilder(); - var configuration = new Configuration() { ExcludeTags = "exclude-tag" }; + var configuration = new Configuration() { ExcludeTags = "exclude-tag", HideTags = "TagsToHideFeature;TagsToHideScenario" }; builder.RegisterAssemblyTypes(typeof(Runner).Assembly); builder.Register(_ => CreateMockFileSystem()).As().SingleInstance(); builder.RegisterModule(); @@ -102,7 +102,7 @@ protected void AddFakeFolderStructures() this.AddFakeFolderAndFiles("AcceptanceTest", new[] { "AdvancedFeature.feature", "LevelOne.feature" }); this.AddFakeFolderAndFiles("EmptyFolderTests", new string[0]); - this.AddFakeFolderAndFiles("FeatureCrawlerTests", new[] { "index.md", "LevelOne.feature", "image.png", "LevelOneIgnoredFeature.feature" }); + this.AddFakeFolderAndFiles("FeatureCrawlerTests", new[] { "index.md", "LevelOne.feature", "image.png", "LevelOneIgnoredFeature.feature", "LevelOneRemoveTagsToHide.feature" }); this.AddFakeFolderAndFiles(@"FeatureCrawlerTests\SubLevelOne", new[] { "ignorethisfile.ignore", "LevelOneSublevelOne.feature", "LevelOneSublevelTwo.feature" }); this.AddFakeFolderAndFiles(@"FeatureCrawlerTests\SubLevelOne\SubLevelTwo", new[] { "LevelOneSublevelOneSubLevelTwo.feature" }); this.AddFakeFolderAndFiles(@"FeatureCrawlerTests\SubLevelOne\SubLevelTwo\IgnoreThisDirectory", new[] { "IgnoreThisFile.ignore" }); diff --git a/src/Pickles/Pickles.Test/FakeFolderStructures/FeatureCrawlerTests/LevelOneRemoveTagsToHide.feature b/src/Pickles/Pickles.Test/FakeFolderStructures/FeatureCrawlerTests/LevelOneRemoveTagsToHide.feature new file mode 100644 index 000000000..5d44d27ce --- /dev/null +++ b/src/Pickles/Pickles.Test/FakeFolderStructures/FeatureCrawlerTests/LevelOneRemoveTagsToHide.feature @@ -0,0 +1,13 @@ +@TagsToHideFeature +Feature: LevelOneRemoveTagsToHide + In order to avoid silly mistakes + As a math idiot + I want to be told the sum of two numbers + +@mytag +@TagsToHideScenario +Scenario: Add two numbers + Given I have entered 50 into the calculator + And I have entered 70 into the calculator + When I press add + Then the result should be 120 on the screen diff --git a/src/Pickles/Pickles.Test/Pickles.Test.csproj b/src/Pickles/Pickles.Test/Pickles.Test.csproj index ffec5dfa8..b561177c1 100644 --- a/src/Pickles/Pickles.Test/Pickles.Test.csproj +++ b/src/Pickles/Pickles.Test/Pickles.Test.csproj @@ -169,6 +169,10 @@ + + {F69AAC03-A2A6-4B3F-A4EF-ACCB145C64AD} + Pickles.DocumentationBuilders.Cucumber + {8AC3AAFA-84DD-4437-962B-E6C5D6078E09} Pickles.DocumentationBuilders.Dhtml @@ -225,6 +229,7 @@ a-b.feature.cs + ResXFileCodeGenerator diff --git a/src/Pickles/Pickles.Test/WhenCrawlingFoldersForFeatures.cs b/src/Pickles/Pickles.Test/WhenCrawlingFoldersForFeatures.cs index 1954b9268..9198aa487 100644 --- a/src/Pickles/Pickles.Test/WhenCrawlingFoldersForFeatures.cs +++ b/src/Pickles/Pickles.Test/WhenCrawlingFoldersForFeatures.cs @@ -58,13 +58,19 @@ public void Then_can_crawl_all_folders_including_subfolders_for_features_success Check.That(image.RelativePathFromRoot).IsEqualTo("image.png"); Check.That(image).IsInstanceOf(); - INode subLevelOneDirectory = features.ChildNodes[3].Data; + INode levelOneRemoveTagsToHide = features.ChildNodes[3].Data; + Check.That(levelOneRemoveTagsToHide).IsNotNull(); + Check.That(levelOneRemoveTagsToHide.Name).IsEqualTo("LevelOneRemoveTagsToHide"); + Check.That(levelOneRemoveTagsToHide.RelativePathFromRoot).IsEqualTo("LevelOneRemoveTagsToHide.feature"); + Check.That(levelOneRemoveTagsToHide).IsInstanceOf(); + + INode subLevelOneDirectory = features.ChildNodes[4].Data; Check.That(subLevelOneDirectory).IsNotNull(); Check.That(subLevelOneDirectory.Name).IsEqualTo("Sub Level One"); Check.That(subLevelOneDirectory.RelativePathFromRoot).IsEqualTo(@"SubLevelOne\"); Check.That(subLevelOneDirectory).IsInstanceOf(); - Tree subLevelOneNode = features.ChildNodes[3]; + Tree subLevelOneNode = features.ChildNodes[4]; Check.That(subLevelOneNode.ChildNodes.Count).IsEqualTo(3); INode levelOneSublevelOneFeature = subLevelOneNode.ChildNodes[0].Data; diff --git a/src/Pickles/Pickles.Test/WhenParsingFeatureFiles.cs b/src/Pickles/Pickles.Test/WhenParsingFeatureFiles.cs index 49cdc2262..f07695535 100644 --- a/src/Pickles/Pickles.Test/WhenParsingFeatureFiles.cs +++ b/src/Pickles/Pickles.Test/WhenParsingFeatureFiles.cs @@ -418,6 +418,30 @@ When it runs Check.That(feature).IsNull(); } + [Test] + public void Then_can_parse_and_remove_technical_tag_in_configuration_remove_technical_tag() + { + var featureText = + @"# ignore this comment +@feature-tag @TagsToHideFeature +Feature: Test + In order to do something + As a user + I want to run this scenario + + @scenario-tag-1 @scenario-tag-2 + Scenario: A scenario + Given some feature + When it runs + Then I should see that this thing happens"; + + var parser = Container.Resolve(); + var feature = parser.Parse(new StringReader(featureText)); + Check.That(feature).IsNotNull(); + + Check.That(feature.Tags).ContainsExactly("@feature-tag"); + } + [Test] public void Then_can_parse_and_ignore_scenario_with_tag_in_configuration_ignore_tag() { @@ -457,7 +481,46 @@ When it runs } [Test] - public void Then_can_parse_and_ignore_scenario_with_tag_in_configuration_ignore_tag_and_keep_feature() + public void Then_can_parse_and_remove_tag_in_configuration_remove_technical_tag_from_scenario() + { + var featureText = + @"# ignore this comment +@feature-tag +Feature: Test + In order to do something + As a user + I want to run this scenario + + @scenario-tag-1 @scenario-tag-2 + Scenario: A scenario + Given some feature + When it runs + Then I should see that this thing happens + + @scenario-tag-1 @scenario-tag-2 @TagsToHideScenario + Scenario: B scenario + Given some feature + When it runs + Then I should see that this thing happens + + @scenario-tag-1 @scenario-tag-2 + Scenario: C scenario + Given some feature + When it runs + Then I should see that this thing happens"; + + var parser = Container.Resolve(); + var feature = parser.Parse(new StringReader(featureText)); + + Check.That(feature.FeatureElements.Count).IsEqualTo(3); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "A scenario")).IsNotNull(); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "B scenario")).IsNotNull(); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "B scenario").Tags).ContainsExactly("@scenario-tag-1", "@scenario-tag-2"); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "C scenario")).IsNotNull(); + } + + [Test] + public void Then_can_parse_and_ignore_scenario_with_tag_in_configuration_ignore_tag_and_do_not_keep_feature() { var featureText = @"# ignore this comment @@ -482,8 +545,7 @@ When it runs var parser = Container.Resolve(); var feature = parser.Parse(new StringReader(featureText)); - Check.That(feature).IsNotNull(); - Check.That(feature.FeatureElements).IsEmpty(); + Check.That(feature).IsNull(); } [Test] @@ -512,6 +574,12 @@ Then I should see that this thing happens @scenario-tag-1 @scenario-tag-2 @ExClUdE-tAg Scenario: C scenario + Given some feature + When it runs + Then I should see that this thing happens + + @scenario-tag-1 @scenario-tag-2 + Scenario: D scenario Given some feature When it runs Then I should see that this thing happens"; @@ -519,8 +587,11 @@ When it runs var parser = Container.Resolve(); var feature = parser.Parse(new StringReader(featureText)); - Check.That(feature).IsNotNull(); - Check.That(feature.FeatureElements).IsEmpty(); + Check.That(feature.FeatureElements.Count).IsEqualTo(1); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "A scenario")).IsNull(); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "B scenario")).IsNull(); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "C scenario")).IsNull(); + Check.That(feature.FeatureElements.FirstOrDefault(fe => fe.Name == "D scenario")).IsNotNull(); } } } diff --git a/src/Pickles/Pickles.Test/WhenResolvingADocumentationBuilder.cs b/src/Pickles/Pickles.Test/WhenResolvingADocumentationBuilder.cs index 545175280..7862b0121 100644 --- a/src/Pickles/Pickles.Test/WhenResolvingADocumentationBuilder.cs +++ b/src/Pickles/Pickles.Test/WhenResolvingADocumentationBuilder.cs @@ -23,84 +23,59 @@ using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.DocumentationBuilders; +using PicklesDoc.Pickles.DocumentationBuilders.Dhtml; using PicklesDoc.Pickles.DocumentationBuilders.Excel; using PicklesDoc.Pickles.DocumentationBuilders.Html; +using PicklesDoc.Pickles.DocumentationBuilders.Json; using PicklesDoc.Pickles.DocumentationBuilders.Word; +using PicklesDoc.Pickles.DocumentationBuilders.Cucumber; namespace PicklesDoc.Pickles.Test { public class WhenResolvingADocumentationBuilder : BaseFixture { - [Test] - public void ThenCanResolveIDocumentationBuilderAsHtmlDocumentationBuilderAsSingletonIfTheUserSelectsHtmlOutput() + private static readonly object[] DocumentationFormatCases = { - var configuration = this.Configuration; - configuration.DocumentationFormat = DocumentationFormat.Html; - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } + new object[] { DocumentationFormat.Html, typeof(HtmlDocumentationBuilder) }, + new object[] { DocumentationFormat.Word, typeof(WordDocumentationBuilder) }, + new object[] { DocumentationFormat.Excel, typeof(ExcelDocumentationBuilder) }, + new object[] { DocumentationFormat.DHtml, typeof(DhtmlDocumentationBuilder) }, + new object[] { DocumentationFormat.Json, typeof(JsonDocumentationBuilder) }, + new object[] { DocumentationFormat.Cucumber, typeof(CucumberDocumentationBuilder) }, + }; [Test] - public void ThenCanResolveIDocumentationBuilderAsWordDocumentationBuilderIfTheUserSelectsWordOutput() + [TestCaseSource(nameof(DocumentationFormatCases))] + public void ThenCanResolveTheSelectedIDocumentationBuilder(DocumentationFormat documentationFormat, Type builderType) { - var configuration = this.Configuration; - configuration.DocumentationFormat = DocumentationFormat.Word; + this.SetDocumentationFormat(documentationFormat); var item = Container.Resolve(); Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); + Check.That(item).IsInstanceOfType(builderType); } [Test] - public void ThenCanResolveIDocumentationBuilderAsWordDocumentationBuilderAsSingletonIfTheUserSelectsWordOutput() + [TestCaseSource(nameof(DocumentationFormatCases))] + public void ThenCanResolveTheSelectedIDocumentationBuilderAsSingleton(DocumentationFormat documentationFormat, Type builderType) { - var configuration = this.Configuration; - configuration.DocumentationFormat = DocumentationFormat.Word; + this.SetDocumentationFormat(documentationFormat); var item1 = Container.Resolve(); var item2 = Container.Resolve(); Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); + Check.That(item1).IsInstanceOfType(builderType); Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); + Check.That(item2).IsInstanceOfType(builderType); Check.That(item1).IsSameReferenceAs(item2); } - [Test] - public void ThenCanResolveIDocumentationBuilderAsExcelDocumentationBuilderIfTheUserSelectsExcelOutput() + private void SetDocumentationFormat(DocumentationFormat documentationFormat) { var configuration = this.Configuration; - configuration.DocumentationFormat = DocumentationFormat.Excel; - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveIDocumentationBuilderAsExcelDocumentationBuilderAsSingletonIfTheUserSelectsExcelOutput() - { - var configuration = this.Configuration; - configuration.DocumentationFormat = DocumentationFormat.Excel; - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); + configuration.DocumentationFormat = documentationFormat; } } -} +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs index c7cc64f73..8e1b7422f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -1,4 +1,4 @@ -// -------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors @@ -276,7 +276,7 @@ public void ThenCanReadResultOfScenarioOutlineWithUmlauts() var feature = new Feature { Name = "Scenarios With Special Characters" }; - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline with german umlauts äöüß ÄÖÜ", Feature = feature }; + var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline with german umlauts äöüß ÄÖÜ", Feature = feature }; var actualResult = results.GetExampleResult(scenarioOutline, new string[] { "pass_1" }); @@ -289,7 +289,7 @@ public void ThenCanReadResultOfScenarioWithDanishCharacters() var feature = new Feature { Name = "Scenarios With Special Characters" }; - var scenario = new Scenario { Name = "This is a scenario with danish characters æøå ÆØÅ", Feature = feature }; + var scenario = new Scenario { Name = "This is a scenario with danish characters æøå ÆØÅ", Feature = feature }; var actualResult = results.GetScenarioResult(scenario); @@ -302,7 +302,7 @@ public void ThenCanReadResultOfScenarioWithSpanishCharacters() var feature = new Feature { Name = "Scenarios With Special Characters" }; - var scenario = new Scenario { Name = "This is a scenario with spanish characters ñáéíóú", Feature = feature }; + var scenario = new Scenario { Name = "This is a scenario with spanish characters ñáéíóú", Feature = feature }; var actualResult = results.GetScenarioResult(scenario); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs index 526a0652c..c0a26b56f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs @@ -19,6 +19,7 @@ // -------------------------------------------------------------------------------------------------------------------- +using System.Collections.Generic; using NFluent; @@ -136,7 +137,30 @@ public void ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestRe var feature = new Feature { Name = "Scenarios With Special Characters" }; - var scenarioOutline = new ScenarioOutline { Name = "This scenario contains examples with Regex-special characters", Feature = feature }; + var scenarioOutline = new ScenarioOutline + { + Name = "This scenario contains examples with Regex-special characters", + Feature = feature, + Examples = new List + { + new Example + { + TableArgument = new ExampleTable + { + DataRows = new List + { + new TableRow("**"), + new TableRow("++"), + new TableRow(".*"), + new TableRow("[]"), + new TableRow("{}"), + new TableRow("()"), + new TableRow(@"^.*(?BAR)\s[^0-9]{3,4}A+$"), + } + } + } + } + }; TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs index c93cdcac0..d5c760146 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs @@ -57,6 +57,12 @@ public WhenParsingVsTestResultsFileWithIndividualResults() base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); } + [Test] + public new void ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed() + { + base.ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed(); + } + [Test] public new void ThenCanReadExamplesWithLongExampleValues() { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index d30e43318..3f667121b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -42,300 +42,63 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests [TestFixture] public class WhenResolvingTestResults : BaseFixture { - private const string TestResultsResourcePrefix = "PicklesDoc.Pickles.TestFrameworks.UnitTests."; + private static readonly object[] TestFormatCases = + { + new object[] { null, null, null, typeof(NullTestResults)}, + new object[] { "results-example-mstest.trx", "MsTest.results-example-mstest.trx", TestResultsFormat.MsTest, typeof(MsTestResults)}, + new object[] { "results-example-nunit.xml", "NUnit.NUnit2.results-example-nunit.xml", TestResultsFormat.NUnit, typeof(NUnit2Results)}, + new object[] { "results-example-nunit3.xml", "NUnit.NUnit3.results-example-nunit3.xml", TestResultsFormat.NUnit3, typeof(NUnit3Results)}, + new object[] { "results-example-xunit.xml", "XUnit.XUnit1.results-example-xunit.xml", TestResultsFormat.XUnit1, typeof(XUnit1Results)}, + new object[] { "results-example-xunit2.xml", "XUnit.XUnit2.results-example-xunit2.xml", TestResultsFormat.xUnit2, typeof(XUnit2Results)}, + new object[] { "results-example-json.json", "CucumberJson.results-example-json.json", TestResultsFormat.CucumberJson, typeof(CucumberJsonResults)}, + new object[] { "results-example-specrun.html", "SpecRun.results-example-specrun.html", TestResultsFormat.SpecRun, typeof(SpecRunResults)}, + new object[] { "results-example-vstest.trx", "VsTest.results-example-vstest.trx", TestResultsFormat.VsTest, typeof(VsTestResults)}, + }; + + [Test, TestCaseSource(nameof(TestFormatCases))] + public void ThenCanResolve(string exampleFilename, string resourceName, TestResultsFormat resultFormat, Type resultType) + { + if (exampleFilename != null) + { + this.SetFileSystem(exampleFilename, resourceName); + this.SetConfiguration(exampleFilename, resultFormat); + } - [Test] - public void ThenCanResolveAsSingletonWhenNoTestResultsSelected() - { - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreMsTest() - { - FileSystem.AddFile("results-example-mstest.trx", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "MsTest.results-example-mstest.trx")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.MsTest; - configuration.AddTestResultFiles(new[] { FileSystem.FileInfo.FromFileName("results-example-mstest.trx") }); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit() - { - FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit2.results-example-nunit.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.NUnit; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-nunit.xml")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit3() - { - FileSystem.AddFile("results-example-nunit3.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit3.results-example-nunit3.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.NUnit3; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-nunit3.xml")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsArexUnit() - { - FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit1.results-example-xunit.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.XUnit1; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-xunit.xml")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsArexUnit2() - { - FileSystem.AddFile("results-example-xunit2.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit2.results-example-xunit2.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.xUnit2; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-xunit2.xml")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreCucumberJson() - { - FileSystem.AddFile("results-example-json.json", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "CucumberJson.results-example-json.json")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.CucumberJson; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-json.json")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); - } - - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreSpecrun() - { - FileSystem.AddFile("results-example-specrun.html", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "SpecRun.results-example-specrun.html")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.SpecRun; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-specrun.html")); - - var item1 = Container.Resolve(); - var item2 = Container.Resolve(); + var item = Container.Resolve(); - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); - Check.That(item1).IsSameReferenceAs(item2); + Check.That(item).IsNotNull(); + Check.That(item).IsInstanceOfType(resultType); } - [Test] - public void ThenCanResolveAsSingletonWhenTestResultsAreVsTest() + [Test, TestCaseSource(nameof(TestFormatCases))] + public void ThenCanResolveAsSingleton(string exampleFilename, string resourceName, TestResultsFormat resultFormat, Type resultType) { - FileSystem.AddFile("results-example-vstest.trx", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "VsTest.results-example-vstest.trx")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.VsTest; - configuration.AddTestResultFiles(new[] { FileSystem.FileInfo.FromFileName("results-example-vstest.trx") }); + if (exampleFilename != null) + { + this.SetFileSystem(exampleFilename, resourceName); + this.SetConfiguration(exampleFilename, resultFormat); + } var item1 = Container.Resolve(); var item2 = Container.Resolve(); Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); + Check.That(item1).IsInstanceOfType(resultType); Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); + Check.That(item2).IsInstanceOfType(resultType); Check.That(item1).IsSameReferenceAs(item2); } - [Test] - public void ThenCanResolveWhenNoTestResultsSelected() - { - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreMsTest() - { - FileSystem.AddFile("results-example-mstest.trx", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "MsTest.results-example-mstest.trx")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.MsTest; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-mstest.trx")); - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreNUnit() + private void SetFileSystem(string example, string resource) { - FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit2.results-example-nunit.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.NUnit; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-nunit.xml")); - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreNUnit3() - { - FileSystem.AddFile("results-example-nunit3.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit3.results-example-nunit3.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.NUnit3; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-nunit3.xml")); - - var item1 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); + FileSystem.AddFile(example, RetrieveContentOfFileFromResources("PicklesDoc.Pickles.TestFrameworks.UnitTests." + resource)); } - [Test] - public void ThenCanResolveWhenTestResultsArexUnit() + private void SetConfiguration(string example, TestResultsFormat format) { - FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit1.results-example-xunit.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.XUnit1; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-xunit.xml")); - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsArexUnit2() - { - FileSystem.AddFile("results-example-xunit2.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit2.results-example-xunit2.xml")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.xUnit2; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-xunit2.xml")); - - var item1 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreCucumberJson() - { - FileSystem.AddFile("results-example-json.json", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "CucumberJson.results-example-json.json")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.CucumberJson; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-json.json")); - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreSpecrun() - { - FileSystem.AddFile("results-example-specrun.html", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "SpecRun.results-example-specrun.html")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.SpecRun; - configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-specrun.html")); - - var item = Container.Resolve(); - - Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); - } - - [Test] - public void ThenCanResolveWhenTestResultsAreVsTest() - { - FileSystem.AddFile("results-example-vstest.trx", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "VsTest.results-example-vstest.trx")); - - var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.VsTest; - configuration.AddTestResultFiles(new[] { FileSystem.FileInfo.FromFileName("results-example-vstest.trx") }); - - var item1 = Container.Resolve(); - - Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); + var configuration = this.Container.Resolve(); + configuration.TestResultsFormat = format; + configuration.AddTestResultFiles(new[] { this.FileSystem.FileInfo.FromFileName(example) }); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs index 913cdf2eb..8f873685f 100644 --- a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs @@ -18,6 +18,8 @@ // // -------------------------------------------------------------------------------------------------------------------- +using System.Linq; +using System.Text.RegularExpressions; using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -26,6 +28,9 @@ namespace PicklesDoc.Pickles.TestFrameworks.VsTest { public class VsTestScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher { + private static readonly Regex VariantRegex = new Regex(@"(.*)_Variant([\d*])", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private const int VariantNumberGroup = 2; + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) { var element = (XElement)scenarioElement; @@ -51,7 +56,23 @@ public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, obj .Replace('Ø', 'O') .Replace('Ã…', 'A'); - var isMatch = element.Name().ToUpperInvariant() + var variantMatch = VariantRegex.Match(element.Name().ToUpperInvariant()); + if (variantMatch.Success) + { + int variantNumber; + if (int.TryParse(variantMatch.Groups[VariantNumberGroup].Value, out variantNumber)) + { + if (scenarioOutline.Examples?.Count > 0) + { + var allExamples = scenarioOutline.Examples.SelectMany(x => x.TableArgument.DataRows); + var example = allExamples.ElementAt(variantNumber); + + return example.Cells.SequenceEqual(exampleValues); + } + } + } + + var isMatch = element.Name().ToUpperInvariant() .EndsWith(matchValue); return isMatch; diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs index aaa3c3efa..a0be0de4a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs @@ -36,10 +36,18 @@ public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, obj private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) { - var testNameWithExample = exampleElement.name; - var testNameOnly = testNameWithExample.Split('(')[0]; - testNameWithExample = testNameWithExample.Replace(testNameOnly, Regex.Replace(testNameOnly, @"\s+", string.Empty)); - return signature.IsMatch(exampleElement.name) || signature.IsMatch(testNameWithExample); + // split scenario outline title to name + parameters + var nameAndArgumentsSplitter = new Regex(@"^(?(.*))(\(.*\))$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); + var groups = nameAndArgumentsSplitter.Match(exampleElement.name).Groups; + var scenarioName = groups["name"].Value; + var scenariotNameWithNoSpacesAndSpecialCharacters = exampleElement.name.Replace(scenarioName, exampleElement.method); + + var esc = Regex.Escape("\""); + var escapedScenariotNameWithNoSpacesAndSpecialCharacters = scenariotNameWithNoSpacesAndSpecialCharacters.Replace(@"\\""", "\"").Replace(@"\""", esc); + var escapedExampleElementName = exampleElement.name.Replace(@"\\""", "\"").Replace(@"\""", esc); + var escapedSignature = signature.ToString().Replace(@"\""", esc); + + return Regex.IsMatch(escapedExampleElementName, escapedSignature, RegexOptions.IgnoreCase) || Regex.IsMatch(escapedScenariotNameWithNoSpacesAndSpecialCharacters, escapedSignature, RegexOptions.IgnoreCase); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.UserInterface/MainWindow.xaml b/src/Pickles/Pickles.UserInterface/MainWindow.xaml index 09b0bd769..a4f3b933a 100644 --- a/src/Pickles/Pickles.UserInterface/MainWindow.xaml +++ b/src/Pickles/Pickles.UserInterface/MainWindow.xaml @@ -47,6 +47,7 @@ + @@ -73,7 +74,10 @@