diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d62b6b12..84ec431f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,27 @@ This project adheres to [Semantic Versioning](http://semver.org). We consider th This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com). +## [Unreleased] + +## [2.4.0] - 2016-02-26 + +### Added + +- Support for the test result format of VsTest.Console.exe ([#280](https://github.com/picklesdoc/pickles/issues/280)) (by [@dirkrombauts](https://github.com/dirkrombauts)). + +### Changed + +- The MsTest test result provider is now able to give the result of individual examples in a scenario outline ([#285](https://github.com/picklesdoc/pickles/issues/285)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- The SpecFlow+ Runner (formerly SpecRun) test result provider is now able to give the result of individual examples in a scenario outline. See the [documentation](http://docs.picklesdoc.com/en/latest/IntegratingTestResultsFromSpecRun/) for an important caveat. ([#286](https://github.com/picklesdoc/pickles/issues/286)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- The Cucumber test result provider is now able to give the result of individual examples in a scenario outline ([#287](https://github.com/picklesdoc/pickles/issues/287)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- The GUI now uses a combobox to display the choice of test result formats ([#297](https://github.com/picklesdoc/pickles/issues/297)) (by [@dirkrombauts](https://github.com/dirkrombauts)). + + +### Fixed + +- Word document is corrupt if a Feature has no description ([#261](https://github.com/picklesdoc/pickles/issues/261)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- The Cucumber JSON test result provider should deal with background steps correctly ([#293](https://github.com/picklesdoc/pickles/issues/293)) (by [@dirkrombauts](https://github.com/dirkrombauts) based on [an idea by MikeThomas64](https://github.com/picklesdoc/pickles/pull/251)). + ## [2.3.0] - 2016-01-27 ### Added diff --git a/README.md b/README.md index dc8998bb6..f39a0b814 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Supported Test Runner Integrations - xUnit (versions 1.x and 2.x) - MSTest - Cucumber JSON -- SpecRun +- SpecFlow+ Runner (formerly known as SpecRun) Contributing ------------ diff --git a/build.bat b/build.bat index bde61e9e6..1b55ff544 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off -set "picklesVersion=2.3.0" +set "picklesVersion=2.4.0" cls diff --git a/src/Pickles/Examples/Features/00BasicGherkin/BasicGherkin.feature b/src/Pickles/Examples/Features/00BasicGherkin/BasicGherkin.feature index 88782dbc4..c3699d4e1 100644 --- a/src/Pickles/Examples/Features/00BasicGherkin/BasicGherkin.feature +++ b/src/Pickles/Examples/Features/00BasicGherkin/BasicGherkin.feature @@ -1,5 +1,5 @@ Feature: Showing basic gherkin syntax -In order to see that gherkin is a very simple langauge +In order to see that gherkin is a very simple language As a SpecFlow evangelist I want to show that basic syntax diff --git a/src/Pickles/Pickles.ObjectModel/ObjectModel/ITestResults.cs b/src/Pickles/Pickles.ObjectModel/ObjectModel/ITestResults.cs index 81baab79b..55733c75e 100644 --- a/src/Pickles/Pickles.ObjectModel/ObjectModel/ITestResults.cs +++ b/src/Pickles/Pickles.ObjectModel/ObjectModel/ITestResults.cs @@ -22,8 +22,6 @@ namespace PicklesDoc.Pickles.ObjectModel { public interface ITestResults { - bool SupportsExampleResults { get; } - TestResult GetFeatureResult(Feature feature); TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline); diff --git a/src/Pickles/Pickles.ObjectModel/ObjectModel/TestResult.cs b/src/Pickles/Pickles.ObjectModel/ObjectModel/TestResult.cs index ea3388152..b1a366332 100644 --- a/src/Pickles/Pickles.ObjectModel/ObjectModel/TestResult.cs +++ b/src/Pickles/Pickles.ObjectModel/ObjectModel/TestResult.cs @@ -30,81 +30,24 @@ public enum TestResult Failed, Passed } - /* - public struct TestResult - { - private TestResult(bool wasExecuted, bool wasSuccessful) - { - this.WasExecuted = wasExecuted; - this.WasSuccessful = wasSuccessful; - } - - public static TestResult Passed { get; } = new TestResult(wasExecuted: true, wasSuccessful: true); - - public static TestResult Failed { get; } = new TestResult(wasExecuted: true, wasSuccessful: false); - - public static TestResult Inconclusive { get; } = new TestResult(wasExecuted: false, wasSuccessful: false); - - public bool WasExecuted { get; } - - public bool WasSuccessful { get; } - - public bool Equals(TestResult other) - { - return this.WasExecuted.Equals(other.WasExecuted) && this.WasSuccessful.Equals(other.WasSuccessful); - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - return obj is TestResult && Equals((TestResult)obj); - } - - public override int GetHashCode() - { - int hashCode = this.WasExecuted.GetHashCode(); - hashCode = hashCode ^ this.WasSuccessful.GetHashCode(); - return hashCode; - } - - public override string ToString() - { - return $"WasExecuted: {this.WasExecuted}, WasSuccessful: {this.WasSuccessful}"; - } - - public static bool operator ==(TestResult left, TestResult right) - { - return left.Equals(right); - } - - public static bool operator !=(TestResult left, TestResult right) - { - return !(left == right); - } - } - */ public static class TestResultExtensions { - public static TestResult Merge(this IEnumerable testResults) + public static TestResult Merge(this IEnumerable testResults, bool passedTrumpsInconclusive = false) { if (testResults == null) { - throw new ArgumentNullException("testResults"); + throw new ArgumentNullException(nameof(testResults)); } TestResult[] items = testResults.ToArray(); if (!items.Any()) { - return new TestResult(); + return TestResult.Inconclusive; } - if (items.Count() == 1) + if (items.Length == 1) { return items.Single(); } @@ -114,12 +57,24 @@ public static TestResult Merge(this IEnumerable testResults) return TestResult.Failed; } - if (items.Any(i => i == TestResult.Inconclusive)) + if (passedTrumpsInconclusive) { + if (items.Any(r => r == TestResult.Passed)) + { + return TestResult.Passed; + } + return TestResult.Inconclusive; } + else + { + if (items.Any(i => i == TestResult.Inconclusive)) + { + return TestResult.Inconclusive; + } - return TestResult.Passed; + return TestResult.Passed; + } } } } diff --git a/src/Pickles/Pickles.ObjectModel/Pickles.ObjectModel.v2.ncrunchproject b/src/Pickles/Pickles.ObjectModel/Pickles.ObjectModel.v2.ncrunchproject new file mode 100644 index 000000000..30815b193 --- /dev/null +++ b/src/Pickles/Pickles.ObjectModel/Pickles.ObjectModel.v2.ncrunchproject @@ -0,0 +1,26 @@ + + true + 1000 + false + false + false + true + false + false + false + false + false + true + true + false + true + true + true + 60000 + + + + AutoDetect + STA + x86 + \ No newline at end of file diff --git a/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs b/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs index f8b9aa814..02909d394 100644 --- a/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs +++ b/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs @@ -35,7 +35,12 @@ public enum TestResultsFormat /// /// xUnit 1 format. /// - xUnit, + XUnit, + + /// + /// xUnit 1 format. + /// + XUnit1, /// /// Microsoft Test format. @@ -60,6 +65,11 @@ public enum TestResultsFormat /// /// NUnit 3 format. /// - NUnit3 + NUnit3, + + /// + /// The format produced by VsTest console. + /// + VsTest } } diff --git a/src/Pickles/Pickles.Test/DocumentationBuilders/HTML/WhenFormattingStep.cs b/src/Pickles/Pickles.Test/DocumentationBuilders/HTML/WhenFormattingStep.cs index a0e098e60..a40cefc6d 100644 --- a/src/Pickles/Pickles.Test/DocumentationBuilders/HTML/WhenFormattingStep.cs +++ b/src/Pickles/Pickles.Test/DocumentationBuilders/HTML/WhenFormattingStep.cs @@ -164,7 +164,10 @@ public void Tables_are_formatted_as_list_items_with_tables_internal() "Column 1"), new XElement( xmlns + "th", - "Column 2"))), + "Column 2"), + new XElement( + xmlns + "th", + " "))), new XElement( xmlns + "tbody", new XElement( diff --git a/src/Pickles/Pickles.Test/DocumentationBuilders/Word/WordDescriptionFormatterTests.cs b/src/Pickles/Pickles.Test/DocumentationBuilders/Word/WordDescriptionFormatterTests.cs new file mode 100644 index 000000000..f0c0fb62e --- /dev/null +++ b/src/Pickles/Pickles.Test/DocumentationBuilders/Word/WordDescriptionFormatterTests.cs @@ -0,0 +1,49 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NFluent; + +using NUnit.Framework; + +using PicklesDoc.Pickles.DocumentationBuilders.Word; + +namespace PicklesDoc.Pickles.Test.DocumentationBuilders.Word +{ + [TestFixture] + public class WordDescriptionFormatterTests + { + [Test] + public void SplitDescription_NullArgument_DoesNotThrowException() + { + Check.ThatCode(() => WordDescriptionFormatter.SplitDescription(null)) + .DoesNotThrow(); + } + + [Test] + public void SplitDescription_NullArgument_ReturnsEmptyArgument() + { + string[] descriptions = WordDescriptionFormatter.SplitDescription(null); + + Check.That(descriptions.Length).IsEqualTo(0); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.Test/Formatters/HtmlScenarioOutlineFormatterTests.cs b/src/Pickles/Pickles.Test/Formatters/HtmlScenarioOutlineFormatterTests.cs index 0ef66e166..a2715eaef 100644 --- a/src/Pickles/Pickles.Test/Formatters/HtmlScenarioOutlineFormatterTests.cs +++ b/src/Pickles/Pickles.Test/Formatters/HtmlScenarioOutlineFormatterTests.cs @@ -41,7 +41,6 @@ public class HtmlScenarioOutlineFormatterTests : BaseFixture public void Setup() { var fakeTestResults = new Mock(); - fakeTestResults.Setup(ftr => ftr.SupportsExampleResults).Returns(false); this.formatter = new HtmlScenarioOutlineFormatter( Container.Resolve(), diff --git a/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs b/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs index 33d03b724..53b60e9d8 100644 --- a/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs +++ b/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs @@ -77,7 +77,7 @@ public string Setup() }; configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName(TestResultFilePath)); - ITestResults testResults = new MsTestResults(configuration); + ITestResults testResults = new MsTestResults(configuration, new MsTestSingleResultLoader(), new MsTestScenarioOutlineExampleMatcher()); var jsonDocumentationBuilder = new JsonDocumentationBuilder(configuration, testResults, FileSystem); jsonDocumentationBuilder.Build(features); string content = FileSystem.File.ReadAllText(filePath); diff --git a/src/Pickles/Pickles.Test/Pickles.Test.csproj b/src/Pickles/Pickles.Test/Pickles.Test.csproj index 2139a037e..0a4750bc7 100644 --- a/src/Pickles/Pickles.Test/Pickles.Test.csproj +++ b/src/Pickles/Pickles.Test/Pickles.Test.csproj @@ -104,6 +104,7 @@ True FormattingAFeature.feature + diff --git a/src/Pickles/Pickles.Test/WhenParsingCommandLineArguments.cs b/src/Pickles/Pickles.Test/WhenParsingCommandLineArguments.cs index 37ce73e20..98d38fd13 100644 --- a/src/Pickles/Pickles.Test/WhenParsingCommandLineArguments.cs +++ b/src/Pickles/Pickles.Test/WhenParsingCommandLineArguments.cs @@ -297,6 +297,19 @@ public void ThenCanParseResultsFormatNunitWithShortFormSuccessfully() Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.NUnit); } + [Test] + public void ThenCanParseResultsFormatXunitWithShortFormSuccessfully() + { + var args = new[] { @"-trfmt=xunit" }; + + var configuration = new Configuration(); + var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem); + bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null); + + Check.That(shouldContinue).IsTrue(); + Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.XUnit); + } + [Test] public void ThenCanParseResultsFormatXunitWithLongFormSuccessfully() { @@ -307,20 +320,33 @@ public void ThenCanParseResultsFormatXunitWithLongFormSuccessfully() bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null); Check.That(shouldContinue).IsTrue(); - Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.xUnit); + Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.XUnit); } [Test] - public void ThenCanParseResultsFormatXunitWithShortFormSuccessfully() + public void ThenCanParseResultsFormatXunit1WithShortFormSuccessfully() { - var args = new[] { @"-trfmt=xunit" }; + var args = new[] { @"-trfmt=xunit1" }; + + var configuration = new Configuration(); + var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem); + bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null); + + Check.That(shouldContinue).IsTrue(); + Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.XUnit1); + } + + [Test] + public void ThenCanParseResultsFormatXunit1WithLongFormSuccessfully() + { + var args = new[] { @"-test-results-format=xunit1" }; var configuration = new Configuration(); var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem); bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null); Check.That(shouldContinue).IsTrue(); - Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.xUnit); + Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.XUnit1); } [Test] diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFile.cs new file mode 100644 index 000000000..fbd882be5 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFile.cs @@ -0,0 +1,133 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.CucumberJson; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson +{ + [TestFixture] + public class WhenParsingCucumberJsonFromJSResultsFile : StandardTestSuite + { + public WhenParsingCucumberJsonFromJSResultsFile() + : base("CucumberJson." + "results-example-cucumberjs-json.json") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadPassedFeatureResultSuccessfully() + { + base.ThenCanReadPassedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedFeatureResultSuccessfully() + { + base.ThenCanReadFailedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..8c3f3b6e4 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.CucumberJson; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson +{ + [TestFixture] + public class WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults() + : base("CucumberJson." + "results-example-cucumberjs-json.json") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs new file mode 100644 index 000000000..b607c06d3 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs @@ -0,0 +1,133 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.CucumberJson; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson +{ + [TestFixture] + public class WhenParsingCucumberJsonFromRubyResultsFile : StandardTestSuite + { + public WhenParsingCucumberJsonFromRubyResultsFile() + : base("CucumberJson." + "results-example-json.json") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadPassedFeatureResultSuccessfully() + { + base.ThenCanReadPassedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedFeatureResultSuccessfully() + { + base.ThenCanReadFailedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..9d9eae77f --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.CucumberJson; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson +{ + [TestFixture] + public class WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults() + : base("CucumberJson." + "results-example-json.json") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs deleted file mode 100644 index e639d0fae..000000000 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; - -using NFluent; - -using NUnit.Framework; - -using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.CucumberJson; - -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson -{ - [TestFixture] - public class WhenParsingCucumberJsonResultsFile : WhenParsingTestResultFiles - { - public WhenParsingCucumberJsonResultsFile() - : base("CucumberJson." + "results-example-json.json") - { - } - - [Test] - public void ThenCanReadFeatureResultSuccesfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Test Feature" }; - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Test Feature" }; - - var scenario1 = new Scenario { Name = "Passing", Feature = feature }; - TestResult result1 = results.GetScenarioResult(scenario1); - - Check.That(result1).IsEqualTo(TestResult.Passed); - - var scenario2 = new Scenario { Name = "Failing", Feature = feature }; - TestResult result2 = results.GetScenarioResult(scenario2); - - Check.That(result2).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadFeatureWithoutScenariosSuccessfully_ShouldReturnInconclusive() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Feature Without Scenarios" }; - - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-cucumberjs-json.json b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-cucumberjs-json.json new file mode 100644 index 000000000..f88152f9b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-cucumberjs-json.json @@ -0,0 +1,1240 @@ +[ + { + "id": "Addition", + "name": "Addition", + "description": "In order to avoid silly mistakes\r\nAs a math idiot\r\nI want to be told the sum of two numbers", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/Addition.feature", + "elements": [ + { + "name": "", + "keyword": "Background", + "description": "", + "type": "background", + "line": 6, + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given " + } + ] + }, + { + "name": "Adding several numbers", + "id": "Addition;adding-several-numbers", + "line": 19, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "tags": [ + { + "name": "@tag2", + "line": 9 + } + ], + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 993975 + }, + "match": {} + }, + { + "name": "I have entered 60 into the calculator", + "line": 11, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 549749 + }, + "match": {} + }, + { + "name": "I have entered 70 into the calculator", + "line": 12, + "keyword": "And ", + "result": { + "status": "passed", + "duration": 109052 + }, + "match": {} + }, + { + "name": "I have entered 130 into the calculator", + "line": 13, + "keyword": "And ", + "result": { + "status": "passed", + "duration": 79544 + }, + "match": {} + }, + { + "name": "I press add", + "line": 14, + "keyword": "When ", + "result": { + "status": "passed", + "duration": 170955 + }, + "match": {} + }, + { + "name": "the result should be 260 on the screen", + "line": 15, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 211368 + }, + "match": {} + } + ] + }, + { + "name": "Adding several numbers", + "id": "Addition;adding-several-numbers", + "line": 20, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "tags": [ + { + "name": "@tag2", + "line": 9 + } + ], + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 110656 + }, + "match": {} + }, + { + "name": "I have entered 40 into the calculator", + "line": 11, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 58054 + }, + "match": {} + }, + { + "name": "I have entered 50 into the calculator", + "line": 12, + "keyword": "And ", + "result": { + "status": "passed", + "duration": 82430 + }, + "match": {} + }, + { + "name": "I have entered 90 into the calculator", + "line": 13, + "keyword": "And ", + "result": { + "status": "passed", + "duration": 43942 + }, + "match": {} + }, + { + "name": "I press add", + "line": 14, + "keyword": "When ", + "result": { + "status": "passed", + "duration": 104561 + }, + "match": {} + }, + { + "name": "the result should be 180 on the screen", + "line": 15, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 51640 + }, + "match": {} + } + ] + }, + { + "name": "Add two numbers", + "id": "Addition;add-two-numbers", + "line": 23, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "tags": [ + { + "name": "@tag1", + "line": 22 + } + ], + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 123806 + }, + "match": {} + }, + { + "name": "I have entered 1 into the calculator", + "line": 24, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 87241 + }, + "match": {} + }, + { + "name": "I have entered 2 into the calculator", + "line": 25, + "keyword": "And ", + "result": { + "status": "passed", + "duration": 42979 + }, + "match": {} + }, + { + "name": "I press add", + "line": 26, + "keyword": "When ", + "result": { + "status": "passed", + "duration": 92694 + }, + "match": {} + }, + { + "name": "the result should be 3 on the screen", + "line": 27, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 46507 + }, + "match": {} + } + ] + }, + { + "name": "Fail to add two numbers", + "id": "Addition;fail-to-add-two-numbers", + "line": 30, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "tags": [ + { + "name": "@tag1", + "line": 29 + } + ], + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 136315 + }, + "match": {} + }, + { + "name": "I have entered 1 into the calculator", + "line": 31, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 151069 + }, + "match": {} + }, + { + "name": "I have entered 2.2 into the calculator", + "line": 32, + "keyword": "And ", + "result": { + "status": "ambiguous" + }, + "match": {} + }, + { + "name": "I press add", + "line": 33, + "keyword": "When ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "the result should be 3.2 on the screen", + "line": 34, + "keyword": "Then ", + "result": { + "status": "skipped" + }, + "match": {} + } + ] + }, + { + "name": "Not automated adding two numbers", + "id": "Addition;not-automated-adding-two-numbers", + "line": 43, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the calculator has clean memory", + "line": 7, + "keyword": "Given ", + "result": { + "status": "passed", + "duration": 219066 + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 44, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 45, + "keyword": "When ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 46, + "keyword": "Then ", + "result": { + "status": "undefined" + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Failing-Background", + "name": "Failing Background", + "description": "This feature has a failing background.", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/FailingBackground.feature", + "elements": [ + { + "name": "", + "keyword": "Background", + "description": "", + "type": "background", + "line": 4, + "steps": [ + { + "name": "the background step fails", + "line": 5, + "keyword": "Given " + }, + { + "name": "the calculator has clean memory", + "line": 6, + "keyword": "And " + } + ] + }, + { + "name": "Add two numbers", + "id": "Failing-Background;add-two-numbers", + "line": 8, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the background step fails", + "line": 5, + "keyword": "Given ", + "result": { + "status": "failed", + "duration": 4917275, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:36:13)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + }, + { + "name": "the calculator has clean memory", + "line": 6, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 50 into the calculator", + "line": 9, + "keyword": "Given ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 70 into the calculator", + "line": 10, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I press add", + "line": 11, + "keyword": "When ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "the result should be 120 on the screen", + "line": 12, + "keyword": "Then ", + "result": { + "status": "skipped" + }, + "match": {} + } + ] + }, + { + "name": "Adding several numbers", + "id": "Failing-Background;adding-several-numbers", + "line": 23, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the background step fails", + "line": 5, + "keyword": "Given ", + "result": { + "status": "failed", + "duration": 744119, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:36:13)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + }, + { + "name": "the calculator has clean memory", + "line": 6, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 60 into the calculator", + "line": 15, + "keyword": "Given ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 70 into the calculator", + "line": 16, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 130 into the calculator", + "line": 17, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I press add", + "line": 18, + "keyword": "When ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "the result should be 260 on the screen", + "line": 19, + "keyword": "Then ", + "result": { + "status": "skipped" + }, + "match": {} + } + ] + }, + { + "name": "Adding several numbers", + "id": "Failing-Background;adding-several-numbers", + "line": 24, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the background step fails", + "line": 5, + "keyword": "Given ", + "result": { + "status": "failed", + "duration": 682215, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:36:13)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + }, + { + "name": "the calculator has clean memory", + "line": 6, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 40 into the calculator", + "line": 15, + "keyword": "Given ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 50 into the calculator", + "line": 16, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I have entered 90 into the calculator", + "line": 17, + "keyword": "And ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "I press add", + "line": 18, + "keyword": "When ", + "result": { + "status": "skipped" + }, + "match": {} + }, + { + "name": "the result should be 180 on the screen", + "line": 19, + "keyword": "Then ", + "result": { + "status": "skipped" + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Failing", + "name": "Failing", + "description": "", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/Minimal Features/Failing.feature", + "elements": [ + { + "name": "Failing Feature Passing Scenario", + "id": "Failing;failing-feature-passing-scenario", + "line": 3, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "passing step", + "line": 4, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 147861 + }, + "match": {} + } + ] + }, + { + "name": "Failing Feature Inconclusive Scenario", + "id": "Failing;failing-feature-inconclusive-scenario", + "line": 6, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "inconclusive step", + "line": 7, + "keyword": "Then ", + "result": { + "status": "pending" + }, + "match": {} + } + ] + }, + { + "name": "Failing Feature Failing Scenario", + "id": "Failing;failing-feature-failing-scenario", + "line": 9, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "failing step", + "line": 10, + "keyword": "Then ", + "result": { + "status": "failed", + "duration": 1813146, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\MinimalSteps.js:18:12)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Inconclusive", + "name": "Inconclusive", + "description": "", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/Minimal Features/Inconclusive.feature", + "elements": [ + { + "name": "Inconclusive Feature Passing Scenario", + "id": "Inconclusive;inconclusive-feature-passing-scenario", + "line": 3, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "passing step", + "line": 4, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 135993 + }, + "match": {} + } + ] + }, + { + "name": "Inconclusive Feature Inconclusive Scenario", + "id": "Inconclusive;inconclusive-feature-inconclusive-scenario", + "line": 6, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "inconclusive step", + "line": 7, + "keyword": "Then ", + "result": { + "status": "pending" + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Passing", + "name": "Passing", + "description": "", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/Minimal Features/Passing.feature", + "elements": [ + { + "name": "Passing Feature Passing Scenario", + "id": "Passing;passing-feature-passing-scenario", + "line": 3, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "passing step", + "line": 4, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 215217 + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Not-Automated-At-All", + "name": "Not Automated At All", + "description": "", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/NotAutomatedAtAll.feature", + "elements": [ + { + "name": "", + "keyword": "Background", + "description": "", + "type": "background", + "line": 3, + "steps": [ + { + "name": "unimplemented step", + "line": 4, + "keyword": "Given " + } + ] + }, + { + "name": "Not automated scenario 1", + "id": "Not-Automated-At-All;not-automated-scenario-1", + "line": 6, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "unimplemented step", + "line": 4, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 7, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 8, + "keyword": "When ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 9, + "keyword": "Then ", + "result": { + "status": "undefined" + }, + "match": {} + } + ] + }, + { + "name": "Not automated scenario 2", + "id": "Not-Automated-At-All;not-automated-scenario-2", + "line": 11, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "unimplemented step", + "line": 4, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 12, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 13, + "keyword": "When ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 14, + "keyword": "Then ", + "result": { + "status": "undefined" + }, + "match": {} + } + ] + }, + { + "name": "Not automated scenario 3", + "id": "Not-Automated-At-All;not-automated-scenario-3", + "line": 16, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "unimplemented step", + "line": 4, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 17, + "keyword": "Given ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 18, + "keyword": "When ", + "result": { + "status": "undefined" + }, + "match": {} + }, + { + "name": "unimplemented step", + "line": 19, + "keyword": "Then ", + "result": { + "status": "undefined" + }, + "match": {} + } + ] + } + ] + }, + { + "id": "Scenario-Outlines", + "name": "Scenario Outlines", + "description": "Here we demonstrate how we deal with scenario outlines", + "line": 1, + "keyword": "Feature", + "uri": "C:/Dev/Code/GitHub/DirkRombauts/pickles-testresults/TestHarness/CucumberJS/features/ScenarioOutlines.feature", + "elements": [ + { + "name": "This is a scenario outline where all scenarios pass", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-all-scenarios-pass", + "line": 12, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline passes.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_1'", + "line": 8, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 258838 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where all scenarios pass", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-all-scenarios-pass", + "line": 13, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline passes.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_2'", + "line": 8, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 166785 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where all scenarios pass", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-all-scenarios-pass", + "line": 14, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline passes.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_3'", + "line": 8, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 184105 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario is inconclusive", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive", + "line": 25, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline is inconclusive.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_1'", + "line": 21, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 191482 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario is inconclusive", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive", + "line": 26, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline is inconclusive.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_2'", + "line": 21, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 179935 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario is inconclusive", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive", + "line": 27, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline is inconclusive.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'inconclusive_1'", + "line": 21, + "keyword": "Then ", + "result": { + "status": "pending" + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario fails", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-fails", + "line": 38, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline fails.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_1'", + "line": 34, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 190520 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario fails", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-fails", + "line": 39, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline fails.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_2'", + "line": 34, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 647255 + }, + "match": {} + } + ] + }, + { + "name": "This is a scenario outline where one scenario fails", + "id": "Scenario-Outlines;this-is-a-scenario-outline-where-one-scenario-fails", + "line": 40, + "keyword": "Scenario", + "description": "\r\nThis means the entire scenario outline fails.", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'fail_1'", + "line": 34, + "keyword": "Then ", + "result": { + "status": "failed", + "duration": 750213, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:18:12)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 49, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_1'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 126372 + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 50, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'pass_2'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "passed", + "duration": 128938 + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 54, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'inconclusive_1'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "pending" + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 55, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'inconclusive_2'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "pending" + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 59, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'fail_1'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "failed", + "duration": 444547, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:18:12)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + } + ] + }, + { + "name": "And we can go totally bonkers with multiple example sections.", + "id": "Scenario-Outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.", + "line": 60, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "the scenario will 'fail_2'", + "line": 45, + "keyword": "Then ", + "result": { + "status": "failed", + "duration": 443264, + "error_message": "AssertionError: 'true' == 'false'\n at World. (C:\\Dev\\Code\\GitHub\\DirkRombauts\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:18:12)\n at nextTickCallbackWith0Args (node.js:456:9)\n at process._tickCallback (node.js:385:13)\n at Function.Module.runMain (module.js:432:11)\n at startup (node.js:141:18)\n at node.js:1003:3" + }, + "match": {} + } + ] + }, + { + "name": "Deal correctly with backslashes in the examples", + "id": "Scenario-Outlines;deal-correctly-with-backslashes-in-the-examples", + "line": 69, + "keyword": "Scenario", + "description": "", + "type": "scenario", + "steps": [ + { + "name": "I have backslashes in the value, for example a 'c:\\Temp\\'", + "line": 65, + "keyword": "When ", + "result": { + "status": "passed", + "duration": 192444 + }, + "match": {} + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json index 2a7ebde0b..cce1e6d56 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -1,69 +1,435 @@ [ { - "uri": "features/one_passing_one_failing.feature", + "uri": "features/Addition.feature", + "id": "addition", "keyword": "Feature", - "id": "one-passing-scenario,-one-failing-scenario", - "name": "Test Feature", - "line": 2, - "description": "", - "tags": [ - { - "name": "@a", - "line": 1 - } - ], + "name": "Addition", + "description": " In order to avoid silly mistakes\n As a math idiot\n I want to be told the sum of two numbers", + "line": 1, "elements": [ { - "keyword": "Scenario", - "id": "one-passing-scenario,-one-failing-scenario;passing", - "name": "Passing", - "line": 5, + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the calculator has clean memory", + "line": 7, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "addition;adding-several-numbers;;2", + "keyword": "Scenario Outline", + "name": "Adding several numbers", "description": "", + "line": 19, + "type": "scenario", "tags": [ { - "name": "@b", - "line": 4 + "name": "@tag2", + "line": 9 } ], + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 60 into the calculator", + "line": 19, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 70 into the calculator", + "line": 19, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 130 into the calculator", + "line": 19, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 19, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "the result should be 260 on the screen", + "line": 19, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "passed", + "duration": 999000 + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the calculator has clean memory", + "line": 7, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "addition;adding-several-numbers;;3", + "keyword": "Scenario Outline", + "name": "Adding several numbers", + "description": "", + "line": 20, "type": "scenario", + "tags": [ + { + "name": "@tag2", + "line": 9 + } + ], "steps": [ { "keyword": "Given ", - "name": "a passing step", - "line": 6, + "name": "I have entered 40 into the calculator", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 50 into the calculator", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 90 into the calculator", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "the result should be 180 on the screen", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the calculator has clean memory", + "line": 7, "match": { - "location": "features/step_definitions/steps.rb:1" + "location": "features/step_definitions/AdditionSteps.rb:1" }, "result": { - "status": "passed" + "status": "passed", + "duration": 0 } } ] }, { + "id": "addition;add-two-numbers", "keyword": "Scenario", - "id": "one-passing-scenario,-one-failing-scenario;failing", - "name": "Failing", - "line": 9, + "name": "Add two numbers", "description": "", + "line": 23, + "type": "scenario", "tags": [ { - "name": "@c", - "line": 8 + "name": "@tag1", + "line": 22 } ], + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 1 into the calculator", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 2 into the calculator", + "line": 25, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 26, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "the result should be 3 on the screen", + "line": 27, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the calculator has clean memory", + "line": 7, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "addition;fail-to-add-two-numbers", + "keyword": "Scenario", + "name": "Fail to add two numbers", + "description": "", + "line": 30, "type": "scenario", + "tags": [ + { + "name": "@tag1", + "line": 29 + } + ], "steps": [ { "keyword": "Given ", - "name": "a failing step", - "line": 10, + "name": "I have entered 1 into the calculator", + "line": 31, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "I have entered 2.2 into the calculator", + "line": 32, "match": { - "location": "features/step_definitions/steps.rb:5" + "location": "features/step_definitions/AdditionSteps.rb:10" }, "result": { "status": "failed", - "error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:6:in /a failing step/'\nfeatures/one_passing_one_failing.feature:10:in Given a failing step'" + "error_message": "\nexpected: \"fail\"\n got: \"this is a hacky way of making the scenario with a non-integer number\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:11:in `/^I have entered (\\d+)\\.(\\d+) into the calculator$/'\nfeatures/Addition.feature:32:in `And I have entered 2.2 into the calculator'", + "duration": 11999000 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 33, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 3.2 on the screen", + "line": 34, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:24" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the calculator has clean memory", + "line": 7, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "addition;not-automated-adding-two-numbers", + "keyword": "Scenario", + "name": "Not automated adding two numbers", + "description": "", + "line": 43, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 44, + "match": { + "location": "features/Addition.feature:44" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "unimplemented step", + "line": 45, + "match": { + "location": "features/Addition.feature:45" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "Then ", + "name": "unimplemented step", + "line": 46, + "match": { + "location": "features/Addition.feature:46" + }, + "result": { + "status": "undefined" } } ] @@ -71,16 +437,1027 @@ ] }, { - "uri": "features/no_scenarios.feature", + "uri": "features/FailingBackground.feature", + "id": "failing-background", "keyword": "Feature", - "id": "no-scenarios", - "name": "Feature Without Scenarios", - "line": 2, - "description": "", - "tags": [ + "name": "Failing Background", + "description": "This feature has a failing background.", + "line": 1, + "elements": [ + { + "keyword": "Background", + "name": "", + "description": "", + "line": 4, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the background step fails", + "line": 5, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:28" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:29:in `/^the background step fails$/'\nfeatures/FailingBackground.feature:5:in `Given the background step fails'", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "the calculator has clean memory", + "line": 6, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "failing-background;add-two-numbers", + "keyword": "Scenario", + "name": "Add two numbers", + "description": "", + "line": 8, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 50 into the calculator", + "line": 9, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 70 into the calculator", + "line": 10, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 11, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 120 on the screen", + "line": 12, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "skipped" + } + } + ] + }, { - "name": "@a", - "line": 1 + "keyword": "Background", + "name": "", + "description": "", + "line": 4, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the background step fails", + "line": 5, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:28" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:29:in `/^the background step fails$/'\nfeatures/FailingBackground.feature:5:in `Given the background step fails'", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "the calculator has clean memory", + "line": 6, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "failing-background;adding-several-numbers;;2", + "keyword": "Scenario Outline", + "name": "Adding several numbers", + "description": "", + "line": 23, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 60 into the calculator", + "line": 23, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 70 into the calculator", + "line": 23, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 130 into the calculator", + "line": 23, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 23, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 260 on the screen", + "line": 23, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 4, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "the background step fails", + "line": 5, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:28" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:29:in `/^the background step fails$/'\nfeatures/FailingBackground.feature:5:in `Given the background step fails'", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "the calculator has clean memory", + "line": 6, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:1" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "failing-background;adding-several-numbers;;3", + "keyword": "Scenario Outline", + "name": "Adding several numbers", + "description": "", + "line": 24, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 40 into the calculator", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 50 into the calculator", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 90 into the calculator", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 180 on the screen", + "line": 24, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:20" + }, + "result": { + "status": "skipped" + } + } + ] + } + ] + }, + { + "uri": "features/Minimal Features/Failing.feature", + "id": "failing", + "keyword": "Feature", + "name": "Failing", + "description": "", + "line": 1, + "elements": [ + { + "id": "failing;failing-feature-passing-scenario", + "keyword": "Scenario", + "name": "Failing Feature Passing Scenario", + "description": "", + "line": 3, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "passing step", + "line": 4, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "failing;failing-feature-inconclusive-scenario", + "keyword": "Scenario", + "name": "Failing Feature Inconclusive Scenario", + "description": "", + "line": 6, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "inconclusive step", + "line": 7, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:5" + }, + "result": { + "status": "pending", + "error_message": "TODO (Cucumber::Pending)\n./features/step_definitions/MinimalSteps.rb:6:in `/^inconclusive step$/'\nfeatures/Minimal Features/Failing.feature:7:in `Then inconclusive step'", + "duration": 0 + } + } + ] + }, + { + "id": "failing;failing-feature-failing-scenario", + "keyword": "Scenario", + "name": "Failing Feature Failing Scenario", + "description": "", + "line": 9, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "failing step", + "line": 10, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:9" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/MinimalSteps.rb:10:in `/^failing step$/'\nfeatures/Minimal Features/Failing.feature:10:in `Then failing step'", + "duration": 0 + } + } + ] + } + ] + }, + { + "uri": "features/Minimal Features/Inconclusive.feature", + "id": "inconclusive", + "keyword": "Feature", + "name": "Inconclusive", + "description": "", + "line": 1, + "elements": [ + { + "id": "inconclusive;inconclusive-feature-passing-scenario", + "keyword": "Scenario", + "name": "Inconclusive Feature Passing Scenario", + "description": "", + "line": 3, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "passing step", + "line": 4, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "inconclusive;inconclusive-feature-inconclusive-scenario", + "keyword": "Scenario", + "name": "Inconclusive Feature Inconclusive Scenario", + "description": "", + "line": 6, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "inconclusive step", + "line": 7, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:5" + }, + "result": { + "status": "pending", + "error_message": "TODO (Cucumber::Pending)\n./features/step_definitions/MinimalSteps.rb:6:in `/^inconclusive step$/'\nfeatures/Minimal Features/Inconclusive.feature:7:in `Then inconclusive step'", + "duration": 0 + } + } + ] + } + ] + }, + { + "uri": "features/Minimal Features/Passing.feature", + "id": "passing", + "keyword": "Feature", + "name": "Passing", + "description": "", + "line": 1, + "elements": [ + { + "id": "passing;passing-feature-passing-scenario", + "keyword": "Scenario", + "name": "Passing Feature Passing Scenario", + "description": "", + "line": 3, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "passing step", + "line": 4, + "match": { + "location": "features/step_definitions/MinimalSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + } + ] + }, + { + "uri": "features/NotAutomatedAtAll.feature", + "id": "not-automated-at-all", + "keyword": "Feature", + "name": "Not Automated At All", + "description": "", + "line": 1, + "elements": [ + { + "keyword": "Background", + "name": "", + "description": "", + "line": 3, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 4, + "match": { + "location": "features/NotAutomatedAtAll.feature:4" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "id": "not-automated-at-all;not-automated-scenario-1", + "keyword": "Scenario", + "name": "Not automated scenario 1", + "description": "", + "line": 6, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 7, + "match": { + "location": "features/NotAutomatedAtAll.feature:7" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "unimplemented step", + "line": 8, + "match": { + "location": "features/NotAutomatedAtAll.feature:8" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "Then ", + "name": "unimplemented step", + "line": 9, + "match": { + "location": "features/NotAutomatedAtAll.feature:9" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 3, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 4, + "match": { + "location": "features/NotAutomatedAtAll.feature:4" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "id": "not-automated-at-all;not-automated-scenario-2", + "keyword": "Scenario", + "name": "Not automated scenario 2", + "description": "", + "line": 11, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 12, + "match": { + "location": "features/NotAutomatedAtAll.feature:12" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "unimplemented step", + "line": 13, + "match": { + "location": "features/NotAutomatedAtAll.feature:13" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "Then ", + "name": "unimplemented step", + "line": 14, + "match": { + "location": "features/NotAutomatedAtAll.feature:14" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 3, + "type": "background", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 4, + "match": { + "location": "features/NotAutomatedAtAll.feature:4" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "id": "not-automated-at-all;not-automated-scenario-3", + "keyword": "Scenario", + "name": "Not automated scenario 3", + "description": "", + "line": 16, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "unimplemented step", + "line": 17, + "match": { + "location": "features/NotAutomatedAtAll.feature:17" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "unimplemented step", + "line": 18, + "match": { + "location": "features/NotAutomatedAtAll.feature:18" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "Then ", + "name": "unimplemented step", + "line": 19, + "match": { + "location": "features/NotAutomatedAtAll.feature:19" + }, + "result": { + "status": "undefined" + } + } + ] + } + ] + }, + { + "uri": "features/ScenarioOutlines.feature", + "id": "scenario-outlines", + "keyword": "Feature", + "name": "Scenario Outlines", + "description": " Here we demonstrate how we deal with scenario outlines", + "line": 1, + "elements": [ + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-all-scenarios-pass;;2", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where all scenarios pass", + "description": " This means the entire scenario outline passes.", + "line": 12, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_1'", + "line": 12, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-all-scenarios-pass;;3", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where all scenarios pass", + "description": " This means the entire scenario outline passes.", + "line": 13, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_2'", + "line": 13, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-all-scenarios-pass;;4", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where all scenarios pass", + "description": " This means the entire scenario outline passes.", + "line": 14, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_3'", + "line": 14, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive;;2", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario is inconclusive", + "description": " This means the entire scenario outline is inconclusive.", + "line": 25, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_1'", + "line": 25, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive;;3", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario is inconclusive", + "description": " This means the entire scenario outline is inconclusive.", + "line": 26, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_2'", + "line": 26, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-is-inconclusive;;4", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario is inconclusive", + "description": " This means the entire scenario outline is inconclusive.", + "line": 27, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'inconclusive_1'", + "line": 27, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:5" + }, + "result": { + "status": "pending", + "error_message": "TODO (Cucumber::Pending)\n./features/step_definitions/ScenarioOutlineSteps.rb:6:in `/^the scenario will 'inconclusive_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:27:in `Then the scenario will 'inconclusive_1''\nfeatures/ScenarioOutlines.feature:21:in `Then the scenario will '''", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-fails;;2", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario fails", + "description": " This means the entire scenario outline fails.", + "line": 38, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_1'", + "line": 38, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-fails;;3", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario fails", + "description": " This means the entire scenario outline fails.", + "line": 39, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_2'", + "line": 39, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;this-is-a-scenario-outline-where-one-scenario-fails;;4", + "keyword": "Scenario Outline", + "name": "This is a scenario outline where one scenario fails", + "description": " This means the entire scenario outline fails.", + "line": 40, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'fail_1'", + "line": 40, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:9" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/ScenarioOutlineSteps.rb:10:in `/^the scenario will 'fail_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:40:in `Then the scenario will 'fail_1''\nfeatures/ScenarioOutlines.feature:34:in `Then the scenario will '''", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;2", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 49, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_1'", + "line": 49, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;3", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 50, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'pass_2'", + "line": 50, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:1" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;2", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 54, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'inconclusive_1'", + "line": 54, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:5" + }, + "result": { + "status": "pending", + "error_message": "TODO (Cucumber::Pending)\n./features/step_definitions/ScenarioOutlineSteps.rb:6:in `/^the scenario will 'inconclusive_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:54:in `Then the scenario will 'inconclusive_1''\nfeatures/ScenarioOutlines.feature:45:in `Then the scenario will '''", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;3", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 55, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'inconclusive_2'", + "line": 55, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:5" + }, + "result": { + "status": "pending", + "error_message": "TODO (Cucumber::Pending)\n./features/step_definitions/ScenarioOutlineSteps.rb:6:in `/^the scenario will 'inconclusive_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:55:in `Then the scenario will 'inconclusive_2''\nfeatures/ScenarioOutlines.feature:45:in `Then the scenario will '''", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;2", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 59, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'fail_1'", + "line": 59, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:9" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/ScenarioOutlineSteps.rb:10:in `/^the scenario will 'fail_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:59:in `Then the scenario will 'fail_1''\nfeatures/ScenarioOutlines.feature:45:in `Then the scenario will '''", + "duration": 500000 + } + } + ] + }, + { + "id": "scenario-outlines;and-we-can-go-totally-bonkers-with-multiple-example-sections.;;3", + "keyword": "Scenario Outline", + "name": "And we can go totally bonkers with multiple example sections.", + "description": "", + "line": 60, + "type": "scenario", + "steps": [ + { + "keyword": "Then ", + "name": "the scenario will 'fail_2'", + "line": 60, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:9" + }, + "result": { + "status": "failed", + "error_message": "\nexpected: \"false\"\n got: \"true\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/ScenarioOutlineSteps.rb:10:in `/^the scenario will 'fail_(\\d+)'$/'\nfeatures/ScenarioOutlines.feature:60:in `Then the scenario will 'fail_2''\nfeatures/ScenarioOutlines.feature:45:in `Then the scenario will '''", + "duration": 0 + } + } + ] + }, + { + "id": "scenario-outlines;deal-correctly-with-backslashes-in-the-examples;;2", + "keyword": "Scenario Outline", + "name": "Deal correctly with backslashes in the examples", + "description": "", + "line": 69, + "type": "scenario", + "steps": [ + { + "keyword": "When ", + "name": "I have backslashes in the value, for example a 'c:\\Temp\\'", + "line": 69, + "match": { + "location": "features/step_definitions/ScenarioOutlineSteps.rb:13" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] } ] } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs index 3b4aee247..11cba7ef5 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs @@ -20,17 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.MsTest; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.MsTest { [TestFixture] - public class WhenParsingMsTestResultsFile : WhenParsingTestResultFiles + public class WhenParsingMsTestResultsFile : StandardTestSuite { public WhenParsingMsTestResultsFile() : base("MsTest." + "results-example-mstest.trx") @@ -38,125 +35,105 @@ public WhenParsingMsTestResultsFile() } [Test] - public void ThenCanReadBackgroundResultSuccessfully() + public new void ThenCanReadBackgroundResultSuccessfully() { - var background = new Scenario { Name = "Background", Feature = this.AdditionFeature() }; - var feature = this.AdditionFeature(); - feature.AddBackground(background); - var results = ParseResultsFile(); - - TestResult result = results.GetScenarioResult(background); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadBackgroundResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveFeatureResultSuccessfully() + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.InconclusiveFeature()); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); } [Test] - public void ThenCanReadFailedFeatureResultSuccessfully() + public new void ThenCanReadFailedFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.FailingFeature()); - - Check.That(result).IsEqualTo(TestResult.Failed); + base.ThenCanReadFailedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadPassedFeatureResultSuccessfully() + public new void ThenCanReadPassedFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.PassingFeature()); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadPassedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() + public new void ThenCanReadScenarioOutlineResultSuccessfully() { - var results = ParseResultsFile(); - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = this.AdditionFeature() }; - - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var passedScenario = new Scenario { Name = "Add two numbers", Feature = this.AdditionFeature() }; - - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() + public new void ThenCanReadFailedScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = this.AdditionFeature() }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() + public new void ThenCanReadIgnoredScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = this.AdditionFeature() }; - - var result = results.GetScenarioResult(ignoredScenario); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } - Check.That(result).IsEqualTo(TestResult.Inconclusive); + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveScenarioResultSuccessfully() + public new void ThenCanReadFeatureResultSuccessfully() { - var results = ParseResultsFile(); + base.ThenCanReadFeatureResultSuccessfully(); + } - var inconclusiveScenario = new Scenario - { - Name = "Not automated adding two numbers", - Feature = this.AdditionFeature() - }; + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } - var result = results.GetScenarioResult(inconclusiveScenario); + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } - Check.That(result).IsEqualTo(TestResult.Inconclusive); + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); } - private Feature AdditionFeature() + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() { - return new Feature { Name = "Addition" }; + base.ThenCanReadResultOfScenarioWithFailingBackground(); } - private Feature InconclusiveFeature() + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() { - return new Feature { Name = "Inconclusive" }; + base.ThenCanReadResultOfFeatureWithFailingBackground(); } - private Feature FailingFeature() + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() { - return new Feature { Name = "Failing" }; + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); } - private Feature PassingFeature() + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() { - return new Feature { Name = "Passing" }; + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..b6425cb93 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.MsTest; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.MsTest +{ + [TestFixture] + public class WhenParsingMsTestResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingMsTestResultsFileWithIndividualResults() + : base("MsTest." + "results-example-mstest.trx") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/results-example-mstest.trx b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/results-example-mstest.trx index 70b26b7b8..cdfe844f0 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/results-example-mstest.trx +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/results-example-mstest.trx @@ -1,8 +1,8 @@  - + These are default test settings for a local test run. - + @@ -10,14 +10,14 @@ - + - + Not automated scenario 1 - + FeatureTitle @@ -26,28 +26,43 @@ - - This is a scenario outline where all scenarios pass - + + Adding several numbers + + + + - FeatureTitle - Scenario Outlines + Parameter:first number + 40 VariantName - pass_2 + 40 Parameter:result - pass_2 + 180 + + + Parameter:third number + 90 + + + Parameter:second number + 50 + + + FeatureTitle + Addition - + And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -66,7 +81,7 @@ Not automated scenario 3 - + FeatureTitle @@ -75,9 +90,20 @@ + + Add two numbers + + + + FeatureTitle + Failing Background + + + + Failing Feature Inconclusive Scenario - + FeatureTitle @@ -88,7 +114,7 @@ Inconclusive Feature Inconclusive Scenario - + FeatureTitle @@ -99,7 +125,7 @@ Failing Feature Passing Scenario - + FeatureTitle @@ -110,7 +136,7 @@ Deal correctly with backslashes in the examples - + FeatureTitle @@ -129,7 +155,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -148,7 +174,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -170,7 +196,7 @@ - + Parameter:first number @@ -201,7 +227,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -220,7 +246,7 @@ Failing Feature Failing Scenario - + FeatureTitle @@ -231,7 +257,7 @@ This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -248,54 +274,39 @@ - - Inconclusive Feature Passing Scenario - + + This is a scenario outline where all scenarios pass + FeatureTitle - Inconclusive - - - - - - Adding several numbers - - - - - - - Parameter:first number - 40 + Scenario Outlines VariantName - 40 + pass_2 Parameter:result - 180 - - - Parameter:third number - 90 - - - Parameter:second number - 50 + pass_2 + + + + + Inconclusive Feature Passing Scenario + + FeatureTitle - Addition + Inconclusive - + This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -313,7 +324,7 @@ - + FeatureTitle @@ -327,7 +338,7 @@ - + FeatureTitle @@ -336,9 +347,28 @@ + + This is a scenario outline where one scenario is inconclusive + + + + FeatureTitle + Scenario Outlines + + + VariantName + pass_2 + + + Parameter:result + pass_2 + + + + This is a scenario outline where one scenario fails - + FeatureTitle @@ -357,7 +387,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -374,28 +404,40 @@ - - This is a scenario outline where one scenario is inconclusive - + + Adding several numbers + - FeatureTitle - Scenario Outlines + Parameter:first number + 60 VariantName - pass_2 + 60 Parameter:result - pass_2 + 260 + + + Parameter:third number + 130 + + + Parameter:second number + 70 + + + FeatureTitle + Failing Background - + Not automated scenario 2 - + FeatureTitle @@ -406,7 +448,7 @@ This is a scenario outline where all scenarios pass - + FeatureTitle @@ -425,7 +467,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -444,7 +486,7 @@ Passing Feature Passing Scenario - + FeatureTitle @@ -453,13 +495,9 @@ - - - - This is a scenario outline where all scenarios pass - + FeatureTitle @@ -478,7 +516,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -495,12 +533,43 @@ + + Adding several numbers + + + + Parameter:first number + 40 + + + VariantName + 40 + + + Parameter:result + 180 + + + Parameter:third number + 90 + + + Parameter:second number + 50 + + + FeatureTitle + Failing Background + + + + Fail to add two numbers - + FeatureTitle @@ -511,7 +580,7 @@ Not automated adding two numbers - + FeatureTitle @@ -522,7 +591,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -545,41 +614,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -595,7 +666,7 @@ Then the result should be 180 on the screen -> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(180) (0,0s) - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -611,7 +682,7 @@ Then the result should be 260 on the screen -> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(260) (0,0s) - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -625,7 +696,7 @@ Then the result should be 3 on the screen -> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(3) (0,0s) - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -662,7 +733,7 @@ System.FormatException: Input string was not in a correct format. - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -731,7 +802,139 @@ namespace MyNamespace - + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 40 into the calculator +-> skipped because of previous errors +And I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 90 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 180 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_40 threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 19 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_40() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + + + + + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 60 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +And I have entered 130 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 260 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_60 threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 19 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_60() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + + + + + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 120 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddTwoNumbers threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 12 + + + + + Then failing step -> error: @@ -763,7 +966,7 @@ Shouldly.ChuckedAWobbly: - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -782,13 +985,13 @@ Shouldly.ChuckedAWobbly: - + Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -807,19 +1010,19 @@ Shouldly.ChuckedAWobbly: - + Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) - + Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -894,7 +1097,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -969,7 +1172,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -1044,23 +1247,21 @@ namespace MyNamespace - - - + - + Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) - + Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) - + Then the scenario will 'inconclusive_1' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") @@ -1080,7 +1281,7 @@ namespace MyNamespace - + Then the scenario will 'inconclusive_2' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") @@ -1100,7 +1301,7 @@ namespace MyNamespace - + Then the scenario will 'fail_1' -> error: @@ -1133,7 +1334,7 @@ Shouldly.ChuckedAWobbly: - + Then the scenario will 'fail_2' -> error: @@ -1166,31 +1367,31 @@ Shouldly.ChuckedAWobbly: - + When I have backslashes in the value, for example a 'c:\Temp\' -> done: ScenarioOutlineSteps.WhenIHaveBackslashesInTheValueForExampleAFilePath("c:\Temp\") (0,0s) - + Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) - + Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) - + Then the scenario will 'pass_3' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_3") (0,0s) - + Then the scenario will 'fail_1' -> error: @@ -1223,19 +1424,19 @@ Shouldly.ChuckedAWobbly: - + Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) - + Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) - + Then the scenario will 'inconclusive_1' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") @@ -1255,13 +1456,13 @@ Shouldly.ChuckedAWobbly: - + Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) - + Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs similarity index 90% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs index 1e208a657..4610cddaf 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs @@ -29,9 +29,9 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] public class WhenDeterminingTheSignatureOfAnNUnitExampleRow : BaseFixture @@ -42,7 +42,7 @@ public void ThenCanSuccessfullyMatch() var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers" }; var exampleRow = new[] { "40", "50", "90" }; - var signatureBuilder = Container.Resolve(); + var signatureBuilder = new NUnitExampleSignatureBuilder(); Regex signature = signatureBuilder.Build(scenarioOutline, exampleRow); var isMatch = signature.IsMatch("Pickles.TestHarness.AdditionFeature.AddingSeveralNumbers(\"40\",\"50\",\"90\",System.String[])".ToLowerInvariant()); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs similarity index 89% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs index 76694f538..26d5c2348 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] - public class WhenParsingMultipleNUnitResultsFilesForASingleFeature : WhenParsingTestResultFiles + public class WhenParsingMultipleNUnitResultsFilesForASingleFeature : WhenParsingTestResultFiles { public WhenParsingMultipleNUnitResultsFilesForASingleFeature() - : base("NUnit2." + @"results-example-nunit - Run 1.xml;" + "NUnit2." + "results-example-nunit - Run 2.xml") + : base("NUnit.NUnit2." + @"results-example-nunit - Run 1.xml;" + "NUnit.NUnit2." + "results-example-nunit - Run 2.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs new file mode 100644 index 000000000..5c88985b0 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs @@ -0,0 +1,133 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 +{ + [TestFixture] + public class WhenParsingNUnitResultsFile : StandardTestSuite + { + public WhenParsingNUnitResultsFile() + : base("NUnit.NUnit2." + "results-example-nunit.xml") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadPassedFeatureResultSuccessfully() + { + base.ThenCanReadPassedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedFeatureResultSuccessfully() + { + base.ThenCanReadFailedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..b3b6acc4a --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 +{ + [TestFixture] + public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingNUnitResultsFileWithIndividualResults() + : base("NUnit.NUnit2." + "results-example-nunit.xml") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs similarity index 86% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs index 46ff7cfe0..146ee8c79 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] - public class WhenParsingProblematicScenarioOutlineResults : WhenParsingTestResultFiles + public class WhenParsingProblematicScenarioOutlineResults : WhenParsingTestResultFiles { public WhenParsingProblematicScenarioOutlineResults() - : base("NUnit2." + "results-problem-with-outline-results-nunit.xml") + : base("NUnit.NUnit2." + "results-problem-with-outline-results-nunit.xml") { } @@ -41,7 +41,6 @@ public WhenParsingProblematicScenarioOutlineResults() public void ThenCanReadIndividualResultsFromScenarioOutline_ContainingDollarSigns_ShouldBeTestResultSuccess() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); var feature = new Feature { Name = "ExampleWebFeature" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs similarity index 87% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs index 10ad976a2..0f7f0c88f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] - public class WhenParsingnUnit2ResultsFileWithMissingTraits : WhenParsingTestResultFiles + public class WhenParsingnUnit2ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingnUnit2ResultsFileWithMissingTraits() - : base("NUnit2." + "results-example-nunit-missingTraits.xml") + : base("NUnit.NUnit2." + "results-example-nunit-missingTraits.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit - Run 1.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit - Run 1.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit - Run 1.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit - Run 1.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit - Run 2.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit - Run 2.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit - Run 2.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit - Run 2.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit-missingTraits.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit-missingTraits.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit-missingTraits.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit-missingTraits.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml similarity index 75% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml index 6ebfb89e1..fdcc5ecca 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-example-nunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml @@ -1,24 +1,24 @@ - + - + - + - + - + - + - + - + @@ -27,7 +27,7 @@ - + @@ -53,7 +53,7 @@ at Pickles.TestHarness.nunit.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Cod - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -132,16 +200,16 @@ at Pickles.TestHarness.nunit.MinimalFeatures.FailingFeature.FailingFeatureFailin - + - + - + - + - - - - - - + - + @@ -265,7 +328,7 @@ namespace MyNamespace ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2")]]> - + - + - + - + - + - + - + @@ -345,11 +408,11 @@ at Pickles.TestHarness.nunit.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhere - + - + - + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-problem-with-outline-results-nunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-problem-with-outline-results-nunit.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/results-problem-with-outline-results-nunit.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-problem-with-outline-results-nunit.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs similarity index 90% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs index 68f8aa9d3..e7e96aa64 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs @@ -29,9 +29,9 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 { [TestFixture] public class WhenDeterminingTheSignatureOfAnNunit3ExampleRow : BaseFixture @@ -42,7 +42,7 @@ public void ThenCanSuccessfullyMatch() var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers" }; var exampleRow = new[] { "40", "50", "90" }; - var signatureBuilder = Container.Resolve(); + var signatureBuilder = new NUnitExampleSignatureBuilder(); Regex signature = signatureBuilder.Build(scenarioOutline, exampleRow); var isMatch = signature.IsMatch("AddingSeveralNumbers(\"40\",\"50\",\"90\",System.String[])".ToLowerInvariant()); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..00d0ad342 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 +{ + [TestFixture] + public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingNUnitResultsFileWithIndividualResults() + : base("NUnit.NUnit3." + "results-example-nunit3.xml") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs new file mode 100644 index 000000000..c671fd244 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -0,0 +1,103 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 +{ + [TestFixture] + public class WhenParsingNunit3ResultsFile : StandardTestSuite + { + public WhenParsingNunit3ResultsFile() + : base("NUnit.NUnit3." + "results-example-nunit3.xml") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs similarity index 89% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs index f8b6f92cd..bb2c568ba 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 { [TestFixture] public class WhenParsingnUnit3ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingnUnit3ResultsFileWithMissingTraits() - : base("NUnit3." + "results-example-nunit3-missingTraits.xml") + : base("NUnit.NUnit3." + "results-example-nunit3-missingTraits.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/results-example-nunit3-missingTraits.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3-missingTraits.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/results-example-nunit3-missingTraits.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3-missingTraits.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/results-example-nunit3.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3.xml similarity index 66% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/results-example-nunit3.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3.xml index 1409da7fa..840fb433d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/results-example-nunit3.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3.xml @@ -1,44 +1,44 @@  - + - + - + - + - + - + - + - + - + done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) Given I have entered 60 into the calculator @@ -53,7 +53,7 @@ Then the result should be 260 on the screen -> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(260) (0,0s) ]]> - + done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) Given I have entered 40 into the calculator @@ -69,7 +69,7 @@ Then the result should be 180 on the screen ]]> - + @@ -86,7 +86,7 @@ Then the result should be 3 on the screen -> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(3) (0,0s) ]]> - + @@ -118,7 +118,7 @@ Then the result should be 3.2 on the screen -> error: Input string was not in a correct format. ]]> - + @@ -127,7 +127,7 @@ Then the result should be 3.2 on the screen - + @@ -191,18 +191,152 @@ Then unimplemented step ]]> - + + + + - + + + + + + + + + + + + + error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 60 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +And I have entered 130 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 260 on the screen +-> skipped because of previous errors +]]> + + + + + + + error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 40 into the calculator +-> skipped because of previous errors +And I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 90 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 180 on the screen +-> skipped because of previous errors +]]> + + + + + + + + + + + error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 120 on the screen +-> skipped because of previous errors +]]> + + + + + + + - + @@ -232,7 +366,7 @@ Then unimplemented step True ]]> - + @@ -244,7 +378,7 @@ Then unimplemented step -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -253,11 +387,11 @@ Then unimplemented step ]]> - + - + @@ -269,7 +403,7 @@ Then unimplemented step -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -278,11 +412,11 @@ Then unimplemented step ]]> - + - + @@ -292,21 +426,21 @@ Then unimplemented step - + - + - - - - - + - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + @@ -362,7 +493,7 @@ Then the result should be 120 on the screen -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") ]]> - + @@ -371,7 +502,7 @@ Then the result should be 120 on the screen -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") ]]> - + - + - + - + done: ScenarioOutlineSteps.WhenIHaveBackslashesInTheValueForExampleAFilePath("c:\Temp\") (0,0s) ]]> - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_3") (0,0s) ]]> - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs deleted file mode 100644 index 3cbe23ffd..000000000 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ /dev/null @@ -1,317 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; - -using NFluent; - -using NUnit.Framework; - -using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; - -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 -{ - [TestFixture] - public class WhenParsingNUnitResultsFile : WhenParsingTestResultFiles - { - public WhenParsingNUnitResultsFile() - : base("NUnit2." + "results-example-nunit.xml") - { - } - - [Test] - public void ThenCanReadFeatureResultSuccessfully() - { - // Write out the embedded test results file - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - } - - [Test] - public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(null); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - - Check.ThatCode(() => results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" })).Throws(); - } - - [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var passedScenario = new Scenario { Name = "Add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = feature }; - var result = results.GetScenarioResult(ignoredScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadInconclusiveScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var inconclusiveScenario = new Scenario - { - Name = "Not automated adding two numbers", - Feature = feature - }; - var result = results.GetScenarioResult(inconclusiveScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadInconclusiveFeatureResultSuccessfully() - { - var results = ParseResultsFile(); - var result = results.GetFeatureResult(this.InconclusiveFeature()); - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadPassedFeatureResultSuccessfully() - { - var results = ParseResultsFile(); - var result = results.GetFeatureResult(this.PassingFeature()); - Check.That(result).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadFailedFeatureResultSuccessfully() - { - var results = ParseResultsFile(); - var result = results.GetFeatureResult(this.FailingFeature()); - Check.That(result).IsEqualTo(TestResult.Failed); - } - - private Feature FailingFeature() - { - return new Feature { Name = "Failing" }; - } - - private Feature InconclusiveFeature() - { - return new Feature { Name = "Inconclusive" }; - } - - private Feature PassingFeature() - { - return new Feature { Name = "Passing" }; - } - - [Test] - public void ThenCanReadNotFoundScenarioCorrectly() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var notFoundScenario = new Scenario - { - Name = "Not in the file at all!", - Feature = feature - }; - - var result = results.GetScenarioResult(notFoundScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadNotFoundFeatureCorrectly() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "NotInTheFile" }; - var result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where all scenarios pass", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "pass_3" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario is inconclusive", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Inconclusive); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario fails", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "And we can go totally bonkers with multiple example sections.", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Inconclusive); - - TestResult exampleResult4 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_2" }); - Check.That(exampleResult4).IsEqualTo(TestResult.Inconclusive); - - TestResult exampleResult5 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult5).IsEqualTo(TestResult.Failed); - - TestResult exampleResult6 = results.GetExampleResult(scenarioOutline, new[] { "fail_2" }); - Check.That(exampleResult6).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadResultsWithBackslashes() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "Deal correctly with backslashes in the examples", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { @"c:\Temp\" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index acb5dbbd9..47c6514c3 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -59,29 +59,44 @@ + + + + + + + - - - - + + + + + + + - - - + + + + + + - + - - + + - - - - - + + + + + + + @@ -102,13 +117,13 @@ - + - + - + Designer @@ -116,21 +131,34 @@ - + Designer - + - + Designer + + + Designer + + + Designer + + + Designer + + + Designer + @@ -155,23 +183,23 @@ - + - + - + Designer - + Designer - + Designer diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.v2.ncrunchproject b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.v2.ncrunchproject new file mode 100644 index 000000000..30815b193 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.v2.ncrunchproject @@ -0,0 +1,26 @@ + + true + 1000 + false + false + false + true + false + false + false + false + false + true + true + false + true + true + true + 60000 + + + + AutoDetect + STA + x86 + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index f1f3275a0..0b323fbab 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -50,33 +50,22 @@ public void GetFeatureResult_OnePassingOneInconclusive_ReturnsPassed() Check.That(result).IsEqualTo(TestResult.Passed); } - private static MultipleTestResults CreateMultipleTestResults(ITestResults testResults1, ITestResults testResults2) + private static MultipleTestRunsBase CreateMultipleTestResults(SingleTestRunBase testResults1, SingleTestRunBase testResults2) { return new TestableMultipleTestResults(new[] { testResults1, testResults2 }); } - private class TestableMultipleTestResults : MultipleTestResults + private class TestableMultipleTestResults : MultipleTestRunsBase { - public TestableMultipleTestResults(IEnumerable testResults) - : base(false, testResults) + public TestableMultipleTestResults(IEnumerable testResults) + : base(testResults) { } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) - { - throw new NotSupportedException(); - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - // not needed since we use the other constructor - throw new NotSupportedException(); - } } - private static Mock SetupStubForGetFeatureResult(Feature feature, TestResult resultOfGetFeatureResult) + private static Mock SetupStubForGetFeatureResult(Feature feature, TestResult resultOfGetFeatureResult) { - var testResults1 = new Mock(); + var testResults1 = new Mock(); testResults1.Setup(ti => ti.GetFeatureResult(feature)).Returns(resultOfGetFeatureResult); return testResults1; } @@ -126,9 +115,9 @@ public void GetScenarioOutlineResult_OnePassingOneInconclusive_ReturnsPassed() Check.That(result).IsEqualTo(TestResult.Passed); } - private static Mock SetupStubForGetScenarioOutlineResult(TestResult resultOfGetFeatureResult) + private static Mock SetupStubForGetScenarioOutlineResult(TestResult resultOfGetFeatureResult) { - var testResults1 = new Mock(); + var testResults1 = new Mock(); testResults1.Setup(ti => ti.GetScenarioOutlineResult(It.IsAny())).Returns(resultOfGetFeatureResult); return testResults1; } @@ -178,9 +167,9 @@ public void GetScenarioResult_OnePassingOneInconclusive_ReturnsPassed() Check.That(result).IsEqualTo(TestResult.Passed); } - private static Mock SetupStubForGetScenarioResult(TestResult resultOfGetFeatureResult) + private static Mock SetupStubForGetScenarioResult(TestResult resultOfGetFeatureResult) { - var testResults1 = new Mock(); + var testResults1 = new Mock(); testResults1.Setup(ti => ti.GetScenarioResult(It.IsAny())).Returns(resultOfGetFeatureResult); return testResults1; } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs index 0128ddfd9..177ae2cfa 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs @@ -20,17 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.SpecRun; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.SpecRun { [TestFixture] - public class WhenParsingSpecRunTestResultsFile : WhenParsingTestResultFiles + public class WhenParsingSpecRunTestResultsFile : StandardTestSuite { public WhenParsingSpecRunTestResultsFile() : base("SpecRun." + "results-example-specrun.html") @@ -38,125 +35,81 @@ public WhenParsingSpecRunTestResultsFile() } [Test] - public void ThenCanReadBackgroundResultSuccessfully() + public new void ThenCanReadBackgroundResultSuccessfully() { - var background = new Scenario { Name = "Background", Feature = this.AdditionFeature() }; - var feature = this.AdditionFeature(); - feature.AddBackground(background); - var results = ParseResultsFile(); - - TestResult result = results.GetScenarioResult(background); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadBackgroundResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveFeatureResultSuccessfully() + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.InconclusiveFeature()); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); } [Test] - public void ThenCanReadFailedFeatureResultSuccessfully() + public new void ThenCanReadFailedFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.FailingFeature()); - - Check.That(result).IsEqualTo(TestResult.Failed); + base.ThenCanReadFailedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadPassedFeatureResultSuccessfully() + public new void ThenCanReadPassedFeatureResultSuccessfully() { - var results = ParseResultsFile(); - - TestResult result = results.GetFeatureResult(this.PassingFeature()); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadPassedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() + public new void ThenCanReadScenarioOutlineResultSuccessfully() { - var results = ParseResultsFile(); - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = this.AdditionFeature() }; - - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var passedScenario = new Scenario { Name = "Add two numbers", Feature = this.AdditionFeature() }; - - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() + public new void ThenCanReadFailedScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = this.AdditionFeature() }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() + public new void ThenCanReadIgnoredScenarioResultSuccessfully() { - var results = ParseResultsFile(); - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = this.AdditionFeature() }; - - var result = results.GetScenarioResult(ignoredScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveScenarioResultSuccessfully() + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() { - var results = ParseResultsFile(); - - var inconclusiveScenario = new Scenario - { - Name = "Not automated adding two numbers", - Feature = this.AdditionFeature() - }; - - var result = results.GetScenarioResult(inconclusiveScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } - private Feature AdditionFeature() + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() { - return new Feature { Name = "Addition" }; + base.ThenCanReadResultOfScenarioWithFailingBackground(); } - private Feature InconclusiveFeature() + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() { - return new Feature { Name = "Inconclusive" }; + base.ThenCanReadResultOfFeatureWithFailingBackground(); } - private Feature FailingFeature() + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() { - return new Feature { Name = "Failing" }; + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); } - private Feature PassingFeature() + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() { - return new Feature { Name = "Passing" }; + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..ca1ad4be1 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.SpecRun; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.SpecRun +{ + [TestFixture] + public class WhenParsingSpecRunTestResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingSpecRunTestResultsFileWithIndividualResults() + : base("SpecRun." + "results-example-specrun.html") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html index bd75430c2..72bffb7eb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html @@ -55,6 +55,23 @@ </scenario> </scenarios> </feature> + <feature> + <title>Failing Background</title> + <scenarios> + <scenario> + <title>Add two numbers</title> + <result>Failed</result> + </scenario> + <scenario> + <title>Adding several numbers, 60</title> + <result>Failed</result> + </scenario> + <scenario> + <title>Adding several numbers, 40</title> + <result>Failed</result> + </scenario> + </scenarios> + </feature> <feature> <title>Inconclusive</title> <scenarios> @@ -166,4 +183,9 @@ </features> Pickles End --> - \ No newline at end of file + +
+Generated by an evaluation version of SpecRun.
+This version can be used for evaluation purposes only.
+For obtaining a registered license please visit http://www.specrun.com. +
diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs new file mode 100644 index 000000000..714869712 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -0,0 +1,253 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using NFluent; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests +{ + public abstract class StandardTestSuite : WhenParsingTestResultFiles + where TResults : ITestResults + { + protected StandardTestSuite(string resultsFileName) + : base(resultsFileName) + { + } + + public void ThenCanReadFeatureResultSuccessfully() + { + // Write out the embedded test results file + var results = ParseResultsFile(); + + var feature = this.AdditionFeature(); + TestResult result = results.GetFeatureResult(feature); + + Check.That(result).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadBackgroundResultSuccessfully() + { + var background = new Scenario { Name = "Background", Feature = this.AdditionFeature() }; + var feature = this.AdditionFeature(); + feature.AddBackground(background); + var results = ParseResultsFile(); + + TestResult result = results.GetScenarioResult(background); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + public void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + var results = ParseResultsFile(); + + TestResult result = results.GetFeatureResult(this.InconclusiveFeature()); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + + public void ThenCanReadFailedFeatureResultSuccessfully() + { + var results = ParseResultsFile(); + + TestResult result = results.GetFeatureResult(this.FailingFeature()); + + Check.That(result).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadPassedFeatureResultSuccessfully() + { + var results = ParseResultsFile(); + + TestResult result = results.GetFeatureResult(this.PassingFeature()); + + Check.That(result).IsEqualTo(TestResult.Passed); + } + + public void ThenCanReadScenarioOutlineResultSuccessfully() + { + var results = ParseResultsFile(); + var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = this.AdditionFeature() }; + + TestResult result = results.GetScenarioOutlineResult(scenarioOutline); + + Check.That(result).IsEqualTo(TestResult.Passed); + + TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90", "180" }); + Check.That(exampleResult1).IsEqualTo(TestResult.Passed); + + TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130", "260" }); + Check.That(exampleResult2).IsEqualTo(TestResult.Passed); + } + + public void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + var passedScenario = new Scenario { Name = "Add two numbers", Feature = this.AdditionFeature() }; + + TestResult result = results.GetScenarioResult(passedScenario); + + Check.That(result).IsEqualTo(TestResult.Passed); + } + + public void ThenCanReadFailedScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + var scenario = new Scenario { Name = "Fail to add two numbers", Feature = this.AdditionFeature() }; + TestResult result = results.GetScenarioResult(scenario); + + Check.That(result).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadIgnoredScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = this.AdditionFeature() }; + + var result = results.GetScenarioResult(ignoredScenario); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + public void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + + var inconclusiveScenario = new Scenario + { + Name = "Not automated adding two numbers", + Feature = this.AdditionFeature() + }; + + var result = results.GetScenarioResult(inconclusiveScenario); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + public void ThenCanReadNotFoundScenarioCorrectly() + { + var results = ParseResultsFile(); + var notFoundScenario = new Scenario + { + Name = "Not in the file at all!", + Feature = this.AdditionFeature() + }; + + var result = results.GetScenarioResult(notFoundScenario); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + public void ThenCanReadNotFoundFeatureCorrectly() + { + var results = ParseResultsFile(); + var result = results.GetFeatureResult(new Feature { Name = "NotInTheFile" }); + + Check.That(result).IsEqualTo(TestResult.Inconclusive); + } + + public void ThenCanReadResultsWithBackslashes() + { + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Scenario Outlines" }; + + var scenarioOutline = new ScenarioOutline { Name = "Deal correctly with backslashes in the examples", Feature = feature }; + + TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); + Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); + + TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { @"c:\Temp\" }); + Check.That(exampleResult1).IsEqualTo(TestResult.Passed); + } + + public void ThenCanReadResultOfScenarioWithFailingBackground() + { + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Failing Background" }; + + var scenario = new Scenario { Name = "Add two numbers", Feature = feature }; + + var actualResult = results.GetScenarioResult(scenario); + + Check.That(actualResult).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Failing Background" }; + + var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; + + var actualResult = results.GetScenarioOutlineResult(scenarioOutline); + + Check.That(actualResult).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Failing Background" }; + + var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; + + var actualResult = results.GetExampleResult(scenarioOutline, new string[] { "60", "70", "130", "260" }); + + Check.That(actualResult).IsEqualTo(TestResult.Failed); + } + + public void ThenCanReadResultOfFeatureWithFailingBackground() + { + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Failing Background" }; + + var actualResult = results.GetFeatureResult(feature); + + Check.That(actualResult).IsEqualTo(TestResult.Failed); + } + + private Feature AdditionFeature() + { + return new Feature { Name = "Addition" }; + } + + private Feature InconclusiveFeature() + { + return new Feature { Name = "Inconclusive" }; + } + + private Feature FailingFeature() + { + return new Feature { Name = "Failing" }; + } + + private Feature PassingFeature() + { + return new Feature { Name = "Passing" }; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs similarity index 50% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs index ce4a1c759..bb647fcb1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -22,121 +22,24 @@ using NFluent; -using NUnit.Framework; - using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests { - [TestFixture] - public class WhenParsingNunit3ResultsFile : WhenParsingTestResultFiles + public class StandardTestSuiteForScenarioOutlines : WhenParsingTestResultFiles + where TResults : ITestResults { - public WhenParsingNunit3ResultsFile() - : base("NUnit3." + "results-example-nunit3.xml") - { - } - - [Test] - public void ThenCanReadFeatureResultSuccessfully() - { - // Write out the embedded test results file - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); + private readonly TestResult valueForInconclusive; - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + protected StandardTestSuiteForScenarioOutlines(string resultsFileName, bool treatInconclusiveAsFailed = false) + : base(resultsFileName) { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var passedScenario = new Scenario { Name = "Add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); + this.valueForInconclusive = treatInconclusiveAsFailed ? TestResult.Failed : TestResult.Inconclusive; } - [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = feature }; - var result = results.GetScenarioResult(ignoredScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadNotFoundScenarioCorrectly() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var notFoundScenario = new Scenario - { - Name = "Not in the file at all!", - Feature = feature - }; - - var result = results.GetScenarioResult(notFoundScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(null); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - - Check.ThatCode(() => results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" })).Throws(); - } - - [Test] public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -155,18 +58,16 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest Check.That(exampleResult3).IsEqualTo(TestResult.Passed); } - [Test] public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario is inconclusive", Feature = feature }; TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Inconclusive); + Check.That(exampleResultOutline).IsEqualTo(this.valueForInconclusive); TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); Check.That(exampleResult1).IsEqualTo(TestResult.Passed); @@ -175,14 +76,12 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_Shou Check.That(exampleResult2).IsEqualTo(TestResult.Passed); TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Inconclusive); + Check.That(exampleResult3).IsEqualTo(this.valueForInconclusive); } - [Test] public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -201,11 +100,9 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe Check.That(exampleResult3).IsEqualTo(TestResult.Failed); } - [Test] public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -221,10 +118,10 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti Check.That(exampleResult2).IsEqualTo(TestResult.Passed); TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Inconclusive); + Check.That(exampleResult3).IsEqualTo(this.valueForInconclusive); TestResult exampleResult4 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_2" }); - Check.That(exampleResult4).IsEqualTo(TestResult.Inconclusive); + Check.That(exampleResult4).IsEqualTo(this.valueForInconclusive); TestResult exampleResult5 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); Check.That(exampleResult5).IsEqualTo(TestResult.Failed); @@ -232,22 +129,5 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti TestResult exampleResult6 = results.GetExampleResult(scenarioOutline, new[] { "fail_2" }); Check.That(exampleResult6).IsEqualTo(TestResult.Failed); } - - [Test] - public void ThenCanReadResultsWithBackslashes() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "Deal correctly with backslashes in the examples", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { @"c:\Temp\" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingMultipleVsTestTestResultsFiles.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingMultipleVsTestTestResultsFiles.cs new file mode 100644 index 000000000..f74a8276b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingMultipleVsTestTestResultsFiles.cs @@ -0,0 +1,82 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NFluent; + +using NUnit.Framework; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.VsTest; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.VsTest +{ + [TestFixture] + public class WhenParsingMultipleVsTestTestResultsFiles : WhenParsingTestResultFiles + { + public WhenParsingMultipleVsTestTestResultsFiles() + : base("VsTest." + "results-example-vstest - Run 1 (failing).trx;" + "MsTest." + "results-example-mstest - Run 2 (passing).trx") + { + } + + [Test] + public void ThenCanReadFailedFeatureResultSuccessfully() + { + var results = ParseResultsFile(); + + TestResult result = results.GetFeatureResult(new Feature { Name = "Failing" }); + + Check.That(result).IsEqualTo(TestResult.Failed); + } + + [Test] + public void ThenCanReadPassedScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + + var scenario = new Scenario + { + Name = "Failing Feature Passing Scenario", + Feature = new Feature { Name = "Failing" } + }; + + var result = results.GetScenarioResult(scenario); + + Check.That(result).IsEqualTo(TestResult.Passed); + } + + [Test] + public void ThenCanReadFailedScenarioResultSuccessfully() + { + var results = ParseResultsFile(); + + var scenario = new Scenario + { + Name = "Failing Feature Failing Scenario", + Feature = new Feature { Name = "Failing" } + }; + + var result = results.GetScenarioResult(scenario); + + Check.That(result).IsEqualTo(TestResult.Failed); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFile.cs new file mode 100644 index 000000000..8bfd222c3 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFile.cs @@ -0,0 +1,139 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.VsTest; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.VsTest +{ + [TestFixture] + public class WhenParsingVsTestResultsFile : StandardTestSuite + { + public WhenParsingVsTestResultsFile() + : base("VsTest." + "results-example-vstest.trx") + { + } + + [Test] + public new void ThenCanReadBackgroundResultSuccessfully() + { + base.ThenCanReadBackgroundResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedFeatureResultSuccessfully() + { + base.ThenCanReadFailedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadPassedFeatureResultSuccessfully() + { + base.ThenCanReadPassedFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..b8d0af789 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs @@ -0,0 +1,61 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.VsTest; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.VsTest +{ + [TestFixture] + public class WhenParsingVsTestResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingVsTestResultsFileWithIndividualResults() + : base("VsTest." + "results-example-vstest.trx") + { + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithMissingTraits.cs new file mode 100644 index 000000000..641bd51f9 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithMissingTraits.cs @@ -0,0 +1,51 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NFluent; + +using NUnit.Framework; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.VsTest; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.VsTest +{ + [TestFixture] + public class WhenParsingVsTestResultsFileWithMissingTraits : WhenParsingTestResultFiles + { + public WhenParsingVsTestResultsFileWithMissingTraits() + : base("VsTest." + "results-example-vstest-missingTraits.trx") + { + } + + [Test] + public void ThenCanReadFeatureResultWithoutThrowingException() + { + // Write out the embedded test results file + var results = ParseResultsFile(); + + var feature = new Feature { Name = "Addition" }; + + Check.ThatCode(() => results.GetFeatureResult(feature)).DoesNotThrow(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 1 (failing).trx b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 1 (failing).trx new file mode 100644 index 000000000..b3889479b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 1 (failing).trx @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + Then failing step + -> error: + true + should be + False + but was + True + + + + Test method Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario threw exception: + Shouldly.ChuckedAWobbly: + true + should be + False + but was + True + + + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.MinimalFeatures.MinimalSteps.ThenFailingStep() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\MinimalFeatures\MinimalSteps.cs:line 24 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature.cs:line 0 + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature:line 10 + + + + + + + + + + + + + + + + + + + + + + Test 'IgnoredAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedScenario1' was skipped in the test run.Test 'NotAutomatedScenario2' was skipped in the test run.Test 'NotAutomatedScenario3' was skipped in the test run.Test 'ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_2' was skipped in the test run.Test 'FailingFeatureInconclusiveScenario' was skipped in the test run.Test 'InconclusiveFeatureInconclusiveScenario' was skipped in the test run. + + + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 2 (passing).trx b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 2 (passing).trx new file mode 100644 index 000000000..09f521d28 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 2 (passing).trx @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + Then passing step + -> done: MinimalSteps.ThenPassingStep() (0,0s) + + + + + + + + + + + + + + + + + + + + + Test 'IgnoredAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedScenario1' was skipped in the test run.Test 'NotAutomatedScenario2' was skipped in the test run.Test 'NotAutomatedScenario3' was skipped in the test run.Test 'ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_2' was skipped in the test run.Test 'FailingFeatureInconclusiveScenario' was skipped in the test run.Test 'InconclusiveFeatureInconclusiveScenario' was skipped in the test run. + + + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest-missingTraits.trx b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest-missingTraits.trx new file mode 100644 index 000000000..dfb297203 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest-missingTraits.trx @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'IgnoredAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedScenario1' was skipped in the test run.Test 'NotAutomatedScenario2' was skipped in the test run.Test 'NotAutomatedScenario3' was skipped in the test run.Test 'ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_2' was skipped in the test run.Test 'FailingFeatureInconclusiveScenario' was skipped in the test run.Test 'InconclusiveFeatureInconclusiveScenario' was skipped in the test run. + + + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest.trx b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest.trx new file mode 100644 index 000000000..16b25a558 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest.trx @@ -0,0 +1,1020 @@ + + + + + + + + + + + + + + Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 60 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(60) (0,0s) +And I have entered 70 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(70) (0,0s) +And I have entered 130 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(130) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 260 on the screen +-> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(260) (0,0s) + + + + + Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 40 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(40) (0,0s) +And I have entered 50 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(50) (0,0s) +And I have entered 90 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(90) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 180 on the screen +-> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(180) (0,0s) + + + + + Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 1 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(1) (0,0s) +And I have entered 2 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(2) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 3 on the screen +-> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(3) (0,0s) + + + + + Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 1 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(1) (0,0s) +And I have entered 2.2 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(2,2) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 3.2 on the screen +-> error: Input string was not in a correct format. + + Test method Pickles.TestHarness.MsTest.AdditionFeature.FailToAddTwoNumbers threw exception: +System.FormatException: Input string was not in a correct format. + at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) + at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) + at System.String.System.IConvertible.ToInt32(IFormatProvider provider) + at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) + at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.ConvertSimple(Type typeToConvertTo, Object value, CultureInfo cultureInfo) + at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.ConvertSimple(IBindingType typeToConvertTo, Object value, CultureInfo cultureInfo) + at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.Convert(Object value, IBindingType typeToConvertTo, CultureInfo cultureInfo) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ConvertArg(Object value, IBindingType typeToConvertTo) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.<>c__DisplayClass5.<GetExecuteArguments>b__4(Object arg, Int32 argIndex) + at System.Linq.Enumerable.<SelectIterator>d__5`2.MoveNext() + at System.Linq.Buffer`1..ctor(IEnumerable`1 source) + at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.GetExecuteArguments(BindingMatch match) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Addition.feature.cs:line 0 + at Pickles.TestHarness.MsTest.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Addition.feature:line 34 + + + + + + + + Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +When unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Then unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + Assert.Inconclusive failed. No matching step definition found for one or more steps. +using System; +using TechTalk.SpecFlow; + +namespace MyNamespace +{ + [Binding] + public class StepDefinitions + { + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + } +} + + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Addition.feature.cs:line 0 + at Pickles.TestHarness.MsTest.AdditionFeature.NotAutomatedAddingTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Addition.feature:line 46 + + + + + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 120 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddTwoNumbers threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 12 + + + + + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 60 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +And I have entered 130 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 260 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_60 threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 19 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_60() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + + + + + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 40 into the calculator +-> skipped because of previous errors +And I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 90 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 180 on the screen +-> skipped because of previous errors + + Test method Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_40 threw exception: +Shouldly.ChuckedAWobbly: + 1 + should be + 2 + but was + 1 + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 19 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddingSeveralNumbers_40() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature.cs:line 0 + + + + + + + Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +When unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Then unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + Assert.Inconclusive failed. No matching step definition found for one or more steps. +using System; +using TechTalk.SpecFlow; + +namespace MyNamespace +{ + [Binding] + public class StepDefinitions + { + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + } +} + + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature.cs:line 0 + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.NotAutomatedScenario1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature:line 9 + + + + + + + Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +When unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Then unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + Assert.Inconclusive failed. No matching step definition found for one or more steps. +using System; +using TechTalk.SpecFlow; + +namespace MyNamespace +{ + [Binding] + public class StepDefinitions + { + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + } +} + + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature.cs:line 0 + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature:line 14 + + + + + + + Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Given unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +When unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + +Then unimplemented step +-> No matching step definition found for the step. Use the following code to create one: + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + Assert.Inconclusive failed. No matching step definition found for one or more steps. +using System; +using TechTalk.SpecFlow; + +namespace MyNamespace +{ + [Binding] + public class StepDefinitions + { + [Given(@"unimplemented step")] + public void GivenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [When(@"unimplemented step")] + public void WhenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + + [Then(@"unimplemented step")] + public void ThenUnimplementedStep() + { + ScenarioContext.Current.Pending(); + } + } +} + + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature.cs:line 0 + at Pickles.TestHarness.MsTest.NotAutomatedAtAllFeature.NotAutomatedScenario3() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\NotAutomatedAtAll.feature:line 19 + + + + + + + Then the scenario will 'pass_1' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) + + + + + Then the scenario will 'pass_2' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) + + + + + Then the scenario will 'pass_3' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_3") (0,0s) + + + + + Then the scenario will 'pass_1' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) + + + + + Then the scenario will 'pass_2' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) + + + + + Then the scenario will 'inconclusive_1' +-> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") + + Assert.Inconclusive failed. One or more step definitions are not implemented yet. + ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 21 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive_Inconclusive_1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + Then the scenario will 'pass_1' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) + + + + + Then the scenario will 'pass_2' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) + + + + + Then the scenario will 'fail_1' +-> error: + true + should be + False + but was + True + + Test method Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails_Fail_1 threw exception: +Shouldly.ChuckedAWobbly: + true + should be + False + but was + True + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.ScenarioOutlineSteps.ThenTheScenarioWill(String result) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\ScenarioOutlineSteps.cs:line 21 + at lambda_method(Closure , IContextManager , String ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 34 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails_Fail_1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + Then the scenario will 'pass_1' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) + + + + + Then the scenario will 'pass_2' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) + + + + + Then the scenario will 'inconclusive_1' +-> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") + + Assert.Inconclusive failed. One or more step definitions are not implemented yet. + ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 45 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + Then the scenario will 'inconclusive_2' +-> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") + + Assert.Inconclusive failed. One or more step definitions are not implemented yet. + ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 45 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + Then the scenario will 'fail_1' +-> error: + true + should be + False + but was + True + + Test method Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet2_Fail_1 threw exception: +Shouldly.ChuckedAWobbly: + true + should be + False + but was + True + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.ScenarioOutlineSteps.ThenTheScenarioWill(String result) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\ScenarioOutlineSteps.cs:line 21 + at lambda_method(Closure , IContextManager , String ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 45 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet2_Fail_1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + Then the scenario will 'fail_2' +-> error: + true + should be + False + but was + True + + Test method Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet2_Fail_2 threw exception: +Shouldly.ChuckedAWobbly: + true + should be + False + but was + True + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.ScenarioOutlineSteps.ThenTheScenarioWill(String result) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\ScenarioOutlineSteps.cs:line 21 + at lambda_method(Closure , IContextManager , String ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature:line 45 + at Pickles.TestHarness.MsTest.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet2_Fail_2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\ScenarioOutlines.feature.cs:line 0 + + + + + + + When I have backslashes in the value, for example a 'c:\Temp\' +-> done: ScenarioOutlineSteps.WhenIHaveBackslashesInTheValueForExampleAFilePath("c:\Temp\") (0,0s) + + + + + + Then passing step +-> done: MinimalSteps.ThenPassingStep() (0,0s) + + + + + Then inconclusive step +-> pending: MinimalSteps.ThenInconclusiveStep() + + Assert.Inconclusive failed. One or more step definitions are not implemented yet. + MinimalSteps.ThenInconclusiveStep() + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature.cs:line 0 + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.FailingFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature:line 7 + + + + + + + Then failing step +-> error: + true + should be + False + but was + True + + Test method Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario threw exception: +Shouldly.ChuckedAWobbly: + true + should be + False + but was + True + at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.MinimalFeatures.MinimalSteps.ThenFailingStep() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\MinimalFeatures\MinimalSteps.cs:line 24 + at lambda_method(Closure , IContextManager ) + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature.cs:line 0 + at Pickles.TestHarness.MsTest.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Failing.feature:line 10 + + + + + + + Then passing step +-> done: MinimalSteps.ThenPassingStep() (0,0s) + + + + + Then inconclusive step +-> pending: MinimalSteps.ThenInconclusiveStep() + + Assert.Inconclusive failed. One or more step definitions are not implemented yet. + MinimalSteps.ThenInconclusiveStep() + at lambda_method(Closure , String , Object[] ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestPending(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at Pickles.TestHarness.MsTest.MinimalFeatures.InconclusiveFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Inconclusive.feature.cs:line 0 + at Pickles.TestHarness.MsTest.MinimalFeatures.InconclusiveFeature.InconclusiveFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\Minimal Features\Inconclusive.feature:line 7 + + + + + + + Then passing step +-> done: MinimalSteps.ThenPassingStep() (0,0s) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'IgnoredAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedAddingTwoNumbers' was skipped in the test run.Test 'NotAutomatedScenario1' was skipped in the test run.Test 'NotAutomatedScenario2' was skipped in the test run.Test 'NotAutomatedScenario3' was skipped in the test run.Test 'ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_1' was skipped in the test run.Test 'AndWeCanGoTotallyBonkersWithMultipleExampleSections__ExampleSet1_Inconclusive_2' was skipped in the test run.Test 'FailingFeatureInconclusiveScenario' was skipped in the test run.Test 'InconclusiveFeatureInconclusiveScenario' was skipped in the test run. + + + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs index 7159f5d90..b2230fd86 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenParsingTestResultFiles.cs @@ -26,11 +26,13 @@ using Autofac; +using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests { public abstract class WhenParsingTestResultFiles : BaseFixture + where TResults : ITestResults { private readonly string[] resultsFileNames; @@ -39,7 +41,7 @@ protected WhenParsingTestResultFiles(string resultsFileName) this.resultsFileNames = resultsFileName.Split(';'); } - protected TResults ParseResultsFile() + protected ITestResults ParseResultsFile() { this.AddTestResultsToConfiguration(); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index 954e3ba85..64b9451bb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -30,9 +30,12 @@ using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using PicklesDoc.Pickles.TestFrameworks.MsTest; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.VsTest; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests { @@ -76,7 +79,7 @@ public void ThenCanResolveAsSingletonWhenTestResultsAreMsTest() [Test] public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit() { - FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit2.results-example-nunit.xml")); + FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit2.results-example-nunit.xml")); var configuration = Container.Resolve(); configuration.TestResultsFormat = TestResultsFormat.NUnit; @@ -86,28 +89,66 @@ public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit() var item2 = Container.Resolve(); Check.That(item1).IsNotNull(); - Check.That(item1).IsInstanceOf(); + Check.That(item1).IsInstanceOf(); Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); + Check.That(item2).IsInstanceOf(); + Check.That(item1).IsSameReferenceThan(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).IsSameReferenceThan(item2); } [Test] public void ThenCanResolveAsSingletonWhenTestResultsArexUnit() { - FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit1.results-example-xunit.xml")); + FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit1.results-example-xunit.xml")); var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.xUnit; + 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(item1).IsInstanceOf(); Check.That(item2).IsNotNull(); - Check.That(item2).IsInstanceOf(); + Check.That(item2).IsInstanceOf(); + Check.That(item1).IsSameReferenceThan(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).IsSameReferenceThan(item2); } @@ -149,6 +190,25 @@ public void ThenCanResolveAsSingletonWhenTestResultsAreSpecrun() Check.That(item1).IsSameReferenceThan(item2); } + [Test] + public void ThenCanResolveAsSingletonWhenTestResultsAreVsTest() + { + 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(); + var item2 = Container.Resolve(); + + Check.That(item1).IsNotNull(); + Check.That(item1).IsInstanceOf(); + Check.That(item2).IsNotNull(); + Check.That(item2).IsInstanceOf(); + Check.That(item1).IsSameReferenceThan(item2); + } + [Test] public void ThenCanResolveWhenNoTestResultsSelected() { @@ -176,7 +236,7 @@ public void ThenCanResolveWhenTestResultsAreMsTest() [Test] public void ThenCanResolveWhenTestResultsAreNUnit() { - FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit2.results-example-nunit.xml")); + FileSystem.AddFile("results-example-nunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "NUnit.NUnit2.results-example-nunit.xml")); var configuration = Container.Resolve(); configuration.TestResultsFormat = TestResultsFormat.NUnit; @@ -185,22 +245,52 @@ public void ThenCanResolveWhenTestResultsAreNUnit() var item = Container.Resolve(); Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); + 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(); } [Test] public void ThenCanResolveWhenTestResultsArexUnit() { - FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit1.results-example-xunit.xml")); + FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit1.results-example-xunit.xml")); var configuration = Container.Resolve(); - configuration.TestResultsFormat = TestResultsFormat.xUnit; + 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(); + 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] @@ -232,5 +322,20 @@ public void ThenCanResolveWhenTestResultsAreSpecrun() 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(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs similarity index 89% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs index 7a89a0412..82bd74b7b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs @@ -21,17 +21,15 @@ using System; using System.Text.RegularExpressions; -using Autofac; - using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 { [TestFixture] public class WhenDeterminingTheSignatureOfAnXUnitExampleRow : BaseFixture @@ -42,7 +40,7 @@ public void ThenCanSuccessfullyMatch() var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers" }; var exampleRow = new[] { "40", "50", "90" }; - var signatureBuilder = Container.Resolve(); + var signatureBuilder = new XUnitExampleSignatureBuilder(); Regex signature = signatureBuilder.Build(scenarioOutline, exampleRow); var isMatch = signature.IsMatch("Pickles.TestHarness.xUnit.AdditionFeature.AddingSeveralNumbers(firstNumber: \"40\", secondNumber: \"50\", result: \"90\", exampleTags: System.String[])".ToLowerInvariant()); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..b67a36d22 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,62 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 +{ + [TestFixture] + public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingXUnitResultsFileWithIndividualResults() + : base("XUnit.XUnit1." + "results-example-xunit.xml", true) + { + } + + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs new file mode 100644 index 000000000..acdcec41c --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs @@ -0,0 +1,109 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 +{ + [TestFixture] + public class WhenParsingxUnitResultsFile : StandardTestSuite + { + public WhenParsingxUnitResultsFile() + : base("XUnit.XUnit1." + "results-example-xunit.xml") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs similarity index 87% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs index 988e59b62..e31fc8854 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 { [TestFixture] - public class WhenParsingxUnit1ResultsFileWithMissingTraits : WhenParsingTestResultFiles + public class WhenParsingxUnit1ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingxUnit1ResultsFileWithMissingTraits() - : base("XUnit1." + "results-example-xunit1-missingTraits.xml") + : base("XUnit.XUnit1." + "results-example-xunit1-missingTraits.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/results-example-xunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml similarity index 70% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/results-example-xunit.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml index 7c7d0c3be..6750283a6 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/results-example-xunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml @@ -1,4 +1,4 @@ -IgnoredGiven the calculator has clean memory +IgnoredGiven the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -54,7 +54,31 @@ namespace MyNamespace } at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature.cs:line 0 - at Pickles.TestHarness.xunit.AdditionFeature.NotAutomatedAddingTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature:line 46Given the calculator has clean memory + at Pickles.TestHarness.xunit.AdditionFeature.NotAutomatedAddingTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature:line 46Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 60 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(60) (0,0s) +And I have entered 70 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(70) (0,0s) +And I have entered 130 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(130) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 260 on the screen +-> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(260) (0,0s) +Given the calculator has clean memory +-> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +Given I have entered 40 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(40) (0,0s) +And I have entered 50 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(50) (0,0s) +And I have entered 90 into the calculator +-> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(90) (0,0s) +When I press add +-> done: AdditionSteps.WhenIPressAdd() (0,0s) +Then the result should be 180 on the screen +-> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(180) (0,0s) +Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) Given I have entered 1 into the calculator -> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(1) (0,0s) @@ -85,31 +109,101 @@ Then the result should be 3.2 on the screen at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.xunit.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature.cs:line 0 - at Pickles.TestHarness.xunit.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature:line 34Given the calculator has clean memory --> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) + at Pickles.TestHarness.xunit.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Addition.feature:line 34Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors Given I have entered 60 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(60) (0,0s) +-> skipped because of previous errors And I have entered 70 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(70) (0,0s) +-> skipped because of previous errors And I have entered 130 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(130) (0,0s) +-> skipped because of previous errors When I press add --> done: AdditionSteps.WhenIPressAdd() (0,0s) +-> skipped because of previous errors Then the result should be 260 on the screen --> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(260) (0,0s) -Given the calculator has clean memory --> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) +-> skipped because of previous errors +Shouldly.ChuckedAWobbly : + 1 + should be + 2 + but was + 1 at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at Pickles.TestHarness.xunit.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.xunit.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature:line 19Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors Given I have entered 40 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(40) (0,0s) +-> skipped because of previous errors And I have entered 50 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(50) (0,0s) +-> skipped because of previous errors And I have entered 90 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(90) (0,0s) +-> skipped because of previous errors When I press add --> done: AdditionSteps.WhenIPressAdd() (0,0s) +-> skipped because of previous errors Then the result should be 180 on the screen --> done: AdditionSteps.ThenTheResultShouldBeOnTheScreen(180) (0,0s) -Given unimplemented step +-> skipped because of previous errors +Shouldly.ChuckedAWobbly : + 1 + should be + 2 + but was + 1 at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at Pickles.TestHarness.xunit.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.xunit.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature:line 19Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +And the calculator has clean memory +-> skipped because of previous errors +Given I have entered 50 into the calculator +-> skipped because of previous errors +And I have entered 70 into the calculator +-> skipped because of previous errors +When I press add +-> skipped because of previous errors +Then the result should be 120 on the screen +-> skipped because of previous errors +Shouldly.ChuckedAWobbly : + 1 + should be + 2 + but was + 1 at Shouldly.ShouldlyCoreExtensions.AssertAwesomely[T](T actual, Func`2 specifiedConstraint, Object originalActual, Object originalExpected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldlyCoreExtensions.cs:line 18 + at Shouldly.ShouldBeTestExtensions.ShouldBe[T](T actual, T expected) in c:\TeamCity\buildAgent\work\10efaabfa8adbd4e\src\Shouldly\ShouldBeTestExtensions.cs:line 17 + at AutomationLayer.AdditionSteps.GivenTheBackgroundStepFails() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\AutomationLayer\AdditionSteps.cs:line 25 + at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) + at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() + at Pickles.TestHarness.xunit.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature.cs:line 0 + at Pickles.TestHarness.xunit.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\FailingBackground.feature:line 12Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: [Given(@"unimplemented step")] public void GivenUnimplementedStep() @@ -171,7 +265,7 @@ namespace MyNamespace } at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature.cs:line 0 - at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario3() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 19Given unimplemented step + at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 9Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: [Given(@"unimplemented step")] public void GivenUnimplementedStep() @@ -233,7 +327,7 @@ namespace MyNamespace } at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature.cs:line 0 - at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 9Given unimplemented step + at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario3() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 19Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: [Given(@"unimplemented step")] public void GivenUnimplementedStep() @@ -295,28 +389,17 @@ namespace MyNamespace } at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature.cs:line 0 - at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 14Then the scenario will 'pass_1' + at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 14Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) Then the scenario will 'pass_3' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_3") (0,0s) -When I have backslashes in the value, for example a 'c:\Temp\' --> done: ScenarioOutlineSteps.WhenIHaveBackslashesInTheValueForExampleAFilePath("c:\Temp\") (0,0s) -Then the scenario will 'pass_1' --> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) -Then the scenario will 'pass_2' --> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) -Then the scenario will 'inconclusive_1' --> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") -TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. - ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) - at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature.cs:line 0 - at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 21Then the scenario will 'pass_1' +Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) -Then the scenario will 'fail_1' +Then the scenario will 'fail_1' -> error: true should be @@ -336,11 +419,13 @@ namespace MyNamespace at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature.cs:line 0 - at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 34Then the scenario will 'pass_1' + at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 34When I have backslashes in the value, for example a 'c:\Temp\' +-> done: ScenarioOutlineSteps.WhenIHaveBackslashesInTheValueForExampleAFilePath("c:\Temp\") (0,0s) +Then the scenario will 'pass_1' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) Then the scenario will 'pass_2' -> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) -Then the scenario will 'inconclusive_1' +Then the scenario will 'inconclusive_1' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) @@ -350,7 +435,7 @@ namespace MyNamespace TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature.cs:line 0 - at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 45Then the scenario will 'fail_1' + at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 45Then the scenario will 'fail_1' -> error: true should be @@ -390,14 +475,16 @@ namespace MyNamespace at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature.cs:line 0 - at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 45Then passing step --> done: MinimalSteps.ThenPassingStep() (0,0s) -Then inconclusive step --> pending: MinimalSteps.ThenInconclusiveStep() + at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 45Then the scenario will 'pass_1' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) +Then the scenario will 'pass_2' +-> done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) +Then the scenario will 'inconclusive_1' +-> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. - MinimalSteps.ThenInconclusiveStep() at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) - at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature.cs:line 0 - at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.FailingFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature:line 7Then failing step + ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) + at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature.cs:line 0 + at Pickles.TestHarness.xunit.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\ScenarioOutlines.feature:line 21Then failing step -> error: true should be @@ -417,13 +504,20 @@ namespace MyNamespace at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature.cs:line 0 - at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature:line 10Then inconclusive step + at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature:line 10Then passing step +-> done: MinimalSteps.ThenPassingStep() (0,0s) +Then inconclusive step +-> pending: MinimalSteps.ThenInconclusiveStep() +TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. + MinimalSteps.ThenInconclusiveStep() at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) + at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature.cs:line 0 + at Pickles.TestHarness.xunit.MinimalFeatures.FailingFeature.FailingFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Failing.feature:line 7Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() TechTalk.SpecFlow.SpecFlowException : Test pending: One or more step definitions are not implemented yet. MinimalSteps.ThenInconclusiveStep() at TechTalk.SpecFlow.UnitTestProvider.XUnitRuntimeProvider.TestPending(String message) at Pickles.TestHarness.xunit.MinimalFeatures.InconclusiveFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Inconclusive.feature.cs:line 0 at Pickles.TestHarness.xunit.MinimalFeatures.InconclusiveFeature.InconclusiveFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\Minimal Features\Inconclusive.feature:line 7Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) -Then passing step +Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/results-example-xunit1-missingTraits.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit1-missingTraits.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/results-example-xunit1-missingTraits.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit1-missingTraits.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs similarity index 85% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index 5d676f77b..5baf10e2b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -21,17 +21,15 @@ using System; using System.Text.RegularExpressions; -using Autofac; - using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 { [TestFixture] public class WhenDeterminingTheSignatureOfAnXUnit2ExampleRow : BaseFixture @@ -42,7 +40,7 @@ public void ThenCanSuccessfullyMatch() var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers" }; var exampleRow = new[] { "40", "50", "90" }; - var signatureBuilder = Container.Resolve(); + var signatureBuilder = new XUnitExampleSignatureBuilder(); Regex signature = signatureBuilder.Build(scenarioOutline, exampleRow); var isMatch = signature.IsMatch("Pickles.TestHarness.xUnit.AdditionFeature.AddingSeveralNumbers(firstNumber: \"40\", secondNumber: \"50\", result: \"90\", exampleTags: System.String[])".ToLowerInvariant()); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..c554970d4 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,62 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 +{ + [TestFixture] + public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingXUnitResultsFileWithIndividualResults() + : base("XUnit.XUnit2." + "results-example-xunit2.xml", true) + { + } + + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); + } + + [Test] + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs new file mode 100644 index 000000000..dde407b59 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -0,0 +1,109 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +using NUnit.Framework; + +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 +{ + [TestFixture] + public class WhenParsingxUnit2ResultsFile : StandardTestSuite + { + public WhenParsingxUnit2ResultsFile() + : base("XUnit.XUnit2." + "results-example-xunit2.xml") + { + } + + [Test] + public new void ThenCanReadFeatureResultSuccessfully() + { + base.ThenCanReadFeatureResultSuccessfully(); + } + + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } + + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadFailedScenarioResultSuccessfully() + { + base.ThenCanReadFailedScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } + + [Test] + public new void ThenCanReadNotFoundScenarioCorrectly() + { + base.ThenCanReadNotFoundScenarioCorrectly(); + } + + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); + } + + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs similarity index 89% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs index ac77e054d..1e7b411e1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs @@ -25,15 +25,15 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 { [TestFixture] public class WhenParsingxUnit2ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingxUnit2ResultsFileWithMissingTraits() - : base("XUnit2." + "results-example-xunit2-missingTraits.xml") + : base("XUnit.XUnit2." + "results-example-xunit2-missingTraits.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/results-example-xunit2-missingTraits.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2-missingTraits.xml similarity index 100% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/results-example-xunit2-missingTraits.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2-missingTraits.xml diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/results-example-xunit2.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml similarity index 78% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/results-example-xunit2.xml rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml index f280db022..46d10e16f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/results-example-xunit2.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml @@ -1,9 +1,9 @@  - + - - + + @@ -15,7 +15,7 @@ at Pickles.TestHarness.xunit2.NotAutomatedAtAllFeature.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\NotAutomatedAtAll.feature:line 14]]> - + @@ -27,7 +27,7 @@ at Pickles.TestHarness.xunit2.NotAutomatedAtAllFeature.NotAutomatedScenario3() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\NotAutomatedAtAll.feature:line 19]]> - + @@ -40,40 +40,114 @@ - - + + - - + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + at Pickles.TestHarness.xunit2.MinimalFeatures.FailingFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Minimal Features\Failing.feature.cs:line 0 + at Pickles.TestHarness.xunit2.MinimalFeatures.FailingFeature.FailingFeatureInconclusiveScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Minimal Features\Failing.feature:line 7]]> - - + + - + - + @@ -85,7 +159,7 @@ at Pickles.TestHarness.xunit2.AdditionFeature.NotAutomatedAddingTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 46]]> - + @@ -98,7 +172,7 @@ - + @@ -120,38 +194,66 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -169,19 +271,19 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioFails(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 34]]> - + - + - + @@ -193,19 +295,19 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.ThisIsAScenarioOutlineWhereOneScenarioIsInconclusive(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 21]]> - + - + - + @@ -217,7 +319,7 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 45]]> - + @@ -229,7 +331,7 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 45]]> - + @@ -247,7 +349,7 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 45]]> - + @@ -265,61 +367,12 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 45]]> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs deleted file mode 100644 index 771af9ff1..000000000 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ /dev/null @@ -1,253 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; - -using NFluent; - -using NUnit.Framework; - -using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; - -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 -{ - [TestFixture] - public class WhenParsingxUnitResultsFile : WhenParsingTestResultFiles - { - public WhenParsingxUnitResultsFile() - : base("XUnit1." + "results-example-xunit.xml") - { - } - - [Test] - public void ThenCanReadFeatureResultSuccessfully() - { - // Write out the embedded test results file - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var passedScenario = new Scenario { Name = "Add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = feature }; - var result = results.GetScenarioResult(ignoredScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadNotFoundScenarioCorrectly() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var notFoundScenario = new Scenario - { - Name = "Not in the file at all!", - Feature = feature - }; - - var result = results.GetScenarioResult(notFoundScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(null); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - - Check.ThatCode(() => results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" })).Throws(); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where all scenarios pass", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "pass_3" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario is inconclusive", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario fails", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "And we can go totally bonkers with multiple example sections.", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - - TestResult exampleResult4 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_2" }); - Check.That(exampleResult4).IsEqualTo(TestResult.Failed); - - TestResult exampleResult5 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult5).IsEqualTo(TestResult.Failed); - - TestResult exampleResult6 = results.GetExampleResult(scenarioOutline, new[] { "fail_2" }); - Check.That(exampleResult6).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadResultsWithBackslashes() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "Deal correctly with backslashes in the examples", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { @"c:\Temp\" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs deleted file mode 100644 index f9df596b5..000000000 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; - -using NFluent; - -using NUnit.Framework; - -using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; - -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 -{ - [TestFixture] - public class WhenParsingxUnit2ResultsFile : WhenParsingTestResultFiles - { - public WhenParsingxUnit2ResultsFile() - : base("XUnit2." + "results-example-xunit2.xml") - { - } - - [Test] - public void ThenCanReadFeatureResultSuccessfully() - { - // Write out the embedded test results file - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - TestResult result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - TestResult result = results.GetScenarioOutlineResult(scenarioOutline); - - Check.That(result).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - - var feature = new Feature { Name = "Addition" }; - - var passedScenario = new Scenario { Name = "Add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(passedScenario); - - Check.That(result).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var scenario = new Scenario { Name = "Fail to add two numbers", Feature = feature }; - TestResult result = results.GetScenarioResult(scenario); - - Check.That(result).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var ignoredScenario = new Scenario { Name = "Ignored adding two numbers", Feature = feature }; - var result = results.GetScenarioResult(ignoredScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadNotFoundScenarioCorrectly() - { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Addition" }; - var notFoundScenario = new Scenario - { - Name = "Not in the file at all!", - Feature = feature - }; - - var result = results.GetScenarioResult(notFoundScenario); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void ThenCanReadNotFoundFeatureCorrectly() - { - var results = ParseResultsFile(); - var notFoundFeature = new Feature { Name = "Not in the project at all!" }; - - var result = results.GetFeatureResult(notFoundFeature); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); - } - - [Test] - public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(null); - - var feature = new Feature { Name = "Addition" }; - - var scenarioOutline = new ScenarioOutline { Name = "Adding several numbers", Feature = feature }; - - Check.ThatCode(() => results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" })).Throws(); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where all scenarios pass", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "pass_3" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Passed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario is inconclusive", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario fails", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "And we can go totally bonkers with multiple example sections.", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Failed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - - TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" }); - Check.That(exampleResult2).IsEqualTo(TestResult.Passed); - - TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" }); - Check.That(exampleResult3).IsEqualTo(TestResult.Failed); - - TestResult exampleResult4 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_2" }); - Check.That(exampleResult4).IsEqualTo(TestResult.Failed); - - TestResult exampleResult5 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" }); - Check.That(exampleResult5).IsEqualTo(TestResult.Failed); - - TestResult exampleResult6 = results.GetExampleResult(scenarioOutline, new[] { "fail_2" }); - Check.That(exampleResult6).IsEqualTo(TestResult.Failed); - } - - [Test] - public void ThenCanReadResultsWithBackslashes() - { - var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); - - var feature = new Feature { Name = "Scenario Outlines" }; - - var scenarioOutline = new ScenarioOutline { Name = "Deal correctly with backslashes in the examples", Feature = feature }; - - TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline); - Check.That(exampleResultOutline).IsEqualTo(TestResult.Passed); - - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { @"c:\Temp\" }); - Check.That(exampleResult1).IsEqualTo(TestResult.Passed); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 552f1199e..26757b098 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -19,27 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonResults : MultipleTestResults + public class CucumberJsonResults : MultipleTestRunsBase { - public CucumberJsonResults(IConfiguration configuration) - : base(false, configuration) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) - { - throw new NotSupportedException(); - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) + : base(configuration, singleResultLoader) { - return new CucumberJsonSingleResults(fileInfo); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs new file mode 100644 index 000000000..929fafea9 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs @@ -0,0 +1,51 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Abstractions; + +using Newtonsoft.Json; + +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson +{ + public class CucumberJsonSingleResultLoader : ISingleResultLoader + { + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new CucumberJsonSingleResults(this.ReadResultsFile(fileInfo)); + } + + private List ReadResultsFile(FileInfoBase testResultsFile) + { + List result; + using (var stream = testResultsFile.OpenRead()) + { + using (var reader = new StreamReader(stream)) + { + result = JsonConvert.DeserializeObject>(reader.ReadToEnd()); + } + } + + return result; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 33b73524e..1eff36182 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -20,107 +20,181 @@ using System; using System.Collections.Generic; -using System.IO; -using System.IO.Abstractions; using System.Linq; -using Newtonsoft.Json; - using PicklesDoc.Pickles.ObjectModel; -using Feature = PicklesDoc.Pickles.Parser.JsonResult.Feature; - namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonSingleResults : ITestResults + public class CucumberJsonSingleResults : SingleTestRunBase { private readonly List resultsDocument; - public CucumberJsonSingleResults(FileInfoBase configuration) + public CucumberJsonSingleResults(IEnumerable cucumberFeatures) { - this.resultsDocument = this.ReadResultsFile(configuration); + this.resultsDocument = cucumberFeatures.ToList(); } - public bool SupportsExampleResults + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - get { return false; } + var cucumberScenarios = this.GetCucumberScenarios(scenario); + + var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs.ScenarioBase, exampleValues)) + .Select(cs => ToTestResult(cs.ScenarioBase, cs.Background)); + + return query.FirstOrDefault(); } - public TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + private bool ScenarioHasStepsForAllExampleValues(Element cucumberScenario, string[] exampleValues) { - throw new NotSupportedException(); + return exampleValues.All(exampleValue => this.ScenarioHasAStepWithThisExampleValue(cucumberScenario, exampleValue)); } - public TestResult GetFeatureResult(ObjectModel.Feature feature) + private bool ScenarioHasAStepWithThisExampleValue(Element cucumberScenario, string exampleValue) { - var cucumberFeature = this.GetFeatureElement(feature); - return this.GetResultFromFeature(cucumberFeature); + return cucumberScenario.steps.Any(step => step.name.Contains(exampleValue)); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetFeatureResult(ObjectModel.Feature feature) { - // Not applicable - return new TestResult(); + var cucumberFeature = this.GetCucumberFeature(feature); + + return this.GetResultFromFeature(cucumberFeature.Feature, cucumberFeature.Background); } - public TestResult GetScenarioResult(Scenario scenario) + private FeatureAndBackground GetCucumberFeature(ObjectModel.Feature feature) { - Parser.JsonResult.Element cucumberScenario = null; - var cucumberFeature = this.GetFeatureElement(scenario.Feature); - if (cucumberFeature != null) + var cucumberFeature = this.resultsDocument.FirstOrDefault(f => f.name == feature.Name); + var background = cucumberFeature?.elements.FirstOrDefault(e => e.type == "background"); + return new FeatureAndBackground(cucumberFeature, background); + } + + private TestResult GetResultFromFeature(Feature cucumberFeature, Element background) + { + if (cucumberFeature?.elements == null) { - cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name); + return TestResult.Inconclusive; } - return this.GetResultFromScenario(cucumberScenario); + return ToTestResult(cucumberFeature, background); } - private List ReadResultsFile(FileInfoBase testResultsFile) + private TestResult ToTestResult(Feature feature, Element background) { - List result; - using (var stream = testResultsFile.OpenRead()) + return feature.elements.Select(e => ToTestResult(e, background)).Merge(); + } + + private TestResult ToTestResult(Element scenario, Element background) + { + var steps = (background?.steps ?? new List()).Concat(scenario.steps); + + return steps.Where(s => s.result != null).Select(ToTestResult).Merge(); + } + + private TestResult ToTestResult(Step step) + { + return ToTestResult(step.result.status); + } + + private TestResult ToTestResult(string cucumberResult) + { + switch (cucumberResult) { - using (var reader = new StreamReader(stream)) - { - result = JsonConvert.DeserializeObject>(reader.ReadToEnd()); - } + default: + case "skipped": + case "undefined": + case "pending": + { + return TestResult.Inconclusive; + } + + case "ambiguous": + case "failed": + { + return TestResult.Failed; + } + + case "passed": + { + return TestResult.Passed; + } } + } - return result; + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + { + var cucumberScenarios = this.GetCucumberScenarios(scenarioOutline); + + return cucumberScenarios.Select(cs => ToTestResult(cs.ScenarioBase, cs.Background)).Merge(); + } + + + public override TestResult GetScenarioResult(Scenario scenario) + { + var cucumberScenario = this.GetCucumberScenario(scenario); + + return this.GetResultFromScenario(cucumberScenario.ScenarioBase, cucumberScenario.Background); + } + + private ScenarioBaseAndBackground GetCucumberScenario(Scenario scenario) + { + Element cucumberScenario = null; + var cucumberFeature = this.GetCucumberFeature(scenario.Feature); + if (cucumberFeature?.Feature != null) + { + cucumberScenario = cucumberFeature.Feature.elements.FirstOrDefault(x => x.name == scenario.Name); + } + + return new ScenarioBaseAndBackground(cucumberScenario, cucumberFeature?.Background); } - private Feature GetFeatureElement(ObjectModel.Feature feature) + private IEnumerable GetCucumberScenarios(ScenarioOutline scenarioOutline) { - return this.resultsDocument.FirstOrDefault(x => x.name == feature.Name); + IEnumerable cucumberScenarios = null; + var cucumberFeature = this.GetCucumberFeature(scenarioOutline.Feature); + if (cucumberFeature?.Feature != null) + { + cucumberScenarios = cucumberFeature.Feature.elements.Where(x => x.name == scenarioOutline.Name); + } + + return (cucumberScenarios ?? new Element[0]).Select(cs => new ScenarioBaseAndBackground(cs, cucumberFeature?.Background)); } - private TestResult GetResultFromScenario(Parser.JsonResult.Element cucumberScenario) + private TestResult GetResultFromScenario(Element cucumberScenario, Element background) { if (cucumberScenario == null) { return TestResult.Inconclusive; } - bool wasSuccessful = CheckScenarioStatus(cucumberScenario); - return wasSuccessful ? TestResult.Passed : TestResult.Failed; + return ToTestResult(cucumberScenario, background); } - private static bool CheckScenarioStatus(Parser.JsonResult.Element cucumberScenario) + private class FeatureAndBackground { - return cucumberScenario.steps.All(x => x.result.status == "passed"); + public FeatureAndBackground(Feature feature, Element background) + { + this.Feature = feature; + this.Background = background; + } + + public Feature Feature { get; } + + public Element Background { get; } } - private TestResult GetResultFromFeature(Feature cucumberFeature) + private class ScenarioBaseAndBackground { - if (cucumberFeature == null || cucumberFeature.elements == null) + public ScenarioBaseAndBackground(Element scenarioBase, Element background) { - return TestResult.Inconclusive; + this.ScenarioBase = scenarioBase; + this.Background = background; } - bool wasSuccessful = cucumberFeature.elements.All(CheckScenarioStatus); + public Element ScenarioBase { get; } - return wasSuccessful ? TestResult.Passed : TestResult.Failed; + public Element Background { get; } } } } diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Element.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Element.cs index df85d2d71..c76c7ff34 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Element.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Element.cs @@ -22,7 +22,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Feature.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Feature.cs index f3ed6673b..bdeaf35eb 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Feature.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Feature.cs @@ -22,7 +22,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Match.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Match.cs index 3200be620..23e426949 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Match.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Match.cs @@ -21,7 +21,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Result.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Result.cs index c9594dd90..2da9668b7 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Result.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Result.cs @@ -21,7 +21,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Step.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Step.cs index c231658a0..4b2667f29 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Step.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Step.cs @@ -21,7 +21,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Tag.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Tag.cs index 0a04d661a..46ae67910 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/Tag.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/Tag.cs @@ -21,7 +21,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace PicklesDoc.Pickles.Parser.JsonResult +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "The lowercase name is part of an external contract.")] [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "The lowercase name is part of an external contract.")] diff --git a/src/Pickles/Pickles.TestFrameworks/IScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/IScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..d3a58877b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/IScenarioOutlineExampleMatcher.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks +{ + public interface IScenarioOutlineExampleMatcher + { + bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement); + } + + class ScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + return false; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs new file mode 100644 index 000000000..106051444 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs @@ -0,0 +1,11 @@ +using System.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks +{ + public interface ISingleResultLoader + { + SingleTestRunBase Load(FileInfoBase fileInfo); + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs new file mode 100644 index 000000000..bb0ccdb6a --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs @@ -0,0 +1,162 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.MsTest +{ + internal static class MsTestElementExtensions + { + private const string Failed = "failed"; + + private static readonly XNamespace Ns = @"http://microsoft.com/schemas/VisualStudio/TeamTest/2010"; + + internal static bool HasPropertyFeatureTitle(this XElement parentElement, string featureTitle) + { + //// + //// + //// FeatureTitle + //// featureName + //// + //// + + var propertiesElement = parentElement.Element(Ns + "Properties"); + + if (propertiesElement == null) + { + return false; + } + + var query = from property in propertiesElement.Elements(Ns + "Property") + let key = property.Element(Ns + "Key") + let value = property.Element(Ns + "Value") + where key.Value == "FeatureTitle" && value.Value == featureTitle + select property; + return query.Any(); + } + + internal static string Name(this XElement scenario) + { + //// + //// the name of the scenario + //// + + return scenario.Element(Ns + "Description")?.Value ?? string.Empty; + } + + internal static IEnumerable AllExecutionResults(this XDocument document) + { + //// TestRun/Results/UnitTestResult + + if (document?.Root == null) + { + return new XElement[0]; + } + + return document.Root.Descendants(Ns + "UnitTestResult"); + } + + /// + /// Retrieves all potential scenarios in the test result file. "Potential" because + /// there may be some regular unit tests included as well. They cause no problems, however. + /// + /// The test result file. + /// + /// A sequence of instances that are called "UnitTest". + /// + internal static IEnumerable AllScenarios(this XDocument document) + { + //// TestRun/TestDefinitions/UnitTests that have a non-empty Description (which is the title of a Scenario). + + if (document?.Root == null) + { + return new XElement[0]; + } + + return document.Root.Descendants(Ns + "UnitTest").Where(s => s.Element(Ns + "Description") != null); + } + + internal static Guid ExecutionIdElement(this XElement scenario) + { + //// + //// + //// + + var xElement = scenario.Element(Ns + "Execution"); + + return xElement != null ? new Guid(xElement.Attribute("id").Value) : Guid.Empty; + } + + internal static IEnumerable ExecutionIdElements(this IEnumerable scenarios) + { + return scenarios.Select(ExecutionIdElement); + } + + internal static TestResult Outcome(this XElement scenarioResult) + { + //// + + var outcomeAttribute = scenarioResult.Attribute("outcome")?.Value ?? Failed; + + switch (outcomeAttribute.ToLowerInvariant()) + { + case "passed": + return TestResult.Passed; + case Failed: + return TestResult.Failed; + default: + return TestResult.Inconclusive; + } + } + + internal static Guid ExecutionIdAttribute(this XElement unitTestResult) + { + //// + + var executionIdAttribute = unitTestResult.Attribute("executionId"); + return executionIdAttribute != null ? new Guid(executionIdAttribute.Value) : Guid.Empty; + } + + internal static string NameAttribute(this XElement element) + { + return element.Attribute("name")?.Value ?? String.Empty; + } + + internal static List DetermineValuesInScenario(this XElement element) + { + List valuesInScenario = new List(); + + foreach (var property in element.Descendants(Ns + "Property")) + { + if ((property.Descendants(Ns + "Key").FirstOrDefault()?.Value ?? string.Empty).StartsWith("Parameter:")) + { + valuesInScenario.Add(property.Descendants(Ns + "Value").FirstOrDefault()?.Value ?? string.Empty); + } + } + + return valuesInScenario; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs similarity index 62% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs index 722e2900d..52939a02e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -19,28 +19,19 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.Text; using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class XUnit2ExampleSignatureBuilder + public class MsTestExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { - var stringBuilder = new StringBuilder(); - stringBuilder.Append(scenarioOutline.Name.ToLowerInvariant().Replace(" ", string.Empty) + "\\("); - - foreach (string value in row) - { - stringBuilder.AppendFormat("(.*): \"{0}\", ", value.ToLowerInvariant().Replace(@"\", string.Empty).Replace(@"$", @"\$")); - } - - stringBuilder.Remove(stringBuilder.Length - 2, 2); - - return new Regex(stringBuilder.ToString()); + // We don't actually need this regex-based thing for MsTest results. + // It sucks that we have to provide one. + return new Regex(string.Empty); } } -} +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 3fa7482de..fbaf644c0 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -19,29 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestResults : MultipleTestResults + public class MsTestResults : MultipleTestRunsBase { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); - - public MsTestResults(IConfiguration configuration) - : base(false, configuration) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) - { - throw new NotSupportedException(); - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { - return new MsTestSingleResults(DocumentLoader.Load(fileInfo)); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..c4df5bf3c --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestScenarioOutlineExampleMatcher.cs @@ -0,0 +1,40 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Linq; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.MsTest +{ + public class MsTestScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var element = (XElement)scenarioElement; + + var valuesInScenario = element.DetermineValuesInScenario(); + + var isMatch = exampleValues.OrderBy(e => e).SequenceEqual(valuesInScenario.OrderBy(v => v)); + return isMatch; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs new file mode 100644 index 000000000..50ebe5599 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +namespace PicklesDoc.Pickles.TestFrameworks.MsTest +{ + public class MsTestSingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new MsTestSingleResults(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 488c81c35..6dd57865c 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -27,11 +27,20 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestSingleResults : ITestResults + /// + /// The class responsible for parsing a single MS Test result file. + /// + /// + /// The MS Test result format is a bit weird in that it stores the tests and their results in + /// separate lists. So in order to know the result of a scenario, + /// we first have to identify the test definition that belongs to the scenario. + /// Then with the id of the scenario we look up an execution id, + /// and with the execution id we can look up the result. + /// + public class MsTestSingleResults : SingleTestRunBase { private const string Failed = "failed"; - private static readonly XNamespace Ns = @"http://microsoft.com/schemas/VisualStudio/TeamTest/2010"; private readonly XDocument resultsDocument; public MsTestSingleResults(XDocument resultsDocument) @@ -39,142 +48,120 @@ public MsTestSingleResults(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override TestResult GetFeatureResult(Feature feature) { - get { return false; } - } + var scenarios = this.GetScenariosForFeature(feature); - private Guid GetScenarioExecutionId(Scenario queriedScenario) - { - var idString = - (from scenario in this.AllScenariosInResultFile() - let properties = PropertiesOf(scenario) - where properties != null - where FeatureNamePropertyExistsWith(queriedScenario.Feature.Name, among: properties) - where NameOf(scenario) == queriedScenario.Name - select ScenarioExecutionIdStringOf(scenario)).FirstOrDefault(); - - return !string.IsNullOrEmpty(idString) ? new Guid(idString) : Guid.Empty; - } + var featureExecutionIds = scenarios.ExecutionIdElements(); - private TestResult GetExecutionResult(Guid scenarioExecutionId) - { - var resultText = - (from scenarioResult in this.AllScenarioExecutionResultsInResultFile() - let executionId = ResultExecutionIdOf(scenarioResult) - where scenarioExecutionId == executionId - let outcome = ResultOutcomeOf(scenarioResult) - select outcome).FirstOrDefault() ?? string.Empty; - - switch (resultText.ToLowerInvariant()) - { - case "passed": - return TestResult.Passed; - case Failed: - return TestResult.Failed; - default: - return TestResult.Inconclusive; - } - } + TestResult result = this.GetExecutionResult(featureExecutionIds); - private static string ResultOutcomeOf(XElement scenarioResult) - { - var outcomeAttribute = scenarioResult.Attribute("outcome"); - return outcomeAttribute != null ? outcomeAttribute.Value : Failed; + return result; } - private static Guid ResultExecutionIdOf(XElement unitTestResult) + /// + /// Retrieves all UnitTest XElements that belong to the specified feature. + /// + /// The feature for which to retrieve the unit tests. + /// A sequence of instances that are called "UnitTest" + /// that belong to the specified feature. + private IEnumerable GetScenariosForFeature(Feature feature) { - var executionIdAttribute = unitTestResult.Attribute("executionId"); - return executionIdAttribute != null ? new Guid(executionIdAttribute.Value) : Guid.Empty; + var scenarios = from scenario in this.resultsDocument.AllScenarios() + where scenario.HasPropertyFeatureTitle(feature.Name) + select scenario; + + return scenarios; } - public TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + private TestResult GetExecutionResult(IEnumerable featureExecutionIds) { - throw new NotSupportedException(); + TestResult result = featureExecutionIds.Select(this.GetExecutionResult).Merge(); + return result; } - public TestResult GetFeatureResult(Feature feature) + private TestResult GetExecutionResult(Guid scenarioExecutionId) { - var featureExecutionIds = - from scenario in this.AllScenariosInResultFile() - let properties = PropertiesOf(scenario) - where properties != null - where FeatureNamePropertyExistsWith(feature.Name, among: properties) - select ScenarioExecutionIdOf(scenario); + var query = + this.resultsDocument.AllExecutionResults() + .Where(er => er.ExecutionIdAttribute() == scenarioExecutionId) + .Select(sr => sr.Outcome()); - TestResult result = featureExecutionIds.Select(this.GetExecutionResult).Merge(); + var result = query.FirstOrDefault(); return result; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - var queriedFeatureName = scenarioOutline.Feature.Name; - var queriedScenarioOutlineName = scenarioOutline.Name; + var scenarios = this.GetScenariosForScenarioOutline(scenarioOutline); - var allScenariosForAFeature = - from scenario in this.AllScenariosInResultFile() - let scenarioProperties = PropertiesOf(scenario) - where scenarioProperties != null - where FeatureNamePropertyExistsWith(queriedFeatureName, among: scenarioProperties) - select scenario; + var executionIds = scenarios.Select(scenario => scenario.ExecutionIdElement()); - var scenarioOutlineExecutionIds = from scenario in allScenariosForAFeature - where NameOf(scenario).StartsWith(queriedScenarioOutlineName) - select ScenarioExecutionIdOf(scenario); - - TestResult result = scenarioOutlineExecutionIds.Select(this.GetExecutionResult).Merge(); + TestResult result = this.GetExecutionResult(executionIds); return result; } - public TestResult GetScenarioResult(Scenario scenario) + private IEnumerable GetScenariosForScenarioOutline(ScenarioOutline scenarioOutline) { - Guid scenarioExecutionId = this.GetScenarioExecutionId(scenario); - return this.GetExecutionResult(scenarioExecutionId); - } + var scenarios = + this.GetScenariosForFeature(scenarioOutline.Feature) + .Where(scenario => scenario.Name().StartsWith(scenarioOutline.Name)); - private static Guid ScenarioExecutionIdOf(XElement scenario) - { - return new Guid(ScenarioExecutionIdStringOf(scenario)); + return scenarios; } - private static string ScenarioExecutionIdStringOf(XElement scenario) + public override TestResult GetScenarioResult(Scenario scenario) { - return scenario.Element(Ns + "Execution").Attribute("id").Value; - } + var scenarios = this.GetScenariosForScenario(scenario); - private static string NameOf(XElement scenario) - { - return scenario.Element(Ns + "Description").Value; - } + Guid executionId = scenarios.Select(s => s.ExecutionIdElement()).FirstOrDefault(); - private static XElement PropertiesOf(XElement scenariosReportes) - { - return scenariosReportes.Element(Ns + "Properties"); + TestResult testResult = this.GetExecutionResult(executionId); + + return testResult; } - private static bool FeatureNamePropertyExistsWith(string featureName, XElement among) + private IEnumerable GetScenariosForScenario(Scenario scenario) { - var properties = among; - return (from property in properties.Elements(Ns + "Property") - let key = property.Element(Ns + "Key") - let value = property.Element(Ns + "Value") - where key.Value == "FeatureTitle" && value.Value == featureName - select property).Any(); + var scenarios = + this.GetScenariosForFeature(scenario.Feature) + .Where(s => s.Name() == scenario.Name); + + return scenarios; } - private IEnumerable AllScenariosInResultFile() + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - // Feature scenarios unit-tests should have Description. It is a scenario name - return - this.resultsDocument.Root.Descendants(Ns + "UnitTest").Where(s => s.Element(Ns + "Description") != null); + var scenarioElements = this.GetScenariosForScenarioOutline(scenario); + + var theScenario = this.GetScenarioThatMatchesTheExampleValues(scenario, exampleValues, scenarioElements); + + Guid executionId = theScenario.ExecutionIdElement(); + + TestResult testResult = this.GetExecutionResult(executionId); + + return testResult; } - private IEnumerable AllScenarioExecutionResultsInResultFile() + private XElement GetScenarioThatMatchesTheExampleValues(ScenarioOutline scenarioOutline, string[] exampleValues, IEnumerable scenarioElements) { - return this.resultsDocument.Root.Descendants(Ns + "UnitTestResult"); + // filter for example values + XElement theScenario = null; + + foreach (var element in scenarioElements) + { + var isMatch = this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, element); + + if (isMatch) + { + theScenario = element; + break; + } + } + + return theScenario; } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs similarity index 59% rename from src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs rename to src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 61f501769..3b6130d05 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -27,64 +27,45 @@ namespace PicklesDoc.Pickles.TestFrameworks { - public abstract class MultipleTestResults : ITestResults + public abstract class MultipleTestRunsBase : ITestResults { - protected MultipleTestResults(bool supportsExampleResults, IEnumerable testResults) + private readonly ISingleResultLoader singleResultLoader; + + protected MultipleTestRunsBase(IEnumerable testResults) { - this.SupportsExampleResults = supportsExampleResults; this.TestResults = testResults; } - protected MultipleTestResults(bool supportsExampleResults, IConfiguration configuration) + protected MultipleTestRunsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher = null) { - this.SupportsExampleResults = supportsExampleResults; + this.singleResultLoader = singleResultLoader; this.TestResults = this.GetSingleTestResults(configuration); - } - - public bool SupportsExampleResults { get; } - protected IEnumerable TestResults { get; } - - public abstract TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues); + this.SetExampleSignatureBuilder(scenarioOutlineExampleMatcher ?? new ScenarioOutlineExampleMatcher()); + } - private IEnumerable GetSingleTestResults(IConfiguration configuration) + private void SetExampleSignatureBuilder(IScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) { - ITestResults[] results; - - if (configuration.HasTestResults) - { - results = configuration.TestResultsFiles.Select(this.ConstructSingleTestResult).ToArray(); - } - else + foreach (var testResult in this.TestResults) { - results = new ITestResults[0]; + testResult.ScenarioOutlineExampleMatcher = scenarioOutlineExampleMatcher; } - - return results; } - protected abstract ITestResults ConstructSingleTestResult(FileInfoBase fileInfo); + protected IEnumerable TestResults { get; } - public TestResult GetFeatureResult(Feature feature) + public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) { - var results = this.TestResults.Select(tr => tr.GetFeatureResult(feature)).ToArray(); + var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); return EvaluateTestResults(results); } - protected static TestResult EvaluateTestResults(TestResult[] results) + public TestResult GetFeatureResult(Feature feature) { - if (results.Any(r => r == TestResult.Failed)) - { - return TestResult.Failed; - } - - if (results.Any(r => r == TestResult.Passed)) - { - return TestResult.Passed; - } + var results = this.TestResults.Select(tr => tr.GetFeatureResult(feature)).ToArray(); - return TestResult.Inconclusive; + return EvaluateTestResults(results); } public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) @@ -100,5 +81,31 @@ public TestResult GetScenarioResult(Scenario scenario) return EvaluateTestResults(results); } + + protected static TestResult EvaluateTestResults(TestResult[] results) + { + return results.Merge(true); + } + + protected SingleTestRunBase ConstructSingleTestResult(FileInfoBase fileInfo) + { + return this.singleResultLoader.Load(fileInfo); + } + + private IEnumerable GetSingleTestResults(IConfiguration configuration) + { + SingleTestRunBase[] results; + + if (configuration.HasTestResults) + { + results = configuration.TestResultsFiles.Select(this.ConstructSingleTestResult).ToArray(); + } + else + { + results = new SingleTestRunBase[0]; + } + + return results; + } } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs new file mode 100644 index 000000000..a70b897e1 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -0,0 +1,32 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 +{ + public class NUnit2Results : MultipleTestRunsBase + { + public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) + { + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs new file mode 100644 index 000000000..4eae740b3 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 +{ + public class NUnit2SingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new NUnit2SingleResults(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs new file mode 100644 index 000000000..979227bf8 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs @@ -0,0 +1,113 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 +{ + public class NUnit2SingleResults : NUnitSingleResultsBase + { + public NUnit2SingleResults(XDocument resultsDocument) + : base( + resultsDocument, + new[] + { + new TestResultAndName(TestResult.Inconclusive, "Ignored"), + new TestResultAndName(TestResult.Inconclusive, "Inconclusive"), + new TestResultAndName(TestResult.Failed, "Failure"), + new TestResultAndName(TestResult.Passed, "Success"), + }) + { + } + + protected override XElement GetScenarioElement(Scenario scenario) + { + XElement featureElement = this.GetFeatureElement(scenario.Feature); + XElement scenarioElement = null; + if (featureElement != null) + { + scenarioElement = + featureElement.Descendants("test-case") + .Where(x => x.Attribute("description") != null) + .FirstOrDefault(x => x.Attribute("description").Value == scenario.Name); + } + + return scenarioElement; + } + + protected override XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) + { + XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); + XElement scenarioOutlineElement = null; + if (featureElement != null) + { + scenarioOutlineElement = + this.GetFeatureElement(scenarioOutline.Feature) + .Descendants("test-suite") + .Where(x => x.Attribute("description") != null) + .FirstOrDefault(x => x.Attribute("description").Value == scenarioOutline.Name); + } + + return scenarioOutlineElement; + } + + protected override XElement GetFeatureElement(Feature feature) + { + return this.resultsDocument + .Descendants("test-suite") + .Where(x => x.Attribute("description") != null) + .FirstOrDefault(x => x.Attribute("description").Value == feature.Name); + } + + protected override XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values) + { + XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); + XElement examplesElement = null; + if (featureElement != null) + { + var parameterizedTestElement = + featureElement.Descendants("test-suite") + .FirstOrDefault(x => IsMatchingParameterizedTestElement(x, scenarioOutline)); + + if (parameterizedTestElement != null) + { + examplesElement = + parameterizedTestElement.Descendants("test-case") + .FirstOrDefault(x => this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, values, x)); + } + } + return examplesElement; + } + + private static bool IsMatchingParameterizedTestElement(XElement element, ScenarioOutline scenarioOutline) + { + var description = element.Attribute("description"); + + return description != null && + description.Value.Equals(scenarioOutline.Name, StringComparison.OrdinalIgnoreCase) && + element.Descendants("test-case").Any(); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs new file mode 100644 index 000000000..78f4996bb --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -0,0 +1,32 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 +{ + public class NUnit3Results : MultipleTestRunsBase + { + public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) + { + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs new file mode 100644 index 000000000..0ded1a74b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs @@ -0,0 +1,126 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 +{ + public class NUnit3SingleResult : NUnitSingleResultsBase + { + public NUnit3SingleResult(XDocument resultsDocument) + : base( + resultsDocument, + new[] + { + new TestResultAndName(TestResult.Inconclusive, "Skipped"), + new TestResultAndName(TestResult.Inconclusive, "Inconclusive"), + new TestResultAndName(TestResult.Failed, "Failed"), + new TestResultAndName(TestResult.Passed, "Passed"), + }) + { + } + + protected override XElement GetScenarioElement(Scenario scenario) + { + XElement featureElement = this.GetFeatureElement(scenario.Feature); + XElement scenarioElement = null; + if (featureElement != null) + { + scenarioElement = + featureElement.Descendants("test-case") + .FirstOrDefault( + ts => + ts.Elements("properties") + .Elements("property") + .Any( + p => + p.Attribute("name").Value == "Description" && p.Attribute("value").Value == scenario.Name)); + } + + return scenarioElement; + } + + protected override XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) + { + XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); + XElement scenarioOutlineElement = null; + if (featureElement != null) + { + scenarioOutlineElement = + this.GetFeatureElement(scenarioOutline.Feature) + .Descendants("test-suite") + .FirstOrDefault( + ts => + ts.Elements("properties") + .Elements("property") + .Any( + p => + p.Attribute("name").Value == "Description" + && p.Attribute("value").Value == scenarioOutline.Name)); + } + + return scenarioOutlineElement; + } + + protected override XElement GetFeatureElement(Feature feature) + { + return + this.resultsDocument + .Descendants("test-suite") + .FirstOrDefault( + ts => + ts.Elements("properties").Elements("property") + .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == feature.Name)); + } + + protected override XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values) + { + XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); + XElement examplesElement = null; + if (featureElement != null) + { + var parameterizedTestElement = + featureElement.Descendants("test-suite") + .FirstOrDefault( + ts => + ts.Elements("properties") + .Elements("property") + .Any( + p => + p.Attribute("name").Value == "Description" + && p.Attribute("value").Value == scenarioOutline.Name)); + + if (parameterizedTestElement != null) + { + examplesElement = + parameterizedTestElement.Descendants("test-case") + .FirstOrDefault(x => this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, values, x)); + } + } + + return examplesElement; + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs new file mode 100644 index 000000000..9f2fccd6c --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 +{ + public class NUnit3SingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new NUnit3SingleResult(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/results-example-nunit3.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/results-example-nunit3.cs similarity index 77% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/results-example-nunit3.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/results-example-nunit3.cs index d0836d49d..e72dd077e 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/results-example-nunit3.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/results-example-nunit3.cs @@ -8,56 +8,57 @@ // //------------------------------------------------------------------------------ -// +// // This source code was auto-generated by xsd, Version=4.6.1055.0. -// -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { - using System.Xml.Serialization; - - +// + +using System; +using System.Xml.Serialization; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] - [System.Xml.Serialization.XmlRootAttribute("test-run", Namespace="", IsNullable=false)] + [XmlType(AnonymousType=true)] + [XmlRoot("test-run", Namespace="", IsNullable=false)] public partial class testrun { - + private string commandlineField; - + private testrunTestsuite testsuiteField; - + private byte idField; - + private byte testcasecountField; - + private string resultField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + private string engineversionField; - + private string clrversionField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + /// - [System.Xml.Serialization.XmlElementAttribute("command-line")] + [XmlElement("command-line")] public string commandline { get { return this.commandlineField; @@ -66,9 +67,9 @@ public string commandline { this.commandlineField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuite testsuite { get { return this.testsuiteField; @@ -77,9 +78,9 @@ public testrunTestsuite testsuite { this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte id { get { return this.idField; @@ -88,9 +89,9 @@ public byte id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -99,9 +100,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -110,9 +111,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -121,9 +122,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -132,9 +133,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -143,9 +144,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -154,9 +155,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -165,9 +166,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -176,9 +177,9 @@ public byte asserts { this.assertsField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("engine-version")] + [XmlAttribute("engine-version")] public string engineversion { get { return this.engineversionField; @@ -187,9 +188,9 @@ public string engineversion { this.engineversionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("clr-version")] + [XmlAttribute("clr-version")] public string clrversion { get { return this.clrversionField; @@ -198,9 +199,9 @@ public string clrversion { this.clrversionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -209,9 +210,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -220,9 +221,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -232,59 +233,59 @@ public decimal duration { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuite { - + private testrunTestsuiteEnvironment environmentField; - + private testrunTestsuiteSetting[] settingsField; - + private testrunTestsuiteProperty[] propertiesField; - + private testrunTestsuiteFailure failureField; - + private testrunTestsuiteTestsuite testsuiteField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string siteField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + /// public testrunTestsuiteEnvironment environment { get { @@ -294,9 +295,9 @@ public testrunTestsuiteEnvironment environment { this.environmentField = value; } } - + /// - [System.Xml.Serialization.XmlArrayItemAttribute("setting", IsNullable=false)] + [XmlArrayItem("setting", IsNullable=false)] public testrunTestsuiteSetting[] settings { get { return this.settingsField; @@ -305,9 +306,9 @@ public testrunTestsuiteSetting[] settings { this.settingsField = value; } } - + /// - [System.Xml.Serialization.XmlArrayItemAttribute("property", IsNullable=false)] + [XmlArrayItem("property", IsNullable=false)] public testrunTestsuiteProperty[] properties { get { return this.propertiesField; @@ -316,7 +317,7 @@ public testrunTestsuiteProperty[] properties { this.propertiesField = value; } } - + /// public testrunTestsuiteFailure failure { get { @@ -326,9 +327,9 @@ public testrunTestsuiteFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuiteTestsuite testsuite { get { return this.testsuiteField; @@ -337,9 +338,9 @@ public testrunTestsuiteTestsuite testsuite { this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -348,9 +349,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -359,9 +360,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -370,9 +371,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -381,9 +382,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -392,9 +393,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -403,9 +404,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -414,9 +415,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -425,9 +426,9 @@ public string site { this.siteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -436,9 +437,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -447,9 +448,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -458,9 +459,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -469,9 +470,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -480,9 +481,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -491,9 +492,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -502,9 +503,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -513,9 +514,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -525,39 +526,39 @@ public byte asserts { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteEnvironment { - + private string frameworkversionField; - + private string clrversionField; - + private string osversionField; - + private string platformField; - + private string cwdField; - + private string machinenameField; - + private string userField; - + private string userdomainField; - + private string cultureField; - + private string uicultureField; - + private string osarchitectureField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute("framework-version")] + [XmlAttribute("framework-version")] public string frameworkversion { get { return this.frameworkversionField; @@ -566,9 +567,9 @@ public string frameworkversion { this.frameworkversionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("clr-version")] + [XmlAttribute("clr-version")] public string clrversion { get { return this.clrversionField; @@ -577,9 +578,9 @@ public string clrversion { this.clrversionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("os-version")] + [XmlAttribute("os-version")] public string osversion { get { return this.osversionField; @@ -588,9 +589,9 @@ public string osversion { this.osversionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string platform { get { return this.platformField; @@ -599,9 +600,9 @@ public string platform { this.platformField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string cwd { get { return this.cwdField; @@ -610,9 +611,9 @@ public string cwd { this.cwdField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("machine-name")] + [XmlAttribute("machine-name")] public string machinename { get { return this.machinenameField; @@ -621,9 +622,9 @@ public string machinename { this.machinenameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string user { get { return this.userField; @@ -632,9 +633,9 @@ public string user { this.userField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("user-domain")] + [XmlAttribute("user-domain")] public string userdomain { get { return this.userdomainField; @@ -643,9 +644,9 @@ public string userdomain { this.userdomainField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string culture { get { return this.cultureField; @@ -654,9 +655,9 @@ public string culture { this.cultureField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string uiculture { get { return this.uicultureField; @@ -665,9 +666,9 @@ public string uiculture { this.uicultureField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("os-architecture")] + [XmlAttribute("os-architecture")] public string osarchitecture { get { return this.osarchitectureField; @@ -677,21 +678,21 @@ public string osarchitecture { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteSetting { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -700,9 +701,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -712,21 +713,21 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteProperty { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -735,9 +736,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -747,17 +748,17 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -768,53 +769,53 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuite { - + private testrunTestsuiteTestsuiteFailure failureField; - + private testrunTestsuiteTestsuiteTestsuite testsuiteField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string siteField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + /// public testrunTestsuiteTestsuiteFailure failure { get { @@ -824,9 +825,9 @@ public testrunTestsuiteTestsuiteFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuiteTestsuiteTestsuite testsuite { get { return this.testsuiteField; @@ -835,9 +836,9 @@ public testrunTestsuiteTestsuiteTestsuite testsuite { this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -846,9 +847,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -857,9 +858,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -868,9 +869,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -879,9 +880,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -890,9 +891,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -901,9 +902,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -912,9 +913,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -923,9 +924,9 @@ public string site { this.siteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -934,9 +935,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -945,9 +946,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -956,9 +957,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -967,9 +968,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -978,9 +979,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -989,9 +990,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -1000,9 +1001,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -1011,9 +1012,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -1023,17 +1024,17 @@ public byte asserts { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -1044,53 +1045,53 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuite { - + private testrunTestsuiteTestsuiteTestsuiteFailure failureField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuite testsuiteField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string siteField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + /// public testrunTestsuiteTestsuiteTestsuiteFailure failure { get { @@ -1100,9 +1101,9 @@ public testrunTestsuiteTestsuiteTestsuiteFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuiteTestsuiteTestsuiteTestsuite testsuite { get { return this.testsuiteField; @@ -1111,9 +1112,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuite testsuite { this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -1122,9 +1123,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -1133,9 +1134,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -1144,9 +1145,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -1155,9 +1156,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -1166,9 +1167,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -1177,9 +1178,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -1188,9 +1189,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -1199,9 +1200,9 @@ public string site { this.siteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -1210,9 +1211,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -1221,9 +1222,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -1232,9 +1233,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -1243,9 +1244,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -1254,9 +1255,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -1265,9 +1266,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -1276,9 +1277,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -1287,9 +1288,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -1299,17 +1300,17 @@ public byte asserts { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -1320,53 +1321,53 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuite { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteFailure failureField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuiteField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string siteField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteFailure failure { get { @@ -1376,9 +1377,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuite { get { return this.testsuiteField; @@ -1387,9 +1388,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuite { this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -1398,9 +1399,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -1409,9 +1410,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -1420,9 +1421,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -1431,9 +1432,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -1442,9 +1443,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -1453,9 +1454,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -1464,9 +1465,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -1475,9 +1476,9 @@ public string site { this.siteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -1486,9 +1487,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -1497,9 +1498,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -1508,9 +1509,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -1519,9 +1520,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -1530,9 +1531,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -1541,9 +1542,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -1552,9 +1553,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -1563,9 +1564,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -1575,17 +1576,17 @@ public byte asserts { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -1596,59 +1597,59 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuite { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperties propertiesField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure failureField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuiteField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] testcaseField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string classnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string siteField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperties properties { get { @@ -1658,7 +1659,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperties properties this.propertiesField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure failure { get { @@ -1668,9 +1669,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-suite")] + [XmlElement("test-suite")] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuite { get { return this.testsuiteField; @@ -1679,9 +1680,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuite[] testsuite this.testsuiteField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-case")] + [XmlElement("test-case")] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] testcase { get { return this.testcaseField; @@ -1690,9 +1691,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] testcase { this.testcaseField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -1701,9 +1702,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -1712,9 +1713,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -1723,9 +1724,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -1734,9 +1735,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string classname { get { return this.classnameField; @@ -1745,9 +1746,9 @@ public string classname { this.classnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -1756,9 +1757,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -1767,9 +1768,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -1778,9 +1779,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -1789,9 +1790,9 @@ public string site { this.siteField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -1800,9 +1801,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -1811,9 +1812,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -1822,9 +1823,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -1833,9 +1834,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -1844,9 +1845,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -1855,9 +1856,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -1866,9 +1867,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -1877,9 +1878,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -1889,17 +1890,17 @@ public byte asserts { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperties { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuitePropertiesProperty propertyField; - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuitePropertiesProperty property { get { @@ -1910,21 +1911,21 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuitePropertiesProperty pr } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuitePropertiesProperty { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -1933,9 +1934,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -1945,17 +1946,17 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -1966,59 +1967,59 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuite { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperty[] propertiesField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure failureField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] testcaseField; - + private string typeField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string runstateField; - + private byte testcasecountField; - + private string resultField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte inconclusiveField; - + private byte skippedField; - + private byte assertsField; - + private string classnameField; - + private string siteField; - + /// - [System.Xml.Serialization.XmlArrayItemAttribute("property", IsNullable=false)] + [XmlArrayItem("property", IsNullable=false)] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperty[] properties { get { return this.propertiesField; @@ -2027,7 +2028,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperty[] p this.propertiesField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure failure { get { @@ -2037,9 +2038,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure fail this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("test-case")] + [XmlElement("test-case")] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] testcase { get { return this.testcaseField; @@ -2048,9 +2049,9 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase[] t this.testcaseField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -2059,9 +2060,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -2070,9 +2071,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2081,9 +2082,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -2092,9 +2093,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -2103,9 +2104,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte testcasecount { get { return this.testcasecountField; @@ -2114,9 +2115,9 @@ public byte testcasecount { this.testcasecountField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -2125,9 +2126,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -2136,9 +2137,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -2147,9 +2148,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -2158,9 +2159,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -2169,9 +2170,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -2180,9 +2181,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -2191,9 +2192,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte inconclusive { get { return this.inconclusiveField; @@ -2202,9 +2203,9 @@ public byte inconclusive { this.inconclusiveField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -2213,9 +2214,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -2224,9 +2225,9 @@ public byte asserts { this.assertsField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string classname { get { return this.classnameField; @@ -2235,9 +2236,9 @@ public string classname { this.classnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string site { get { return this.siteField; @@ -2247,21 +2248,21 @@ public string site { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteProperty { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2270,9 +2271,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -2282,17 +2283,17 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteFailure { - + private string messageField; - + /// public string message { get { @@ -2303,49 +2304,49 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperties propertiesField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason reasonField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure failureField; - + private string outputField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string methodnameField; - + private string classnameField; - + private string runstateField; - + private uint seedField; - + private string resultField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte assertsField; - + private string labelField; - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperties properties { get { @@ -2355,7 +2356,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProp this.propertiesField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason reason { get { @@ -2365,7 +2366,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReas this.reasonField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure failure { get { @@ -2375,7 +2376,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFail this.failureField = value; } } - + /// public string output { get { @@ -2385,9 +2386,9 @@ public string output { this.outputField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -2396,9 +2397,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2407,9 +2408,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -2418,9 +2419,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string methodname { get { return this.methodnameField; @@ -2429,9 +2430,9 @@ public string methodname { this.methodnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string classname { get { return this.classnameField; @@ -2440,9 +2441,9 @@ public string classname { this.classnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -2451,9 +2452,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public uint seed { get { return this.seedField; @@ -2462,9 +2463,9 @@ public uint seed { this.seedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -2473,9 +2474,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -2484,9 +2485,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -2495,9 +2496,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -2506,9 +2507,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -2517,9 +2518,9 @@ public byte asserts { this.assertsField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string label { get { return this.labelField; @@ -2529,17 +2530,17 @@ public string label { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperties { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcasePropertiesProperty propertyField; - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcasePropertiesProperty property { get { @@ -2550,21 +2551,21 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProp } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcasePropertiesProperty { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2573,9 +2574,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -2585,17 +2586,17 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason { - + private string messageField; - + /// public string message { get { @@ -2606,19 +2607,19 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure { - + private string messageField; - + private string stacktraceField; - + /// public string message { get { @@ -2628,9 +2629,9 @@ public string message { this.messageField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("stack-trace")] + [XmlElement("stack-trace")] public string stacktrace { get { return this.stacktraceField; @@ -2640,51 +2641,51 @@ public string stacktrace { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcase { - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperty[] propertiesField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason reasonField; - + private testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure failureField; - + private string outputField; - + private string idField; - + private string nameField; - + private string fullnameField; - + private string methodnameField; - + private string classnameField; - + private string runstateField; - + private uint seedField; - + private string resultField; - + private string starttimeField; - + private string endtimeField; - + private decimal durationField; - + private byte assertsField; - + private string labelField; - + /// - [System.Xml.Serialization.XmlArrayItemAttribute("property", IsNullable=false)] + [XmlArrayItem("property", IsNullable=false)] public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperty[] properties { get { return this.propertiesField; @@ -2693,7 +2694,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperty[] pr this.propertiesField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason reason { get { @@ -2703,7 +2704,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason reason this.reasonField = value; } } - + /// public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure failure { get { @@ -2713,7 +2714,7 @@ public testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure failu this.failureField = value; } } - + /// public string output { get { @@ -2723,9 +2724,9 @@ public string output { this.outputField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string id { get { return this.idField; @@ -2734,9 +2735,9 @@ public string id { this.idField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2745,9 +2746,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string fullname { get { return this.fullnameField; @@ -2756,9 +2757,9 @@ public string fullname { this.fullnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string methodname { get { return this.methodnameField; @@ -2767,9 +2768,9 @@ public string methodname { this.methodnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string classname { get { return this.classnameField; @@ -2778,9 +2779,9 @@ public string classname { this.classnameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string runstate { get { return this.runstateField; @@ -2789,9 +2790,9 @@ public string runstate { this.runstateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public uint seed { get { return this.seedField; @@ -2800,9 +2801,9 @@ public uint seed { this.seedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -2811,9 +2812,9 @@ public string result { this.resultField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("start-time")] + [XmlAttribute("start-time")] public string starttime { get { return this.starttimeField; @@ -2822,9 +2823,9 @@ public string starttime { this.starttimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("end-time")] + [XmlAttribute("end-time")] public string endtime { get { return this.endtimeField; @@ -2833,9 +2834,9 @@ public string endtime { this.endtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal duration { get { return this.durationField; @@ -2844,9 +2845,9 @@ public decimal duration { this.durationField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte asserts { get { return this.assertsField; @@ -2855,9 +2856,9 @@ public byte asserts { this.assertsField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string label { get { return this.labelField; @@ -2867,21 +2868,21 @@ public string label { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseProperty { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -2890,9 +2891,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -2902,17 +2903,17 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseReason { - + private string messageField; - + /// public string message { get { @@ -2923,19 +2924,19 @@ public string message { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class testrunTestsuiteTestsuiteTestsuiteTestsuiteTestsuiteTestcaseFailure { - + private string messageField; - + private string stacktraceField; - + /// public string message { get { @@ -2945,9 +2946,9 @@ public string message { this.messageField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("stack-trace")] + [XmlElement("stack-trace")] public string stacktrace { get { return this.stacktraceField; diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/results-example-nunit3.xsd b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/results-example-nunit3.xsd similarity index 100% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/results-example-nunit3.xsd rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/results-example-nunit3.xsd diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitExampleSignatureBuilder.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnitExampleSignatureBuilder.cs index bbd4bfda3..55fb3079c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitExampleSignatureBuilder.cs @@ -18,13 +18,12 @@ // // -------------------------------------------------------------------------------------------------------------------- -using System; using System.Text; using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit { public class NUnitExampleSignatureBuilder { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..065804aea --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs @@ -0,0 +1,45 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Text.RegularExpressions; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit +{ + public class NUnitScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + private readonly NUnitExampleSignatureBuilder signatureBuilder = new NUnitExampleSignatureBuilder(); + + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var build = this.signatureBuilder.Build(scenarioOutline, exampleValues); + + return IsMatchingTestCase((XElement)scenarioElement, build); + } + + internal static bool IsMatchingTestCase(XElement x, Regex exampleSignature) + { + var name = x.Attribute("name"); + return name != null && exampleSignature.IsMatch(name.Value.ToLowerInvariant().Replace(@"\", string.Empty)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs new file mode 100644 index 000000000..9f7e362a6 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs @@ -0,0 +1,128 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit +{ + public abstract class NUnitSingleResultsBase : SingleTestRunBase + { + private readonly TestResultAndName[] testResultAndNames; + + protected NUnitSingleResultsBase(XDocument resultsDocument, TestResultAndName[] testResultAndNames) + { + this.resultsDocument = resultsDocument; + this.testResultAndNames = testResultAndNames; + } + + protected XDocument resultsDocument { get; } + + public override TestResult GetFeatureResult(Feature feature) + { + var featureElement = this.GetFeatureElement(feature); + + if (featureElement == null) + { + return TestResult.Inconclusive; + } + + var results = featureElement.Descendants("test-case") + .Select(this.GetResultFromElement); + + return TestResultExtensions.Merge(results); + } + + public override TestResult GetScenarioResult(Scenario scenario) + { + var scenarioElement = this.GetScenarioElement(scenario); + + return this.GetResultFromElement(scenarioElement); + } + + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + { + var scenarioOutlineElement = this.GetScenarioOutlineElement(scenarioOutline); + + return this.DetermineScenarioOutlineResult(scenarioOutlineElement); + } + + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + { + var examplesElement = this.GetExamplesElement(scenarioOutline, exampleValues); + + return this.GetResultFromElement(examplesElement); + } + + protected static bool IsMatchingTestCase(XElement x, Regex exampleSignature) + { + var name = x.Attribute("name"); + return name != null && exampleSignature.IsMatch(name.Value.ToLowerInvariant().Replace(@"\", string.Empty)); + } + + private TestResult DetermineScenarioOutlineResult(XElement scenarioOutlineElement) + { + if (scenarioOutlineElement != null) + { + return TestResultExtensions.Merge(scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement)); + } + + return TestResult.Inconclusive; + } + + private TestResult GetResultFromElement(XElement element) + { + if (element == null) + { + return TestResult.Inconclusive; + } + + foreach (var valueAndResult in this.testResultAndNames) + { + if (element.IsAttributeSetToValue("result", valueAndResult.Name)) + { + return valueAndResult.TestResult; + } + } + + bool wasExecuted = element.IsAttributeSetToValue("executed", "true"); + + if (!wasExecuted) + { + return TestResult.Inconclusive; + } + + bool wasSuccessful = element.IsAttributeSetToValue("success", "true"); + + return wasSuccessful ? TestResult.Passed : TestResult.Failed; + } + + protected abstract XElement GetScenarioElement(Scenario scenario); + + protected abstract XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline); + + protected abstract XElement GetFeatureElement(Feature feature); + + protected abstract XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values); + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitXElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitXElementExtensions.cs new file mode 100644 index 000000000..34ac7b504 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitXElementExtensions.cs @@ -0,0 +1,39 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Xml.Linq; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit +{ + internal static class NUnitXElementExtensions + { + internal static bool IsAttributeSetToValue(this XElement element, string attributeName, string expectedValue) + { + return element.Attribute(attributeName) != null + ? string.Equals( + element.Attribute(attributeName).Value, + expectedValue, + StringComparison.InvariantCultureIgnoreCase) + : false; + } + + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/TestResultAndName.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/TestResultAndName.cs new file mode 100644 index 000000000..4068bc078 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/TestResultAndName.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit +{ + public class TestResultAndName + { + public TestResultAndName(TestResult testResult, string name) + { + this.Name = name; + this.TestResult = testResult; + } + + public string Name { get; } + + public TestResult TestResult { get; } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs deleted file mode 100644 index 82dfae7d8..000000000 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.IO.Abstractions; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 -{ - public class NUnitResults : MultipleTestResults - { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); - - public NUnitResults(IConfiguration configuration, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(NUnitExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in TestResults.OfType()) - { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; - } - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return new NUnitSingleResults(DocumentLoader.Load(fileInfo)); - } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) - { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - - return EvaluateTestResults(results); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs deleted file mode 100644 index 1c15da9fe..000000000 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.Linq; -using System.Text.RegularExpressions; -using System.Xml.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 -{ - public class NUnitSingleResults : ITestResults - { - internal NUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - - private readonly XDocument resultsDocument; - - public NUnitSingleResults(XDocument resultsDocument) - { - this.resultsDocument = resultsDocument; - } - - public bool SupportsExampleResults - { - get { return true; } - } - - public TestResult GetFeatureResult(Feature feature) - { - var featureElement = this.GetFeatureElement(feature); - - if (featureElement == null) - { - return TestResult.Inconclusive; - } - - var results = featureElement.Descendants("test-case") - .Select(this.GetResultFromElement); - - return results.Merge(); - } - - public TestResult GetScenarioResult(Scenario scenario) - { - XElement featureElement = this.GetFeatureElement(scenario.Feature); - XElement scenarioElement = null; - if (featureElement != null) - { - scenarioElement = featureElement - .Descendants("test-case") - .Where(x => x.Attribute("description") != null) - .FirstOrDefault(x => x.Attribute("description").Value == scenario.Name); - } - - return this.GetResultFromElement(scenarioElement); - } - - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) - { - XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); - XElement scenarioOutlineElement = null; - if (featureElement != null) - { - scenarioOutlineElement = this.GetFeatureElement(scenarioOutline.Feature) - .Descendants("test-suite") - .Where(x => x.Attribute("description") != null) - .FirstOrDefault(x => x.Attribute("description").Value == scenarioOutline.Name); - } - - if (scenarioOutlineElement != null) - { - return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); - } - - return this.GetResultFromElement(scenarioOutlineElement); - } - - private XElement GetFeatureElement(Feature feature) - { - return this.resultsDocument - .Descendants("test-suite") - .Where(x => x.Attribute("description") != null) - .FirstOrDefault(x => x.Attribute("description").Value == feature.Name); - } - - private TestResult GetResultFromElement(XElement element) - { - if (element == null) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Ignored")) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Inconclusive")) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Failure")) - { - return TestResult.Failed; - } - else if (IsAttributeSetToValue(element, "result", "Success")) - { - return TestResult.Passed; - } - else - { - bool wasExecuted = IsAttributeSetToValue(element, "executed", "true"); - - if (!wasExecuted) - { - return TestResult.Inconclusive; - } - - bool wasSuccessful = IsAttributeSetToValue(element, "success", "true"); - - return wasSuccessful ? TestResult.Passed : TestResult.Failed; - } - } - - private static bool IsAttributeSetToValue(XElement element, string attributeName, string expectedValue) - { - return element.Attribute(attributeName) != null - ? string.Equals( - element.Attribute(attributeName).Value, - expectedValue, - StringComparison.InvariantCultureIgnoreCase) - : false; - } - - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); - XElement examplesElement = null; - if (featureElement != null) - { - var signatureBuilder = this.ExampleSignatureBuilder; - - if (signatureBuilder == null) - { - throw new InvalidOperationException( - "You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } - - Regex exampleSignature = signatureBuilder.Build(scenarioOutline, exampleValues); - - var parameterizedTestElement = featureElement - .Descendants("test-suite") - .FirstOrDefault(x => IsMatchingParameterizedTestElement(x, scenarioOutline)); - - if (parameterizedTestElement != null) - { - examplesElement = parameterizedTestElement.Descendants("test-case") - .FirstOrDefault(x => IsMatchingTestCase(x, exampleSignature)); - } - } - - return this.GetResultFromElement(examplesElement); - } - - private static bool IsMatchingTestCase(XElement x, Regex exampleSignature) - { - var name = x.Attribute("name"); - return name != null && exampleSignature.IsMatch(name.Value.ToLowerInvariant().Replace(@"\", string.Empty)); - } - - private static bool IsMatchingParameterizedTestElement(XElement element, ScenarioOutline scenarioOutline) - { - var description = element.Attribute("description"); - - return description != null && - description.Value.Equals(scenarioOutline.Name, StringComparison.OrdinalIgnoreCase) && - element.Descendants("test-case").Any(); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs deleted file mode 100644 index be9148002..000000000 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System.IO.Abstractions; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 -{ - public class NUnit3Results : MultipleTestResults - { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); - - public NUnit3Results(IConfiguration configuration, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(NUnit3ExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in TestResults.OfType()) - { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; - } - } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) - { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - - return EvaluateTestResults(results); - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return new NUnit3SingleResult(DocumentLoader.Load(fileInfo)); - } - } -} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs deleted file mode 100644 index f9c162e49..000000000 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs +++ /dev/null @@ -1,206 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.Linq; -using System.Text.RegularExpressions; -using System.Xml.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 -{ - public class NUnit3SingleResult : ITestResults - { - private readonly XDocument resultsDocument; - - public NUnit3SingleResult(XDocument resultsDocument) - { - this.resultsDocument = resultsDocument; - } - - public bool SupportsExampleResults - { - get { return true; } - } - - internal NUnit3ExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - - public TestResult GetFeatureResult(Feature feature) - { - var featureElement = this.GetFeatureElement(feature); - - if (featureElement == null) - { - return TestResult.Inconclusive; - } - - var results = featureElement.Descendants("test-case") - .Select(this.GetResultFromElement); - - return results.Merge(); - } - - public TestResult GetScenarioResult(Scenario scenario) - { - XElement featureElement = this.GetFeatureElement(scenario.Feature); - XElement scenarioElement = null; - if (featureElement != null) - { - scenarioElement = featureElement - .Descendants("test-case") - .FirstOrDefault( - ts => - ts.Elements("properties").Elements("property") - .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == scenario.Name)); - } - - return this.GetResultFromElement(scenarioElement); - } - - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) - { - XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); - XElement scenarioOutlineElement = null; - if (featureElement != null) - { - scenarioOutlineElement = this.GetFeatureElement(scenarioOutline.Feature) - .Descendants("test-suite") - .FirstOrDefault( - ts => - ts.Elements("properties").Elements("property") - .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == scenarioOutline.Name)); - } - - if (scenarioOutlineElement != null) - { - return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); - } - - return this.GetResultFromElement(scenarioOutlineElement); - } - - private XElement GetFeatureElement(Feature feature) - { - return - this.resultsDocument - .Descendants("test-suite") - .FirstOrDefault( - ts => - ts.Elements("properties").Elements("property") - .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == feature.Name)); - } - - private TestResult GetResultFromElement(XElement element) - { - if (element == null) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Skipped")) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Inconclusive")) - { - return TestResult.Inconclusive; - } - else if (IsAttributeSetToValue(element, "result", "Failed")) - { - return TestResult.Failed; - } - else if (IsAttributeSetToValue(element, "result", "Passed")) - { - return TestResult.Passed; - } - else - { - bool wasExecuted = IsAttributeSetToValue(element, "executed", "true"); - - if (!wasExecuted) - { - return TestResult.Inconclusive; - } - - bool wasSuccessful = IsAttributeSetToValue(element, "success", "true"); - - return wasSuccessful ? TestResult.Passed : TestResult.Failed; - } - } - - private static bool IsAttributeSetToValue(XElement element, string attributeName, string expectedValue) - { - return element.Attribute(attributeName) != null - ? string.Equals( - element.Attribute(attributeName).Value, - expectedValue, - StringComparison.InvariantCultureIgnoreCase) - : false; - } - - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); - XElement examplesElement = null; - if (featureElement != null) - { - var signatureBuilder = this.ExampleSignatureBuilder; - - if (signatureBuilder == null) - { - throw new InvalidOperationException( - "You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } - - Regex exampleSignature = signatureBuilder.Build(scenarioOutline, exampleValues); - - var parameterizedTestElement = featureElement - .Descendants("test-suite") - .FirstOrDefault( - ts => - ts.Elements("properties").Elements("property") - .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == scenarioOutline.Name)); - - if (parameterizedTestElement != null) - { - examplesElement = parameterizedTestElement.Descendants("test-case") - .FirstOrDefault(x => IsMatchingTestCase(x, exampleSignature)); - } - } - - return this.GetResultFromElement(examplesElement); - } - - private static bool IsMatchingTestCase(XElement x, Regex exampleSignature) - { - var name = x.Attribute("name"); - return name != null && exampleSignature.IsMatch(name.Value.ToLowerInvariant().Replace(@"\", string.Empty)); - } - - private static bool IsMatchingParameterizedTestElement(XElement element, ScenarioOutline scenarioOutline) - { - var description = element.Attribute("description"); - - return description != null && - description.Value.Equals(scenarioOutline.Name, StringComparison.OrdinalIgnoreCase) && - element.Descendants("test-case").Any(); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index be14e77fa..5fa51d9b4 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -53,42 +53,67 @@ + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + results-example-nunit3.xsd + + + + + - - + + + + + - - - - + + + + + + + + results-example-xunit2.xsd - - - + + - + Designer - + Designer diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.v2.ncrunchproject b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.v2.ncrunchproject new file mode 100644 index 000000000..30815b193 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.v2.ncrunchproject @@ -0,0 +1,26 @@ + + true + 1000 + false + false + false + true + false + false + false + false + false + true + true + false + true + true + true + 60000 + + + + AutoDetect + STA + x86 + \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs new file mode 100644 index 000000000..82b23b8a5 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs @@ -0,0 +1,86 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks +{ + public abstract class SingleTestRunBase : ITestResults + { + internal IScenarioOutlineExampleMatcher ScenarioOutlineExampleMatcher { get; set; } + + public abstract TestResult GetFeatureResult(Feature feature); + + public abstract TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline); + + public abstract TestResult GetScenarioResult(Scenario scenario); + + public abstract TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues); + + protected TestResult GetAggregateResult(int passedCount, int failedCount, int skippedCount) + { + TestResult result; + if (passedCount > 0 && failedCount == 0) + { + result = TestResult.Passed; + } + else if (failedCount > 0) + { + result = TestResult.Failed; + } + else + { + result = TestResult.Inconclusive; + } + + return result; + } + + protected TestResult DetermineAggregateResult(IEnumerable exampleResults) + { + int passedCount = 0; + int failedCount = 0; + int skippedCount = 0; + + foreach (TestResult result in exampleResults) + { + if (result == TestResult.Inconclusive) + { + skippedCount++; + } + + if (result == TestResult.Passed) + { + passedCount++; + } + + if (result == TestResult.Failed) + { + failedCount++; + } + } + + return this.GetAggregateResult(passedCount, failedCount, skippedCount); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/Factory.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/Factory.cs index c7213cdf8..69c00516b 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/Factory.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/Factory.cs @@ -18,11 +18,12 @@ // // -------------------------------------------------------------------------------------------------------------------- +using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; -namespace PicklesDoc.Pickles.Parser.SpecRun +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { internal static class Factory { @@ -40,24 +41,24 @@ internal static class Factory */ - internal static Feature ToSpecRunFeature(XElement featureXml) + internal static SpecRunFeature ToSpecRunFeature(XElement featureXml) { var title = featureXml.Element("title"); var scenarios = featureXml.Element("scenarios"); - return new Feature + return new SpecRunFeature { Title = title != null ? title.Value : string.Empty, - Scenarios = scenarios != null ? scenarios.Elements("scenario").Select(ToSpecRunScenario).ToList() : new List() + Scenarios = scenarios != null ? scenarios.Elements("scenario").Select(ToSpecRunScenario).ToList() : new List() }; } - internal static Scenario ToSpecRunScenario(XElement scenarioXml) + internal static SpecRunScenario ToSpecRunScenario(XElement scenarioXml) { var title = scenarioXml.Element("title"); var result = scenarioXml.Element("result"); - return new Scenario + return new SpecRunScenario { Title = title != null ? title.Value : string.Empty, Result = result != null ? result.Value : string.Empty diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs similarity index 69% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs index 8b6051fbe..0118113a3 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -24,21 +24,16 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class NUnit3ExampleSignatureBuilder + public class SpecRunExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { var stringBuilder = new StringBuilder(); - stringBuilder.Append(scenarioOutline.Name.ToLowerInvariant().Replace(" ", string.Empty) + "\\("); - - foreach (string value in row) - { - stringBuilder.AppendFormat("\"{0}\",", value.ToLowerInvariant().Replace(@"\", string.Empty).Replace(@"$", @"\$")); - } - - stringBuilder.Remove(stringBuilder.Length - 1, 1); + stringBuilder.Append(scenarioOutline.Name); + stringBuilder.Append("(, Examples (\\d*))?"); + stringBuilder.Append(", " + row[0]); return new Regex(stringBuilder.ToString()); } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/Feature.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunFeature.cs similarity index 88% rename from src/Pickles/Pickles.TestFrameworks/SpecRun/Feature.cs rename to src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunFeature.cs index 01cdb34ca..d2712fee6 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/Feature.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunFeature.cs @@ -21,12 +21,12 @@ using System; using System.Collections.Generic; -namespace PicklesDoc.Pickles.Parser.SpecRun +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - internal class Feature + public class SpecRunFeature { public string Title { get; set; } - public List Scenarios { get; set; } + public List Scenarios { get; set; } } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 01d03b498..0a6282f87 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -19,27 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunResults : MultipleTestResults + public class SpecRunResults : MultipleTestRunsBase { - public SpecRunResults(IConfiguration configuration) - : base(false, configuration) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) - { - throw new NotSupportedException(); - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { - return new SpecRunSingleResults(fileInfo); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/Scenario.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenario.cs similarity index 86% rename from src/Pickles/Pickles.TestFrameworks/SpecRun/Scenario.cs rename to src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenario.cs index 512da1eb0..8c4a9e0e2 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/Scenario.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenario.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -18,9 +18,11 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace PicklesDoc.Pickles.Parser.SpecRun +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - internal class Scenario + public class SpecRunScenario { public string Title { get; set; } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..4ef1057f2 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenarioOutlineExampleMatcher.cs @@ -0,0 +1,36 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun +{ + public class SpecRunScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + private readonly SpecRunExampleSignatureBuilder signatureBuilder = new SpecRunExampleSignatureBuilder(); + + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var build = this.signatureBuilder.Build(scenarioOutline, exampleValues); + + return build.IsMatch(((SpecRunScenario)scenarioElement).Title); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs new file mode 100644 index 000000000..ea5d82e3d --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs @@ -0,0 +1,74 @@ + // -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.IO.Abstractions; +using System.Linq; +using System.Xml; +using System.Xml.Linq; + +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun +{ + public class SpecRunSingleResultLoader : ISingleResultLoader + { + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + var document = this.ReadResultsFile(fileInfo); + var features = this.ToFeatures(document); + + return new SpecRunSingleResults(features); + } + + private List ToFeatures(XDocument readResultsFile) + { + return readResultsFile.Descendants("feature").Select(Factory.ToSpecRunFeature).ToList(); + } + + private XDocument ReadResultsFile(FileInfoBase testResultsFile) + { + XDocument document; + using (var stream = testResultsFile.OpenRead()) + { + using (var streamReader = new System.IO.StreamReader(stream)) + { + string content = streamReader.ReadToEnd(); + + int begin = content.IndexOf("", System.StringComparison.Ordinal); + + content = content.Substring(0, end); + + content = content.Replace("<", "<").Replace(">", ">"); + + var xmlReader = XmlReader.Create(new System.IO.StringReader(content)); + document = XDocument.Load(xmlReader); + } + } + + return document; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs index ab2c33879..7563f8f24 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -20,37 +20,23 @@ using System; using System.Collections.Generic; -using System.IO.Abstractions; using System.Linq; -using System.Xml; -using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; -using Feature = PicklesDoc.Pickles.Parser.SpecRun.Feature; -using Scenario = PicklesDoc.Pickles.ObjectModel.Scenario; - namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunSingleResults : ITestResults + public class SpecRunSingleResults : SingleTestRunBase { - private readonly List specRunFeatures; + private readonly List specRunFeatures; - public SpecRunSingleResults(FileInfoBase fileInfo) + public SpecRunSingleResults(IEnumerable specRunFeatures) { - var resultsDocument = this.ReadResultsFile(fileInfo); - - this.specRunFeatures = - resultsDocument.Descendants("feature").Select(Parser.SpecRun.Factory.ToSpecRunFeature).ToList(); + this.specRunFeatures = specRunFeatures.ToList(); } - public TestResult GetFeatureResult(ObjectModel.Feature feature) + public override TestResult GetFeatureResult(Feature feature) { - if (this.specRunFeatures == null) - { - return TestResult.Inconclusive; - } - var specRunFeature = this.FindSpecRunFeature(feature); if (specRunFeature == null) @@ -64,13 +50,8 @@ public TestResult GetFeatureResult(ObjectModel.Feature feature) return result; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - if (this.specRunFeatures == null) - { - return TestResult.Inconclusive; - } - var specRunFeature = this.FindSpecRunFeature(scenarioOutline.Feature); if (specRunFeature == null) @@ -78,7 +59,7 @@ public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) return TestResult.Inconclusive; } - Parser.SpecRun.Scenario[] specRunScenarios = FindSpecRunScenarios(scenarioOutline, specRunFeature); + SpecRunScenario[] specRunScenarios = FindSpecRunScenarios(scenarioOutline, specRunFeature); if (specRunScenarios.Length == 0) { @@ -90,13 +71,8 @@ public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) return result; } - public TestResult GetScenarioResult(Scenario scenario) + public override TestResult GetScenarioResult(Scenario scenario) { - if (this.specRunFeatures == null) - { - return TestResult.Inconclusive; - } - var specRunFeature = this.FindSpecRunFeature(scenario.Feature); if (specRunFeature == null) @@ -114,14 +90,26 @@ public TestResult GetScenarioResult(Scenario scenario) return StringToTestResult(specRunScenario.Result); } - public TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - throw new NotSupportedException(); - } + var specRunFeature = this.FindSpecRunFeature(scenario.Feature); - public bool SupportsExampleResults - { - get { return false; } + if (specRunFeature == null) + { + return TestResult.Inconclusive; + } + + var specRunScenarios = FindSpecRunScenarios(scenario, specRunFeature); + + foreach (var specRunScenario in specRunScenarios) + { + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenario, exampleValues, specRunScenario)) + { + return StringToTestResult(specRunScenario.Result); + } + } + + return TestResult.Inconclusive; } private static TestResult StringsToTestResult(IEnumerable results) @@ -160,50 +148,21 @@ private static TestResult StringToTestResult(string result) } } - private static Parser.SpecRun.Scenario[] FindSpecRunScenarios(ScenarioOutline scenarioOutline, Parser.SpecRun.Feature specRunFeature) + private static SpecRunScenario[] FindSpecRunScenarios(ScenarioOutline scenarioOutline, SpecRunFeature specRunFeature) { return specRunFeature.Scenarios.Where(d => d.Title.StartsWith(scenarioOutline.Name + ", ")).ToArray(); } - private static Parser.SpecRun.Scenario FindSpecRunScenario(Scenario scenario, Parser.SpecRun.Feature specRunFeature) + private static SpecRunScenario FindSpecRunScenario(Scenario scenario, SpecRunFeature specRunFeature) { - Parser.SpecRun.Scenario result = specRunFeature.Scenarios.FirstOrDefault(d => d.Title.Equals(scenario.Name)); + SpecRunScenario result = specRunFeature.Scenarios.FirstOrDefault(d => d.Title.Equals(scenario.Name)); return result; } - private Parser.SpecRun.Feature FindSpecRunFeature(ObjectModel.Feature feature) + private SpecRunFeature FindSpecRunFeature(Feature feature) { return this.specRunFeatures.FirstOrDefault(specRunFeature => specRunFeature.Title == feature.Name); } - - private XDocument ReadResultsFile(FileInfoBase testResultsFile) - { - XDocument document; - using (var stream = testResultsFile.OpenRead()) - { - using (var streamReader = new System.IO.StreamReader(stream)) - { - string content = streamReader.ReadToEnd(); - - int begin = content.IndexOf("", System.StringComparison.Ordinal); - - content = content.Substring(0, end); - - content = content.Replace("<", "<").Replace(">", ">"); - - var xmlReader = XmlReader.Create(new System.IO.StringReader(content)); - document = XDocument.Load(xmlReader); - } - } - - return document; - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestElementExtensions.cs new file mode 100644 index 000000000..92d8345ae --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestElementExtensions.cs @@ -0,0 +1,149 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + internal static class VsTestElementExtensions + { + private const string Failed = "failed"; + + private static readonly XNamespace Ns = @"http://microsoft.com/schemas/VisualStudio/TeamTest/2010"; + + internal static bool BelongsToFeature(this XElement parentElement, string featureTitle) + { + //// + //// + //// + + var propertiesElement = parentElement.Element(Ns + "TestMethod"); + + if (propertiesElement == null) + { + return false; + } + + var attributes = propertiesElement.Attributes("className"); + bool b = attributes.Any(a => a.Value.ToUpperInvariant().Contains(TransformName(featureTitle) + "FEATURE")); + return b; + } + + internal static string Name(this XElement scenario) + { + //// + + return scenario.Attribute("name")?.Value ?? String.Empty; + } + + internal static IEnumerable AllExecutionResults(this XDocument document) + { + //// TestRun/Results/UnitTestResult + + if (document?.Root == null) + { + return new XElement[0]; + } + + return document.Root.Descendants(Ns + "UnitTestResult"); + } + + /// + /// Retrieves all potential scenarios in the test result file. "Potential" because + /// there may be some regular unit tests included as well. They cause no problems, however. + /// + /// The test result file. + /// + /// A sequence of instances that are called "UnitTest". + /// + internal static IEnumerable AllScenarios(this XDocument document) + { + //// TestRun/TestDefinitions/UnitTests that have a non-empty Description (which is the title of a Scenario). + + if (document?.Root == null) + { + return new XElement[0]; + } + + return document.Root.Descendants(Ns + "UnitTest"); + } + + internal static Guid ExecutionIdElement(this XElement scenario) + { + //// + //// + //// + + var xElement = scenario.Element(Ns + "Execution"); + + return xElement != null ? new Guid(xElement.Attribute("id").Value) : Guid.Empty; + } + + internal static IEnumerable ExecutionIdElements(this IEnumerable scenarios) + { + return scenarios.Select(ExecutionIdElement); + } + + internal static TestResult Outcome(this XElement scenarioResult) + { + //// + + var outcomeAttribute = scenarioResult.Attribute("outcome")?.Value ?? Failed; + + switch (outcomeAttribute.ToLowerInvariant()) + { + case "passed": + return TestResult.Passed; + case Failed: + return TestResult.Failed; + default: + return TestResult.Inconclusive; + } + } + + internal static Guid ExecutionIdAttribute(this XElement unitTestResult) + { + //// + + var executionIdAttribute = unitTestResult.Attribute("executionId"); + return executionIdAttribute != null ? new Guid(executionIdAttribute.Value) : Guid.Empty; + } + + internal static bool BelongsToScenarioOutline(this XElement xmlScenario, ScenarioOutline scenarioOutline) + { + return xmlScenario.Name().ToUpperInvariant().StartsWith(TransformName(scenarioOutline.Name)); + } + + internal static bool BelongsToScenario(this XElement xmlScenario, Scenario scenario) + { + return xmlScenario.Name().ToUpperInvariant() == TransformName(scenario.Name); + } + + private static string TransformName(string name) + { + return name.Replace(" ", "").Replace(".", "_").ToUpperInvariant(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestExampleSignatureBuilder.cs new file mode 100644 index 000000000..a32ca45c4 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestExampleSignatureBuilder.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + public class VsTestExampleSignatureBuilder + { + public Regex Build(ScenarioOutline scenarioOutline, string[] row) + { + // We don't actually need this regex-based thing for VsTest results. + // It sucks that we have to provide one. + return new Regex(string.Empty); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestResults.cs new file mode 100644 index 000000000..b0799a348 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestResults.cs @@ -0,0 +1,32 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + public class VsTestResults : MultipleTestRunsBase + { + public VsTestResults(IConfiguration configuration, VsTestSingleResultLoader singleResultLoader, VsTestScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) + { + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..edd3cbb1e --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs @@ -0,0 +1,38 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + public class VsTestScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var element = (XElement)scenarioElement; + + var isMatch = element.Name().ToUpperInvariant().EndsWith(exampleValues[0].Replace(":", "").Replace("\\", "").ToUpperInvariant()); + return isMatch; + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResultLoader.cs new file mode 100644 index 000000000..82a29a51d --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResultLoader.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + public class VsTestSingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new VsTestSingleResults(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResults.cs new file mode 100644 index 000000000..801f1e811 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResults.cs @@ -0,0 +1,166 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.VsTest +{ + /// + /// The class responsible for parsing a single VS Test result file. + /// + /// + /// The VS Test result format is a bit weird in that it stores the tests and their results in + /// separate lists. So in order to know the result of a scenario, + /// we first have to identify the test definition that belongs to the scenario. + /// Then with the id of the scenario we look up an execution id, + /// and with the execution id we can look up the result. + /// + public class VsTestSingleResults : SingleTestRunBase + { + private readonly XDocument resultsDocument; + + public VsTestSingleResults(XDocument resultsDocument) + { + this.resultsDocument = resultsDocument; + } + + public override TestResult GetFeatureResult(Feature feature) + { + var scenarios = this.GetScenariosForFeature(feature); + + var featureExecutionIds = scenarios.ExecutionIdElements(); + + TestResult result = this.GetExecutionResult(featureExecutionIds); + + return result; + } + + /// + /// Retrieves all UnitTest XElements that belong to the specified feature. + /// + /// The feature for which to retrieve the unit tests. + /// A sequence of instances that are called "UnitTest" + /// that belong to the specified feature. + private IEnumerable GetScenariosForFeature(Feature feature) + { + var scenarios = from scenario in this.resultsDocument.AllScenarios() + where scenario.BelongsToFeature(feature.Name) + select scenario; + + return scenarios; + } + + private TestResult GetExecutionResult(IEnumerable featureExecutionIds) + { + TestResult result = featureExecutionIds.Select(this.GetExecutionResult).Merge(); + return result; + } + + private TestResult GetExecutionResult(Guid scenarioExecutionId) + { + var query = + this.resultsDocument.AllExecutionResults() + .Where(er => er.ExecutionIdAttribute() == scenarioExecutionId) + .Select(sr => sr.Outcome()); + + var result = query.FirstOrDefault(); + + return result; + } + + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + { + var scenarios = this.GetScenariosForScenarioOutline(scenarioOutline); + + var executionIds = scenarios.Select(scenario => scenario.ExecutionIdElement()); + + TestResult result = this.GetExecutionResult(executionIds); + + return result; + } + + private IEnumerable GetScenariosForScenarioOutline(ScenarioOutline scenarioOutline) + { + var scenarios = + this.GetScenariosForFeature(scenarioOutline.Feature) + .Where(scenario => scenario.BelongsToScenarioOutline(scenarioOutline)); + + return scenarios; + } + + public override TestResult GetScenarioResult(Scenario scenario) + { + var scenarios = this.GetScenariosForScenario(scenario); + + Guid executionId = scenarios.Select(s => s.ExecutionIdElement()).FirstOrDefault(); + + TestResult testResult = this.GetExecutionResult(executionId); + + return testResult; + } + + private IEnumerable GetScenariosForScenario(Scenario scenario) + { + var scenarios = + this.GetScenariosForFeature(scenario.Feature); + + scenarios = scenarios.Where(s => s.BelongsToScenario(scenario)); + + return scenarios; + } + + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + { + var scenarioElements = this.GetScenariosForScenarioOutline(scenario); + + var theScenario = this.GetScenarioThatMatchesTheExampleValues(scenario, exampleValues, scenarioElements); + + Guid executionId = theScenario.ExecutionIdElement(); + + TestResult testResult = this.GetExecutionResult(executionId); + + return testResult; + } + + private XElement GetScenarioThatMatchesTheExampleValues(ScenarioOutline scenarioOutline, string[] exampleValues, IEnumerable scenarioElements) + { + // filter for example values + XElement theScenario = null; + + foreach (var element in scenarioElements) + { + var isMatch = this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, element); + + if (isMatch) + { + theScenario = element; + break; + } + } + + return theScenario; + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/XDocumentLoader.cs b/src/Pickles/Pickles.TestFrameworks/XDocumentLoader.cs index 75ce3d909..0a6472bd6 100644 --- a/src/Pickles/Pickles.TestFrameworks/XDocumentLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XDocumentLoader.cs @@ -18,6 +18,7 @@ // // -------------------------------------------------------------------------------------------------------------------- +using System.IO; using System.IO.Abstractions; using System.Xml; using System.Xml.Linq; @@ -31,11 +32,18 @@ public XDocument Load(FileInfoBase fileInfo) XDocument document; using (var stream = fileInfo.OpenRead()) { - XmlReader xmlReader = XmlReader.Create(stream); - document = XDocument.Load(xmlReader); + document = this.Load(stream); } return document; } + + public XDocument Load(Stream stream) + { + XmlReader xmlReader = XmlReader.Create(stream); + var document = XDocument.Load(xmlReader); + + return document; + } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs new file mode 100644 index 000000000..416406214 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 +{ + public class XUnit1Results : MultipleTestRunsBase + { + public XUnit1Results( + IConfiguration configuration, + XUnit1SingleResultLoader singleResultLoader, + XUnit1ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) + { + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1ScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1ScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..f73f0fa27 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1ScenarioOutlineExampleMatcher.cs @@ -0,0 +1,44 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Text.RegularExpressions; +using System.Xml.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 +{ + public class XUnit1ScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + private readonly XUnitExampleSignatureBuilder signatureBuilder = new XUnitExampleSignatureBuilder(); + + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var build = this.signatureBuilder.Build(scenarioOutline, exampleValues); + + return IsMatchingTestCase((XElement)scenarioElement, build); + } + + internal static bool IsMatchingTestCase(XElement x, Regex exampleSignature) + { + return exampleSignature.IsMatch(x.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs similarity index 63% rename from src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 01acd30fc..59a3d2dda 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -26,25 +26,18 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnitSingleResults : ITestResults + public class XUnit1SingleResult : SingleTestRunBase { - internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - private readonly XDocument resultsDocument; - public XUnitSingleResults(XDocument resultsDocument) + public XUnit1SingleResult(XDocument resultsDocument) { this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults - { - get { return true; } - } - - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { XElement featureElement = this.GetFeatureElement(feature); @@ -57,44 +50,41 @@ public TestResult GetFeatureResult(Feature feature) int failedCount = int.Parse(featureElement.Attribute("failed").Value); int skippedCount = int.Parse(featureElement.Attribute("skipped").Value); - return GetAggregateResult(passedCount, failedCount, skippedCount); + return this.GetAggregateResult(passedCount, failedCount, skippedCount); + } + + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + { + IEnumerable exampleResults = this.GetScenarioOutlineElements(scenarioOutline).Select(this.GetResultFromElement); + return this.DetermineAggregateResult(exampleResults); + } + + public override TestResult GetScenarioResult(Scenario scenario) + { + XElement scenarioElement = this.GetScenarioElement(scenario); + return scenarioElement != null + ? this.GetResultFromElement(scenarioElement) + : TestResult.Inconclusive; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - int passedCount = 0; - int failedCount = 0; - int skippedCount = 0; foreach (XElement exampleElement in exampleElements) { - TestResult result = this.GetResultFromElement(exampleElement); - if (result == TestResult.Inconclusive) + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, exampleElement)) { - skippedCount++; - } - - if (result == TestResult.Passed) - { - passedCount++; - } - - if (result == TestResult.Failed) - { - failedCount++; + return this.GetResultFromElement(exampleElement); } } - return GetAggregateResult(passedCount, failedCount, skippedCount); + return TestResult.Inconclusive; } - public TestResult GetScenarioResult(Scenario scenario) + private bool ScenarioOutlineExampleIsMatch(Regex signature, XElement exampleElement) { - XElement scenarioElement = this.GetScenarioElement(scenario); - return scenarioElement != null - ? this.GetResultFromElement(scenarioElement) - : TestResult.Inconclusive; + return signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty)); } private XElement GetFeatureElement(Feature feature) @@ -155,48 +145,5 @@ private TestResult GetResultFromElement(XElement element) return result; } - - private static TestResult GetAggregateResult(int passedCount, int failedCount, int skippedCount) - { - TestResult result; - if (passedCount > 0 && failedCount == 0) - { - result = TestResult.Passed; - } - else if (failedCount > 0) - { - result = TestResult.Failed; - } - else - { - result = TestResult.Inconclusive; - } - - return result; - } - - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - var result = new TestResult(); - var signatureBuilder = this.ExampleSignatureBuilder; - - if (signatureBuilder == null) - { - throw new InvalidOperationException("You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } - - foreach (XElement exampleElement in exampleElements) - { - Regex signature = signatureBuilder.Build(scenarioOutline, exampleValues); - if (signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty))) - { - return this.GetResultFromElement(exampleElement); - } - } - - return result; - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs new file mode 100644 index 000000000..0c1191bf4 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 +{ + public class XUnit1SingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new XUnit1SingleResult(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs new file mode 100644 index 000000000..a3f43b9e9 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -0,0 +1,32 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 +{ + public class XUnit2Results : MultipleTestRunsBase + { + public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnit2ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) + { + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..1ea93e3b6 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs @@ -0,0 +1,43 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 +{ + public class XUnit2ScenarioOutlineExampleMatcher : IScenarioOutlineExampleMatcher + { + private readonly XUnitExampleSignatureBuilder signatureBuilder = new XUnitExampleSignatureBuilder(); + + public bool IsMatch(ScenarioOutline scenarioOutline, string[] exampleValues, object scenarioElement) + { + var build = this.signatureBuilder.Build(scenarioOutline, exampleValues); + + return ScenarioOutlineExampleIsMatch((assembliesAssemblyCollectionTest)scenarioElement, build); + } + + private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) + { + return signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs new file mode 100644 index 000000000..a530b5279 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2011 Jeffrey Cameron +// Copyright 2012-present PicklesDoc team and community contributors +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// -------------------------------------------------------------------------------------------------------------------- + +using System; +using System.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 +{ + public class XUnit2SingleResultLoader : ISingleResultLoader + { + private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); + + public SingleTestRunBase Load(FileInfoBase fileInfo) + { + return new XUnit2SingleResults(this.xmlDeserializer.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs similarity index 64% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 6190ff211..f50d1c87c 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -25,9 +25,9 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2SingleResults : ITestResults + public class XUnit2SingleResults : SingleTestRunBase { private readonly assemblies resultsDocument; @@ -36,14 +36,7 @@ public XUnit2SingleResults(assemblies resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults - { - get { return true; } - } - - internal XUnit2ExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var featureElement = this.GetFeatureElement(feature); @@ -56,44 +49,52 @@ public TestResult GetFeatureResult(Feature feature) int failedCount = featureElement.failed; int skippedCount = featureElement.skipped; - return GetAggregateResult(passedCount, failedCount, skippedCount); + return this.GetAggregateResult(passedCount, failedCount, skippedCount); + } + + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + { + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline).Select(this.GetResultFromElement); + + return this.DetermineAggregateResult(exampleElements); + } + + public override TestResult GetScenarioResult(Scenario scenario) + { + var scenarioElement = this.GetScenarioElement(scenario); + return scenarioElement != null + ? this.GetResultFromElement(scenarioElement) + : TestResult.Inconclusive; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - int passedCount = 0; - int failedCount = 0; - int skippedCount = 0; foreach (var exampleElement in exampleElements) { - TestResult result = this.GetResultFromElement(exampleElement); - if (result == TestResult.Inconclusive) + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, exampleElement)) { - skippedCount++; + return this.GetResultFromElement(exampleElement); } + } - if (result == TestResult.Passed) - { - passedCount++; - } + return TestResult.Inconclusive; + } - if (result == TestResult.Failed) - { - failedCount++; - } - } + private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) + { + return HasTraitWithValue(test, "Description", description); + } - return GetAggregateResult(passedCount, failedCount, skippedCount); + private static bool HasFeatureTitleTrait(assembliesAssemblyCollectionTest test, string featureTitle) + { + return HasTraitWithValue(test, "FeatureTitle", featureTitle); } - public TestResult GetScenarioResult(Scenario scenario) + private static bool HasTraitWithValue(assembliesAssemblyCollectionTest test, string trait, string value) { - var scenarioElement = this.GetScenarioElement(scenario); - return scenarioElement != null - ? this.GetResultFromElement(scenarioElement) - : TestResult.Inconclusive; + return test.traits != null && test.traits.Any(t => t.name == trait && t.value == value); } private assembliesAssemblyCollection GetFeatureElement(Feature feature) @@ -128,21 +129,6 @@ where HasDescriptionTrait(test, scenario.Name) return query; } - private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) - { - return HasTraitWithValue(test, "Description", description); - } - - private static bool HasFeatureTitleTrait(assembliesAssemblyCollectionTest test, string featureTitle) - { - return HasTraitWithValue(test, "FeatureTitle", featureTitle); - } - - private static bool HasTraitWithValue(assembliesAssemblyCollectionTest test, string trait, string value) - { - return test.traits != null && test.traits.Any(t => t.name == trait && t.value == value); - } - private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element) { TestResult result; @@ -163,48 +149,5 @@ private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element return result; } - - private static TestResult GetAggregateResult(int passedCount, int failedCount, int skippedCount) - { - TestResult result; - if (passedCount > 0 && failedCount == 0) - { - result = TestResult.Passed; - } - else if (failedCount > 0) - { - result = TestResult.Failed; - } - else - { - result = TestResult.Inconclusive; - } - - return result; - } - - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - var result = new TestResult(); - var signatureBuilder = this.ExampleSignatureBuilder; - - if (signatureBuilder == null) - { - throw new InvalidOperationException("You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } - - foreach (var exampleElement in exampleElements) - { - Regex signature = signatureBuilder.Build(scenarioOutline, exampleValues); - if (signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty))) - { - return this.GetResultFromElement(exampleElement); - } - } - - return result; - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/results-example-xunit2.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/results-example-xunit2.cs similarity index 76% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/results-example-xunit2.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/results-example-xunit2.cs index 2620e5184..ad54087e3 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/results-example-xunit2.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/results-example-xunit2.cs @@ -8,24 +8,25 @@ // //------------------------------------------------------------------------------ -// +// // This source code was auto-generated by xsd, Version=4.6.1055.0. -// -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 { - using System.Xml.Serialization; - - +// + +using System; +using System.Xml.Serialization; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] - [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] + [XmlType(AnonymousType=true)] + [XmlRoot(Namespace="", IsNullable=false)] public partial class assemblies { - + private assembliesAssembly assemblyField; - + /// public assembliesAssembly assembly { get { @@ -36,43 +37,43 @@ public assembliesAssembly assembly { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class assembliesAssembly { - + private object errorsField; - + private assembliesAssemblyCollection[] collectionField; - + private string nameField; - + private string environmentField; - + private string testframeworkField; - + private System.DateTime rundateField; - + private System.DateTime runtimeField; - + private string configfileField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte skippedField; - + private decimal timeField; - + private byte errors1Field; - + /// public object errors { get { @@ -82,9 +83,9 @@ public object errors { this.errorsField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("collection")] + [XmlElement("collection")] public assembliesAssemblyCollection[] collection { get { return this.collectionField; @@ -93,9 +94,9 @@ public assembliesAssemblyCollection[] collection { this.collectionField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -104,9 +105,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string environment { get { return this.environmentField; @@ -115,9 +116,9 @@ public string environment { this.environmentField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("test-framework")] + [XmlAttribute("test-framework")] public string testframework { get { return this.testframeworkField; @@ -126,9 +127,9 @@ public string testframework { this.testframeworkField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("run-date", DataType="date")] + [XmlAttribute("run-date", DataType="date")] public System.DateTime rundate { get { return this.rundateField; @@ -137,9 +138,9 @@ public System.DateTime rundate { this.rundateField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("run-time", DataType="time")] + [XmlAttribute("run-time", DataType="time")] public System.DateTime runtime { get { return this.runtimeField; @@ -148,9 +149,9 @@ public System.DateTime runtime { this.runtimeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("config-file")] + [XmlAttribute("config-file")] public string configfile { get { return this.configfileField; @@ -159,9 +160,9 @@ public string configfile { this.configfileField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -170,9 +171,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -181,9 +182,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -192,9 +193,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -203,9 +204,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal time { get { return this.timeField; @@ -214,9 +215,9 @@ public decimal time { this.timeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("errors")] + [XmlAttribute("errors")] public byte errors1 { get { return this.errors1Field; @@ -226,31 +227,31 @@ public byte errors1 { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class assembliesAssemblyCollection { - + private assembliesAssemblyCollectionTest[] testField; - + private byte totalField; - + private byte passedField; - + private byte failedField; - + private byte skippedField; - + private string nameField; - + private decimal timeField; - + /// - [System.Xml.Serialization.XmlElementAttribute("test")] + [XmlElement("test")] public assembliesAssemblyCollectionTest[] test { get { return this.testField; @@ -259,9 +260,9 @@ public assembliesAssemblyCollectionTest[] test { this.testField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte total { get { return this.totalField; @@ -270,9 +271,9 @@ public byte total { this.totalField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte passed { get { return this.passedField; @@ -281,9 +282,9 @@ public byte passed { this.passedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte failed { get { return this.failedField; @@ -292,9 +293,9 @@ public byte failed { this.failedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public byte skipped { get { return this.skippedField; @@ -303,9 +304,9 @@ public byte skipped { this.skippedField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -314,9 +315,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal time { get { return this.timeField; @@ -326,33 +327,33 @@ public decimal time { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class assembliesAssemblyCollectionTest { - + private assembliesAssemblyCollectionTestTrait[] traitsField; - + private string reasonField; - + private assembliesAssemblyCollectionTestFailure failureField; - + private string nameField; - + private string typeField; - + private string methodField; - + private decimal timeField; - + private string resultField; - + /// - [System.Xml.Serialization.XmlArrayItemAttribute("trait", IsNullable=false)] + [XmlArrayItem("trait", IsNullable=false)] public assembliesAssemblyCollectionTestTrait[] traits { get { return this.traitsField; @@ -361,7 +362,7 @@ public assembliesAssemblyCollectionTestTrait[] traits { this.traitsField = value; } } - + /// public string reason { get { @@ -371,7 +372,7 @@ public string reason { this.reasonField = value; } } - + /// public assembliesAssemblyCollectionTestFailure failure { get { @@ -381,9 +382,9 @@ public assembliesAssemblyCollectionTestFailure failure { this.failureField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -392,9 +393,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string type { get { return this.typeField; @@ -403,9 +404,9 @@ public string type { this.typeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string method { get { return this.methodField; @@ -414,9 +415,9 @@ public string method { this.methodField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public decimal time { get { return this.timeField; @@ -425,9 +426,9 @@ public decimal time { this.timeField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string result { get { return this.resultField; @@ -437,21 +438,21 @@ public string result { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class assembliesAssemblyCollectionTestTrait { - + private string nameField; - + private string valueField; - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string name { get { return this.nameField; @@ -460,9 +461,9 @@ public string name { this.nameField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute()] + [XmlAttribute()] public string value { get { return this.valueField; @@ -472,21 +473,21 @@ public string value { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] - [System.SerializableAttribute()] + [Serializable()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + [XmlType(AnonymousType=true)] public partial class assembliesAssemblyCollectionTestFailure { - + private string messageField; - + private string stacktraceField; - + private string exceptiontypeField; - + /// public string message { get { @@ -496,9 +497,9 @@ public string message { this.messageField = value; } } - + /// - [System.Xml.Serialization.XmlElementAttribute("stack-trace")] + [XmlElement("stack-trace")] public string stacktrace { get { return this.stacktraceField; @@ -507,9 +508,9 @@ public string stacktrace { this.stacktraceField = value; } } - + /// - [System.Xml.Serialization.XmlAttributeAttribute("exception-type")] + [XmlAttribute("exception-type")] public string exceptiontype { get { return this.exceptiontypeField; diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/results-example-xunit2.xsd b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/results-example-xunit2.xsd similarity index 100% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/results-example-xunit2.xsd rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/results-example-xunit2.xsd diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs similarity index 97% rename from src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs index fe08b54b5..0b09475f4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs @@ -24,7 +24,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit { public class XUnitExampleSignatureBuilder { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs deleted file mode 100644 index fe092a130..000000000 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.IO.Abstractions; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 -{ - public class XUnitResults : MultipleTestResults - { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); - - public XUnitResults(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(XUnitExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in TestResults.OfType()) - { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; - } - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return new XUnitSingleResults(DocumentLoader.Load(fileInfo)); - } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) - { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - - return EvaluateTestResults(results); - } - } -} diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs deleted file mode 100644 index e1ef5b816..000000000 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright 2011 Jeffrey Cameron -// Copyright 2012-present PicklesDoc team and community contributors -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.IO.Abstractions; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 -{ - public class XUnit2Results : MultipleTestResults - { - private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); - - public XUnit2Results(IConfiguration configuration, XUnit2ExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(XUnit2ExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in TestResults.OfType()) - { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; - } - } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return new XUnit2SingleResults(xmlDeserializer.Load(fileInfo)); - } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) - { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - - return EvaluateTestResults(results); - } - } -} diff --git a/src/Pickles/Pickles.UserInterface/MainWindow.xaml b/src/Pickles/Pickles.UserInterface/MainWindow.xaml index 1b989e78c..1bd146c39 100644 --- a/src/Pickles/Pickles.UserInterface/MainWindow.xaml +++ b/src/Pickles/Pickles.UserInterface/MainWindow.xaml @@ -101,18 +101,7 @@