From d894b6e151440a30f047ccda89be10bdbd03d6bf Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:13:07 +0100 Subject: [PATCH 001/132] The xUnit2 Signature Builder was a straight copy of the xUnit1 version --- .../XUnit2/xUnit2ExampleSignatureBuilder.cs | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs index 722e2900d..b0b2ce274 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs @@ -19,28 +19,10 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.Text; -using System.Text.RegularExpressions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 { - public class XUnit2ExampleSignatureBuilder + public class XUnit2ExampleSignatureBuilder : XUnit1.XUnitExampleSignatureBuilder { - 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()); - } } } From 4f80b003a0914f4e418b05217ec91db241b57af0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:17:47 +0100 Subject: [PATCH 002/132] Move xUnit files to an xUnit subdirectory --- .../Pickles.TestFrameworks.UnitTests.csproj | 2 +- .../WhenResolvingTestResults.cs | 2 +- ...erminingTheSignatureOfAnXUnitExampleRow.cs | 2 +- .../XUnit1/WhenParsingxUnitResultsFile.cs | 2 +- ...arsingxUnitResultsFileWithMissingTraits.cs | 2 +- ...miningTheSignatureOfAnXUnit2ExampleRow.cs} | 4 +- .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 2 +- ...rsingxUnit2ResultsFileWithMissingTraits.cs | 2 +- .../Pickles.TestFrameworks.csproj | 16 +- .../{ => XUnit}/XUnit1/XUnitResults.cs | 2 +- .../{ => XUnit}/XUnit1/XUnitSingleResults.cs | 2 +- .../XUnit1/xUnitExampleSignatureBuilder.cs | 2 +- .../{ => XUnit}/XUnit2/XUnit2Results.cs | 4 +- .../{ => XUnit}/XUnit2/XUnit2SingleResults.cs | 2 +- .../XUnit2/results-example-xunit2.cs | 249 +++++++++--------- .../XUnit2/results-example-xunit2.xsd | 0 .../XUnit2/xUnit2ExampleSignatureBuilder.cs | 2 +- src/Pickles/Pickles/PicklesModule.cs | 4 +- 18 files changed, 151 insertions(+), 150 deletions(-) rename src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/{WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs => WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs} (92%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit1/XUnitResults.cs (97%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit1/XUnitSingleResults.cs (99%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit1/xUnitExampleSignatureBuilder.cs (96%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit2/XUnit2Results.cs (94%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit2/XUnit2SingleResults.cs (99%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit2/results-example-xunit2.cs (76%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit2/results-example-xunit2.xsd (100%) rename src/Pickles/Pickles.TestFrameworks/{ => XUnit}/XUnit2/xUnit2ExampleSignatureBuilder.cs (95%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index acb5dbbd9..c49865948 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -77,7 +77,7 @@ - + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index 954e3ba85..fdcfd7e4d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -32,7 +32,7 @@ using PicklesDoc.Pickles.TestFrameworks.MsTest; using PicklesDoc.Pickles.TestFrameworks.NUnit2; using PicklesDoc.Pickles.TestFrameworks.SpecRun; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs index 7a89a0412..8133a2486 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs index 771af9ff1..fea5d46d8 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs index 988e59b62..a9c1bc5af 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs similarity index 92% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index 5d676f77b..17a4331fb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs index f9df596b5..7f18325f6 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs index ac77e054d..2b7fd40b9 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index be14e77fa..c83703c54 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -73,22 +73,22 @@ - - - - + + + + results-example-xunit2.xsd - - - + + + Designer - + Designer diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs similarity index 97% rename from src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs index fe092a130..808fb955d 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs @@ -24,7 +24,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnitResults : MultipleTestResults { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs similarity index 99% rename from src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs index 01acd30fc..d9b4149e8 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/XUnitSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs @@ -26,7 +26,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnitSingleResults : ITestResults { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs index fe08b54b5..a4be20b00 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit1/xUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs @@ -24,7 +24,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnitExampleSignatureBuilder { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index e1ef5b816..a6ac2acc9 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -24,7 +24,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2Results : MultipleTestResults { @@ -46,7 +46,7 @@ public void SetExampleSignatureBuilder(XUnit2ExampleSignatureBuilder exampleSign protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new XUnit2SingleResults(xmlDeserializer.Load(fileInfo)); + return new XUnit2SingleResults(this.xmlDeserializer.Load(fileInfo)); } public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs similarity index 99% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 6190ff211..9959ec5cd 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -25,7 +25,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2SingleResults : ITestResults { 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/XUnit2/xUnit2ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs similarity index 95% rename from src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs index b0b2ce274..48e94b8d9 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit2/xUnit2ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs @@ -20,7 +20,7 @@ using System; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2ExampleSignatureBuilder : XUnit1.XUnitExampleSignatureBuilder { diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 615c742b5..7f9d6f9f3 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -34,8 +34,8 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit2; using PicklesDoc.Pickles.TestFrameworks.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; -using PicklesDoc.Pickles.TestFrameworks.XUnit1; -using PicklesDoc.Pickles.TestFrameworks.XUnit2; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles { From b1dbfd657e7676fd230050acaf334a9a8d04b3c7 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:20:35 +0100 Subject: [PATCH 003/132] Make the xUnit1 version of the signature builder the general one --- .../XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs | 2 +- .../XUnit1/WhenParsingxUnitResultsFile.cs | 1 + .../XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs | 1 + .../Pickles.TestFrameworks/Pickles.TestFrameworks.csproj | 2 +- .../XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs | 2 +- .../XUnit/{XUnit1 => }/xUnitExampleSignatureBuilder.cs | 2 +- src/Pickles/Pickles/PicklesModule.cs | 1 + 7 files changed, 7 insertions(+), 4 deletions(-) rename src/Pickles/Pickles.TestFrameworks/XUnit/{XUnit1 => }/xUnitExampleSignatureBuilder.cs (96%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs index 8133a2486..8d2d81eb1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs index fea5d46d8..e1ade8f05 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs @@ -25,6 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index 17a4331fb..305e38d40 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -29,6 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; +using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index c83703c54..c65bd295c 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -73,7 +73,7 @@ - + diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs index 48e94b8d9..f66d815f6 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2ExampleSignatureBuilder : XUnit1.XUnitExampleSignatureBuilder + public class XUnit2ExampleSignatureBuilder : XUnitExampleSignatureBuilder { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs index a4be20b00..0b09475f4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/xUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs @@ -24,7 +24,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.XUnit { public class XUnitExampleSignatureBuilder { diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 7f9d6f9f3..86eff5d5c 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -34,6 +34,7 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit2; using PicklesDoc.Pickles.TestFrameworks.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; +using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; From a964196672662f4cb16f5903c2904a08bbe3b6d5 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:22:41 +0100 Subject: [PATCH 004/132] Get rid of xUnit2ExampleSignatureBuilder --- ...rminingTheSignatureOfAnXUnit2ExampleRow.cs | 3 +- .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 11 ++++---- .../Pickles.TestFrameworks.csproj | 1 - .../XUnit/XUnit2/XUnit2Results.cs | 4 +-- .../XUnit/XUnit2/XUnit2SingleResults.cs | 2 +- .../XUnit2/xUnit2ExampleSignatureBuilder.cs | 28 ------------------- src/Pickles/Pickles/PicklesModule.cs | 1 - 7 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index 305e38d40..fb2cfa907 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -30,7 +30,6 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.XUnit; -using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { @@ -43,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 = Container.Resolve(); 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/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs index 7f18325f6..627508658 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -25,6 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 @@ -147,7 +148,7 @@ public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -170,7 +171,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -193,7 +194,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -216,7 +217,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -248,7 +249,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnit2ExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index c65bd295c..dab35292e 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -81,7 +81,6 @@ - diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index a6ac2acc9..667284e80 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -30,13 +30,13 @@ public class XUnit2Results : MultipleTestResults { private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); - public XUnit2Results(IConfiguration configuration, XUnit2ExampleSignatureBuilder exampleSignatureBuilder) + public XUnit2Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } - public void SetExampleSignatureBuilder(XUnit2ExampleSignatureBuilder exampleSignatureBuilder) + public void SetExampleSignatureBuilder(XUnitExampleSignatureBuilder exampleSignatureBuilder) { foreach (var testResult in TestResults.OfType()) { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 9959ec5cd..e4d1d2236 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -41,7 +41,7 @@ public bool SupportsExampleResults get { return true; } } - internal XUnit2ExampleSignatureBuilder ExampleSignatureBuilder { get; set; } + internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } public TestResult GetFeatureResult(Feature feature) { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs deleted file mode 100644 index f66d815f6..000000000 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/xUnit2ExampleSignatureBuilder.cs +++ /dev/null @@ -1,28 +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; - -namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 -{ - public class XUnit2ExampleSignatureBuilder : XUnitExampleSignatureBuilder - { - } -} diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 86eff5d5c..54c810d24 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -83,7 +83,6 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From f72cdefbd8bc6d72a430968ce339b7dc020cc3fd Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:33:15 +0100 Subject: [PATCH 005/132] Extract superclasses for the XUnit results --- .../Pickles.TestFrameworks.csproj | 2 ++ .../XUnit/XUnit1/XUnitResults.cs | 20 ++---------- .../XUnit/XUnit1/XUnitSingleResults.cs | 14 ++++----- .../XUnit/XUnit2/XUnit2Results.cs | 21 ++----------- .../XUnit/XUnit2/XUnit2SingleResults.cs | 14 ++++----- .../XUnit/XUnitResultsBase.cs | 31 +++++++++++++++++++ .../XUnit/XUnitSingleResultsBase.cs | 19 ++++++++++++ 7 files changed, 68 insertions(+), 53 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index dab35292e..131b81eb4 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -81,6 +81,8 @@ + + diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs index 808fb955d..2b9f9a206 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs @@ -26,34 +26,18 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnitResults : MultipleTestResults + public class XUnitResults : XUnitResultsBase { private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); public XUnitResults(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) + : base(configuration, exampleSignatureBuilder) { - 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/XUnit/XUnit1/XUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs index d9b4149e8..ffa69d10e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs @@ -28,10 +28,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnitSingleResults : ITestResults + public class XUnitSingleResults : XUnitSingleResultsBase { - internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - private readonly XDocument resultsDocument; public XUnitSingleResults(XDocument resultsDocument) @@ -39,12 +37,12 @@ public XUnitSingleResults(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return true; } } - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { XElement featureElement = this.GetFeatureElement(feature); @@ -60,7 +58,7 @@ public TestResult GetFeatureResult(Feature feature) return GetAggregateResult(passedCount, failedCount, skippedCount); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); int passedCount = 0; @@ -89,7 +87,7 @@ public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) return GetAggregateResult(passedCount, failedCount, skippedCount); } - public TestResult GetScenarioResult(Scenario scenario) + public override TestResult GetScenarioResult(Scenario scenario) { XElement scenarioElement = this.GetScenarioElement(scenario); return scenarioElement != null @@ -175,7 +173,7 @@ private static TestResult GetAggregateResult(int passedCount, int failedCount, i return result; } - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 667284e80..cfca5134b 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -20,40 +20,23 @@ using System; using System.IO.Abstractions; -using System.Linq; using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2Results : MultipleTestResults + public class XUnit2Results : XUnitResultsBase { private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); public XUnit2Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) + : base(configuration, exampleSignatureBuilder) { - 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 XUnit2SingleResults(this.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.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index e4d1d2236..06aeeb167 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2SingleResults : ITestResults + public class XUnit2SingleResults : XUnitSingleResultsBase { private readonly assemblies resultsDocument; @@ -36,14 +36,12 @@ public XUnit2SingleResults(assemblies resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return true; } } - internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var featureElement = this.GetFeatureElement(feature); @@ -59,7 +57,7 @@ public TestResult GetFeatureResult(Feature feature) return GetAggregateResult(passedCount, failedCount, skippedCount); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); int passedCount = 0; @@ -88,7 +86,7 @@ public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) return GetAggregateResult(passedCount, failedCount, skippedCount); } - public TestResult GetScenarioResult(Scenario scenario) + public override TestResult GetScenarioResult(Scenario scenario) { var scenarioElement = this.GetScenarioElement(scenario); return scenarioElement != null @@ -183,7 +181,7 @@ private static TestResult GetAggregateResult(int passedCount, int failedCount, i return result; } - public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs new file mode 100644 index 000000000..8ceb89247 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs @@ -0,0 +1,31 @@ +using System.Linq; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit +{ + public abstract class XUnitResultsBase : MultipleTestResults + where TSingleResult : XUnitSingleResultsBase + { + public XUnitResultsBase(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) + : base(true, configuration) + { + this.SetExampleSignatureBuilder(exampleSignatureBuilder); + } + + public void SetExampleSignatureBuilder(XUnitExampleSignatureBuilder 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); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs new file mode 100644 index 000000000..72f77f1cb --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs @@ -0,0 +1,19 @@ +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit +{ + public abstract class XUnitSingleResultsBase : ITestResults + { + internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } + + public abstract bool SupportsExampleResults { get; } + + 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); + } +} \ No newline at end of file From 0042d7af48534db0af15873b9df54162a844137d Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:35:24 +0100 Subject: [PATCH 006/132] Rename XUnit to XUnit1 --- .../WhenResolvingTestResults.cs | 6 +++--- .../XUnit1/WhenParsingxUnitResultsFile.cs | 2 +- .../WhenParsingxUnitResultsFileWithMissingTraits.cs | 2 +- .../Pickles.TestFrameworks/Pickles.TestFrameworks.csproj | 4 ++-- .../XUnit/XUnit1/{XUnitResults.cs => XUnit1Results.cs} | 9 ++++----- .../{XUnitSingleResults.cs => XUnit1SingleResult.cs} | 6 +++--- src/Pickles/Pickles/PicklesModule.cs | 4 ++-- 7 files changed, 16 insertions(+), 17 deletions(-) rename src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/{XUnitResults.cs => XUnit1Results.cs} (81%) rename src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/{XUnitSingleResults.cs => XUnit1SingleResult.cs} (97%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index fdcfd7e4d..a615624cc 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -105,9 +105,9 @@ public void ThenCanResolveAsSingletonWhenTestResultsArexUnit() 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); } @@ -200,7 +200,7 @@ public void ThenCanResolveWhenTestResultsArexUnit() var item = Container.Resolve(); Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); + Check.That(item).IsInstanceOf(); } [Test] diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs index e1ade8f05..de2cf409a 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs @@ -31,7 +31,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { [TestFixture] - public class WhenParsingxUnitResultsFile : WhenParsingTestResultFiles + public class WhenParsingxUnitResultsFile : WhenParsingTestResultFiles { public WhenParsingxUnitResultsFile() : base("XUnit1." + "results-example-xunit.xml") diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs index a9c1bc5af..46af8c48d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs @@ -30,7 +30,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { [TestFixture] - public class WhenParsingxUnit1ResultsFileWithMissingTraits : WhenParsingTestResultFiles + public class WhenParsingxUnit1ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingxUnit1ResultsFileWithMissingTraits() : base("XUnit1." + "results-example-xunit1-missingTraits.xml") diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 131b81eb4..ccfd52b4e 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -74,8 +74,8 @@ - - + + results-example-xunit2.xsd diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs similarity index 81% rename from src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 2b9f9a206..8cc9e078d 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -20,24 +20,23 @@ using System; using System.IO.Abstractions; -using System.Linq; using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnitResults : XUnitResultsBase + public class XUnit1Results : XUnitResultsBase { private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); - public XUnitResults(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) + public XUnit1Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, exampleSignatureBuilder) { } protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new XUnitSingleResults(DocumentLoader.Load(fileInfo)); + return new XUnit1SingleResult(DocumentLoader.Load(fileInfo)); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs similarity index 97% rename from src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnitSingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index ffa69d10e..7d691a7d3 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/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 // @@ -28,11 +28,11 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnitSingleResults : XUnitSingleResultsBase + public class XUnit1SingleResult : XUnitSingleResultsBase { private readonly XDocument resultsDocument; - public XUnitSingleResults(XDocument resultsDocument) + public XUnit1SingleResult(XDocument resultsDocument) { this.resultsDocument = resultsDocument; } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 54c810d24..bc4492f43 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -80,7 +80,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); @@ -102,7 +102,7 @@ protected override void Load(ContainerBuilder builder) case TestResultsFormat.NUnit3: return c.Resolve(); case TestResultsFormat.xUnit: - return c.Resolve(); + return c.Resolve(); case TestResultsFormat.xUnit2: return c.Resolve(); case TestResultsFormat.MsTest: From 190bb0309886e4edd84e1117d9659c68fae5dca1 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 28 Jan 2016 14:41:07 +0100 Subject: [PATCH 007/132] Add XUnit1 enumeration member --- .../Pickles.ObjectModel/TestResultsFormat.cs | 7 +++- .../WhenParsingCommandLineArguments.cs | 34 ++++++++++++++++--- .../WhenResolvingTestResults.cs | 4 +-- src/Pickles/Pickles/PicklesModule.cs | 3 +- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs b/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs index f8b9aa814..d8b4374f0 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. 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/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index a615624cc..b7384dde6 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -98,7 +98,7 @@ public void ThenCanResolveAsSingletonWhenTestResultsArexUnit() FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "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(); @@ -194,7 +194,7 @@ public void ThenCanResolveWhenTestResultsArexUnit() FileSystem.AddFile("results-example-xunit.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "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(); diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index bc4492f43..bfb67c0d8 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -101,7 +101,8 @@ protected override void Load(ContainerBuilder builder) return c.Resolve(); case TestResultsFormat.NUnit3: return c.Resolve(); - case TestResultsFormat.xUnit: + case TestResultsFormat.XUnit: + case TestResultsFormat.XUnit1: return c.Resolve(); case TestResultsFormat.xUnit2: return c.Resolve(); From 3919967d3dd382f8ed2e6598118f6835f76edea4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 08:09:00 +0100 Subject: [PATCH 008/132] Introduce Single Result Loader for xUnit --- .../Pickles.TestFrameworks.csproj | 3 +++ .../Pickles.TestFrameworks/XDocumentLoader.cs | 12 ++++++++++-- .../XUnit/ISingleResultLoader.cs | 11 +++++++++++ .../XUnit/XUnit1/XUnit1Results.cs | 8 +++++--- .../XUnit/XUnit1/XUnit1SingleResultLoader.cs | 17 +++++++++++++++++ .../XUnit/XUnit2/XUnit2Results.cs | 4 ++-- .../XUnit/XUnit2/XUnit2SingleResultLoader.cs | 17 +++++++++++++++++ 7 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index ccfd52b4e..fd0fd32d1 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -73,6 +73,9 @@ + + + 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/ISingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs new file mode 100644 index 000000000..45f0cee18 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs @@ -0,0 +1,11 @@ +using System.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit +{ + public interface ISingleResultLoader + { + ITestResults Load(FileInfoBase fileInfo); + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 8cc9e078d..03e5a431a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -27,16 +27,18 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnit1Results : XUnitResultsBase { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + private readonly ISingleResultLoader singleResultLoader = new XUnit1SingleResultLoader(); - public XUnit1Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) + public XUnit1Results( + IConfiguration configuration, + XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, exampleSignatureBuilder) { } protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new XUnit1SingleResult(DocumentLoader.Load(fileInfo)); + return this.singleResultLoader.Load(fileInfo); } } } 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..60c552885 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -0,0 +1,17 @@ +using System; +using System.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 +{ + public class XUnit1SingleResultLoader : ISingleResultLoader + { + private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + + public ITestResults Load(FileInfoBase fileInfo) + { + return new XUnit1SingleResult(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 index cfca5134b..15c0b4b4d 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2Results : XUnitResultsBase { - private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); + private readonly ISingleResultLoader singleResultLoader = new XUnit2SingleResultLoader(); public XUnit2Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, exampleSignatureBuilder) @@ -36,7 +36,7 @@ public XUnit2Results(IConfiguration configuration, XUnitExampleSignatureBuilder protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new XUnit2SingleResults(this.xmlDeserializer.Load(fileInfo)); + return this.singleResultLoader.Load(fileInfo); } } } 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..2cf4659fa --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs @@ -0,0 +1,17 @@ +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 ITestResults Load(FileInfoBase fileInfo) + { + return new XUnit2SingleResults(this.xmlDeserializer.Load(fileInfo)); + } + } +} \ No newline at end of file From 3285b8f0e868daa80a2aef5542d5e4a7f930a65f Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:19:38 +0100 Subject: [PATCH 009/132] Make member non-static --- .../XUnit/XUnit1/XUnit1SingleResultLoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs index 60c552885..ce308b093 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -7,11 +7,11 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnit1SingleResultLoader : ISingleResultLoader { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); public ITestResults Load(FileInfoBase fileInfo) { - return new XUnit1SingleResult(DocumentLoader.Load(fileInfo)); + return new XUnit1SingleResult(this.documentLoader.Load(fileInfo)); } } } \ No newline at end of file From 2150b85f0fb39348ef143e4ba289c9dea756fe3f Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:19:43 +0100 Subject: [PATCH 010/132] Add file header --- .../XUnit/XUnit1/XUnit1SingleResultLoader.cs | 22 ++++++++++++++++++- .../XUnit/XUnit2/XUnit2SingleResultLoader.cs | 22 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs index ce308b093..d000d9450 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -1,4 +1,24 @@ -using System; +// -------------------------------------------------------------------------------------------------------------------- +// +// 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; diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs index 2cf4659fa..220ea9bee 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs @@ -1,4 +1,24 @@ -using System; +// -------------------------------------------------------------------------------------------------------------------- +// +// 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; From 9d7b7549d8d80afa420563c1bc8231ae3895d4d4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:23:19 +0100 Subject: [PATCH 011/132] Make ISingleResultLoader general --- .../Pickles.TestFrameworks/{XUnit => }/ISingleResultLoader.cs | 2 +- .../Pickles.TestFrameworks/Pickles.TestFrameworks.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/Pickles/Pickles.TestFrameworks/{XUnit => }/ISingleResultLoader.cs (78%) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs similarity index 78% rename from src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs rename to src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs index 45f0cee18..8b55c264a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/ISingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs @@ -2,7 +2,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit +namespace PicklesDoc.Pickles.TestFrameworks { public interface ISingleResultLoader { diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index fd0fd32d1..fc936bc39 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -53,6 +53,7 @@ + @@ -73,7 +74,6 @@ - From 13cfbc3ce156992d4c41b21f037cfb33d273388b Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:23:43 +0100 Subject: [PATCH 012/132] Use an ISingleResultLoader implementation in NUnitResults --- .../NUnit2/NUnit2SingleResultLoader.cs | 38 +++++++++++++++++++ .../NUnit2/NUnitResults.cs | 4 +- .../Pickles.TestFrameworks.csproj | 1 + 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs new file mode 100644 index 000000000..ba42382df --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.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.IO.Abstractions; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.XUnit; + +namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 +{ + public class NUnit2SingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public ITestResults Load(FileInfoBase fileInfo) + { + return new NUnitSingleResults(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs index 82dfae7d8..f68130852 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs @@ -28,7 +28,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { public class NUnitResults : MultipleTestResults { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + private readonly NUnit2SingleResultLoader singleResultLoader = new NUnit2SingleResultLoader(); public NUnitResults(IConfiguration configuration, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration) @@ -46,7 +46,7 @@ public void SetExampleSignatureBuilder(NUnitExampleSignatureBuilder exampleSigna protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new NUnitSingleResults(DocumentLoader.Load(fileInfo)); + return this.singleResultLoader.Load(fileInfo); } public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index fc936bc39..fac862b4e 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -60,6 +60,7 @@ + From 6afccf7f5ac8de0cc92d383c33fa6a9d128d0dd8 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:26:16 +0100 Subject: [PATCH 013/132] Use an ISingleResultsLoader implementation in nUnit3 --- .../NUnit3/NUnit3Results.cs | 4 +- .../NUnit3/NUnit3SingleResultLoader.cs | 37 +++++++++++++++++++ .../Pickles.TestFrameworks.csproj | 1 + 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs index be9148002..2523450a4 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { public class NUnit3Results : MultipleTestResults { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + private readonly NUnit3SingleResultLoader singleResultLoader = new NUnit3SingleResultLoader(); public NUnit3Results(IConfiguration configuration, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration) @@ -52,7 +52,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new NUnit3SingleResult(DocumentLoader.Load(fileInfo)); + return this.singleResultLoader.Load(fileInfo); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs new file mode 100644 index 000000000..20008a25c --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/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.NUnit3 +{ + public class NUnit3SingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public ITestResults Load(FileInfoBase fileInfo) + { + return new NUnit3SingleResult(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index fac862b4e..e3b769a14 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -61,6 +61,7 @@ + From 24ed18605081b20a4b7f1a42ed201ef34c54d6cd Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:26:38 +0100 Subject: [PATCH 014/132] Remove unused using --- .../Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs index ba42382df..002c37727 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs @@ -22,7 +22,6 @@ using System.IO.Abstractions; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit; namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { From c9a9b7e505d427b2cbea2cc6816c8b1681033407 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:27:19 +0100 Subject: [PATCH 015/132] Adjust method order --- .../Pickles.TestFrameworks/NUnit2/NUnitResults.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs index f68130852..5ac0c49a4 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs @@ -44,16 +44,16 @@ public void SetExampleSignatureBuilder(NUnitExampleSignatureBuilder exampleSigna } } - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } - 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 this.singleResultLoader.Load(fileInfo); + } } } From 3993336195454daf9e4902643a815f75d77e895f Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:29:20 +0100 Subject: [PATCH 016/132] Introduce ISingeResultLoader implementation for MsTest --- .../MsTest/MsTestResults.cs | 4 +- .../MsTest/MsTestSingleResultLoader.cs | 37 +++++++++++++++++++ .../Pickles.TestFrameworks.csproj | 1 + 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 3fa7482de..907a156b6 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { public class MsTestResults : MultipleTestResults { - private static readonly XDocumentLoader DocumentLoader = new XDocumentLoader(); + private readonly MsTestSingleResultLoader singleResultLoader = new MsTestSingleResultLoader(); public MsTestResults(IConfiguration configuration) : base(false, configuration) @@ -41,7 +41,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new MsTestSingleResults(DocumentLoader.Load(fileInfo)); + return this.singleResultLoader.Load(fileInfo); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs new file mode 100644 index 000000000..7624eb346 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.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.MsTest +{ + public class MsTestSingleResultLoader : ISingleResultLoader + { + private readonly XDocumentLoader documentLoader = new XDocumentLoader(); + + public ITestResults Load(FileInfoBase fileInfo) + { + return new MsTestSingleResults(this.documentLoader.Load(fileInfo)); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index e3b769a14..b598149b5 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -56,6 +56,7 @@ + From 29e5a159dfe2cc1abd2dc746b62fe9bfeabbee17 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:32:28 +0100 Subject: [PATCH 017/132] Introduce an ISingleResultLoader implementation for CucumberJson --- .../CucumberJson/CucumberJsonResults.cs | 4 ++- .../CucumberJsonSingleResultLoader.cs | 35 +++++++++++++++++++ .../Pickles.TestFrameworks.csproj | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 552f1199e..9411183ad 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -27,6 +27,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonResults : MultipleTestResults { + private readonly ISingleResultLoader singleResultLoader = new CucumberJsonSingleResultLoader(); + public CucumberJsonResults(IConfiguration configuration) : base(false, configuration) { @@ -39,7 +41,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new CucumberJsonSingleResults(fileInfo); + return this.singleResultLoader.Load(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..2962da764 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.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; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson +{ + public class CucumberJsonSingleResultLoader : ISingleResultLoader + { + public ITestResults Load(FileInfoBase fileInfo) + { + return new CucumberJsonSingleResults(fileInfo); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index b598149b5..13dc088bd 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -53,6 +53,7 @@ + From fe748263f257390b5643c49612f5376c13e2c859 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:37:01 +0100 Subject: [PATCH 018/132] Introduce ISingleResultLoader implementation for SpecRun --- .../Pickles.TestFrameworks.csproj | 1 + .../SpecRun/SpecRunResults.cs | 4 ++- .../SpecRun/SpecRunSingleResultLoader.cs | 35 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 13dc088bd..768a00d2c 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -76,6 +76,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 01d03b498..d6c01196c 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -27,6 +27,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { public class SpecRunResults : MultipleTestResults { + private readonly ISingleResultLoader singleResultLoader = new SpecRunSingleResultLoader(); + public SpecRunResults(IConfiguration configuration) : base(false, configuration) { @@ -39,7 +41,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - return new SpecRunSingleResults(fileInfo); + return this.singleResultLoader.Load(fileInfo); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs new file mode 100644 index 000000000..49b7817d8 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.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; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun +{ + public class SpecRunSingleResultLoader : ISingleResultLoader + { + public ITestResults Load(FileInfoBase fileInfo) + { + return new SpecRunSingleResults(fileInfo); + } + } +} \ No newline at end of file From 6830b47e016e7b825b4d16e2094e4aee9fc438bb Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:47:19 +0100 Subject: [PATCH 019/132] Introduce ISingleResultLoader at the lowest level --- ...atingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs | 2 +- .../CucumberJson/CucumberJsonResults.cs | 4 ++-- src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs | 4 ++-- src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs | 5 ++++- src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs | 4 ++-- src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs | 4 ++-- .../Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 4 ++-- .../Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs | 3 ++- .../Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs | 4 ++-- .../Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs | 4 ++-- src/Pickles/Pickles/PicklesModule.cs | 7 +++++++ 11 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs b/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs index 33d03b724..38695a929 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()); var jsonDocumentationBuilder = new JsonDocumentationBuilder(configuration, testResults, FileSystem); jsonDocumentationBuilder.Build(features); string content = FileSystem.File.ReadAllText(filePath); diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 9411183ad..928c23681 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -29,8 +29,8 @@ public class CucumberJsonResults : MultipleTestResults { private readonly ISingleResultLoader singleResultLoader = new CucumberJsonSingleResultLoader(); - public CucumberJsonResults(IConfiguration configuration) - : base(false, configuration) + public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) + : base(false, configuration, singleResultLoader) { } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 907a156b6..92db1bca0 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -29,8 +29,8 @@ public class MsTestResults : MultipleTestResults { private readonly MsTestSingleResultLoader singleResultLoader = new MsTestSingleResultLoader(); - public MsTestResults(IConfiguration configuration) - : base(false, configuration) + public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader) + : base(false, configuration, singleResultLoader) { } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index 61f501769..2838c8196 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -29,15 +29,18 @@ namespace PicklesDoc.Pickles.TestFrameworks { public abstract class MultipleTestResults : ITestResults { + private readonly ISingleResultLoader singleResultLoader; + protected MultipleTestResults(bool supportsExampleResults, IEnumerable testResults) { this.SupportsExampleResults = supportsExampleResults; this.TestResults = testResults; } - protected MultipleTestResults(bool supportsExampleResults, IConfiguration configuration) + protected MultipleTestResults(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader) { this.SupportsExampleResults = supportsExampleResults; + this.singleResultLoader = singleResultLoader; this.TestResults = this.GetSingleTestResults(configuration); } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs index 5ac0c49a4..3e16036a4 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs @@ -30,8 +30,8 @@ public class NUnitResults : MultipleTestResults { private readonly NUnit2SingleResultLoader singleResultLoader = new NUnit2SingleResultLoader(); - public NUnitResults(IConfiguration configuration, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) + public NUnitResults(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) + : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs index 2523450a4..10d6c131c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs @@ -29,8 +29,8 @@ public class NUnit3Results : MultipleTestResults { private readonly NUnit3SingleResultLoader singleResultLoader = new NUnit3SingleResultLoader(); - public NUnit3Results(IConfiguration configuration, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) + public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) + : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index d6c01196c..825c61c06 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -29,8 +29,8 @@ public class SpecRunResults : MultipleTestResults { private readonly ISingleResultLoader singleResultLoader = new SpecRunSingleResultLoader(); - public SpecRunResults(IConfiguration configuration) - : base(false, configuration) + public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader) + : base(false, configuration, singleResultLoader) { } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 03e5a431a..d1ccaab1b 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -31,8 +31,9 @@ public class XUnit1Results : XUnitResultsBase public XUnit1Results( IConfiguration configuration, + XUnit1SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, exampleSignatureBuilder) + : base(configuration, singleResultLoader, exampleSignatureBuilder) { } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 15c0b4b4d..c31b55a88 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -29,8 +29,8 @@ public class XUnit2Results : XUnitResultsBase { private readonly ISingleResultLoader singleResultLoader = new XUnit2SingleResultLoader(); - public XUnit2Results(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, exampleSignatureBuilder) + public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, exampleSignatureBuilder) { } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs index 8ceb89247..c282c233a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs @@ -7,8 +7,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit public abstract class XUnitResultsBase : MultipleTestResults where TSingleResult : XUnitSingleResultsBase { - public XUnitResultsBase(IConfiguration configuration, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration) + public XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) + : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index bfb67c0d8..13d8aa5e3 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -77,15 +77,22 @@ protected override void Load(ContainerBuilder builder) }).SingleInstance(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.Register(c => { From 7356cd8f8624afeca80bbf4ad6c6d776e672d913 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:50:44 +0100 Subject: [PATCH 020/132] Remove ISingleResultLoader at the highest level --- .../SpecRun/WhenParsingMultipleTestResultsTests.cs | 6 ------ .../CucumberJson/CucumberJsonResults.cs | 8 -------- .../Pickles.TestFrameworks/MsTest/MsTestResults.cs | 8 -------- .../Pickles.TestFrameworks/MultipleTestResults.cs | 5 ++++- .../Pickles.TestFrameworks/NUnit2/NUnitResults.cs | 8 -------- .../Pickles.TestFrameworks/NUnit3/NUnit3Results.cs | 9 +-------- .../Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 8 -------- .../XUnit/XUnit1/XUnit1Results.cs | 10 ---------- .../XUnit/XUnit2/XUnit2Results.cs | 10 ---------- 9 files changed, 5 insertions(+), 67 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index f1f3275a0..e36ea0453 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -66,12 +66,6 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { 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) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 928c23681..dd1fac32b 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -19,7 +19,6 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; using PicklesDoc.Pickles.ObjectModel; @@ -27,8 +26,6 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonResults : MultipleTestResults { - private readonly ISingleResultLoader singleResultLoader = new CucumberJsonSingleResultLoader(); - public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) : base(false, configuration, singleResultLoader) { @@ -38,10 +35,5 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { throw new NotSupportedException(); } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 92db1bca0..ce84abed5 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -19,7 +19,6 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; using PicklesDoc.Pickles.ObjectModel; @@ -27,8 +26,6 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { public class MsTestResults : MultipleTestResults { - private readonly MsTestSingleResultLoader singleResultLoader = new MsTestSingleResultLoader(); - public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader) : base(false, configuration, singleResultLoader) { @@ -38,10 +35,5 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { throw new NotSupportedException(); } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index 2838c8196..b90f19f29 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -66,7 +66,10 @@ private IEnumerable GetSingleTestResults(IConfiguration configurat return results; } - protected abstract ITestResults ConstructSingleTestResult(FileInfoBase fileInfo); + protected ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + { + return this.singleResultLoader.Load(fileInfo); + } public TestResult GetFeatureResult(Feature feature) { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs index 3e16036a4..46a958265 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs @@ -19,7 +19,6 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; using System.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -28,8 +27,6 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { public class NUnitResults : MultipleTestResults { - private readonly NUnit2SingleResultLoader singleResultLoader = new NUnit2SingleResultLoader(); - public NUnitResults(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader) { @@ -50,10 +47,5 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return EvaluateTestResults(results); } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs index 10d6c131c..a6cf8232b 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs @@ -18,7 +18,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -using System.IO.Abstractions; +using System; using System.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -27,8 +27,6 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { public class NUnit3Results : MultipleTestResults { - private readonly NUnit3SingleResultLoader singleResultLoader = new NUnit3SingleResultLoader(); - public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader) { @@ -49,10 +47,5 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return EvaluateTestResults(results); } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 825c61c06..c354ee867 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -19,7 +19,6 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; using PicklesDoc.Pickles.ObjectModel; @@ -27,8 +26,6 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { public class SpecRunResults : MultipleTestResults { - private readonly ISingleResultLoader singleResultLoader = new SpecRunSingleResultLoader(); - public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader) : base(false, configuration, singleResultLoader) { @@ -38,10 +35,5 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { throw new NotSupportedException(); } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index d1ccaab1b..cc994d895 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -19,16 +19,11 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnit1Results : XUnitResultsBase { - private readonly ISingleResultLoader singleResultLoader = new XUnit1SingleResultLoader(); - public XUnit1Results( IConfiguration configuration, XUnit1SingleResultLoader singleResultLoader, @@ -36,10 +31,5 @@ public XUnit1Results( : base(configuration, singleResultLoader, exampleSignatureBuilder) { } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index c31b55a88..6e36fec1e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -19,24 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2Results : XUnitResultsBase { - private readonly ISingleResultLoader singleResultLoader = new XUnit2SingleResultLoader(); - public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, singleResultLoader, exampleSignatureBuilder) { } - - protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) - { - return this.singleResultLoader.Load(fileInfo); - } } } From a80e7070667e82a6d2373f21539ba2e1ca37b9b0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 09:59:44 +0100 Subject: [PATCH 021/132] Pull up member --- .../XUnit/XUnit1/XUnit1SingleResult.cs | 21 +------------------ .../XUnit/XUnit2/XUnit2SingleResults.cs | 21 +------------------ .../XUnit/XUnitSingleResultsBase.cs | 19 +++++++++++++++++ 3 files changed, 21 insertions(+), 40 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 7d691a7d3..4be43cf2f 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -84,7 +84,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl } } - return GetAggregateResult(passedCount, failedCount, skippedCount); + return this.GetAggregateResult(passedCount, failedCount, skippedCount); } public override TestResult GetScenarioResult(Scenario scenario) @@ -154,25 +154,6 @@ 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 override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 06aeeb167..002318fb4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -83,7 +83,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl } } - return GetAggregateResult(passedCount, failedCount, skippedCount); + return this.GetAggregateResult(passedCount, failedCount, skippedCount); } public override TestResult GetScenarioResult(Scenario scenario) @@ -162,25 +162,6 @@ 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 override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs index 72f77f1cb..1b8085b38 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs @@ -15,5 +15,24 @@ public abstract class XUnitSingleResultsBase : ITestResults 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; + } } } \ No newline at end of file From 4f1cf55d35e453377eb67745c571ac9b5094f0f4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:06:34 +0100 Subject: [PATCH 022/132] Pull up method --- .../XUnit/XUnit1/XUnit1SingleResult.cs | 29 ++--------------- .../XUnit/XUnit2/XUnit2SingleResults.cs | 28 ++--------------- .../XUnit/XUnitSingleResultsBase.cs | 31 ++++++++++++++++++- 3 files changed, 36 insertions(+), 52 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 4be43cf2f..32007836e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -55,36 +55,13 @@ public override 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 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) - { - skippedCount++; - } - - if (result == TestResult.Passed) - { - passedCount++; - } - - if (result == TestResult.Failed) - { - failedCount++; - } - } - - return this.GetAggregateResult(passedCount, failedCount, skippedCount); + IEnumerable exampleResults = this.GetScenarioOutlineElements(scenarioOutline).Select(this.GetResultFromElement); + return this.DetermineAggregateResult(exampleResults); } public override TestResult GetScenarioResult(Scenario scenario) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 002318fb4..5b95f2928 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -54,36 +54,14 @@ public override 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); - int passedCount = 0; - int failedCount = 0; - int skippedCount = 0; - - foreach (var exampleElement in exampleElements) - { - TestResult result = this.GetResultFromElement(exampleElement); - if (result == TestResult.Inconclusive) - { - skippedCount++; - } + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline).Select(this.GetResultFromElement); - if (result == TestResult.Passed) - { - passedCount++; - } - - if (result == TestResult.Failed) - { - failedCount++; - } - } - - return this.GetAggregateResult(passedCount, failedCount, skippedCount); + return this.DetermineAggregateResult(exampleElements); } public override TestResult GetScenarioResult(Scenario scenario) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs index 1b8085b38..ec15d4aa1 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs @@ -1,4 +1,6 @@ -using PicklesDoc.Pickles.ObjectModel; +using System.Collections.Generic; + +using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.XUnit { @@ -34,5 +36,32 @@ protected TestResult GetAggregateResult(int passedCount, int failedCount, int sk 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 From c1ec99456e3b697d29f7fe96c5cfc3b66a1a2f20 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:12:29 +0100 Subject: [PATCH 023/132] Rework GetExampleResult --- .../XUnit/XUnit1/XUnit1SingleResult.cs | 13 +++---------- .../XUnit/XUnit2/XUnit2SingleResults.cs | 13 +++---------- .../XUnit/XUnitSingleResultsBase.cs | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 32007836e..dca921cf2 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -133,26 +133,19 @@ private TestResult GetResultFromElement(XElement element) public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - var result = new TestResult(); - var signatureBuilder = this.ExampleSignatureBuilder; + var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - if (signatureBuilder == null) - { - throw new InvalidOperationException("You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); 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; + return TestResult.Inconclusive; } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 5b95f2928..3fd2ccd96 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -142,26 +142,19 @@ private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - var result = new TestResult(); - var signatureBuilder = this.ExampleSignatureBuilder; + var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - if (signatureBuilder == null) - { - throw new InvalidOperationException("You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); 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; + return TestResult.Inconclusive; } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs index ec15d4aa1..c1004311f 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; @@ -63,5 +65,19 @@ protected TestResult DetermineAggregateResult(IEnumerable exampleRes return this.GetAggregateResult(passedCount, failedCount, skippedCount); } + + protected Regex CreateSignatureRegex(ScenarioOutline scenarioOutline, string[] exampleValues) + { + var signatureBuilder = this.ExampleSignatureBuilder; + + if (signatureBuilder == null) + { + throw new InvalidOperationException( + "You need to set the ExampleSignatureBuilder before using GetExampleResult."); + } + + Regex signature = signatureBuilder.Build(scenarioOutline, exampleValues); + return signature; + } } } \ No newline at end of file From 9ed91c5868fca1293bc53737053c2ab7475c18df Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:15:01 +0100 Subject: [PATCH 024/132] Reorder methods --- .../XUnit/XUnit1/XUnit1SingleResult.cs | 35 +++++----- .../XUnit/XUnit2/XUnit2SingleResults.cs | 65 +++++++++---------- 2 files changed, 49 insertions(+), 51 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index dca921cf2..04ed4e294 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -72,6 +71,23 @@ public override TestResult GetScenarioResult(Scenario scenario) : TestResult.Inconclusive; } + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + { + var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); + + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); + + foreach (XElement exampleElement in exampleElements) + { + if (signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty))) + { + return this.GetResultFromElement(exampleElement); + } + } + + return TestResult.Inconclusive; + } + private XElement GetFeatureElement(Feature feature) { IEnumerable featureQuery = @@ -130,22 +146,5 @@ private TestResult GetResultFromElement(XElement element) return result; } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - foreach (XElement exampleElement in exampleElements) - { - if (signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty))) - { - return this.GetResultFromElement(exampleElement); - } - } - - return TestResult.Inconclusive; - } } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 3fd2ccd96..6f22a214b 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; @@ -72,6 +71,38 @@ public override TestResult GetScenarioResult(Scenario scenario) : TestResult.Inconclusive; } + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + { + var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); + + IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); + + foreach (var exampleElement in exampleElements) + { + if (signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty))) + { + return this.GetResultFromElement(exampleElement); + } + } + + return TestResult.Inconclusive; + } + + 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 assembliesAssemblyCollection GetFeatureElement(Feature feature) { var query = from collection in this.resultsDocument.assembly.collection @@ -104,21 +135,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; @@ -139,22 +155,5 @@ private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element return result; } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) - { - var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); - - foreach (var exampleElement in exampleElements) - { - if (signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty))) - { - return this.GetResultFromElement(exampleElement); - } - } - - return TestResult.Inconclusive; - } } } From 651cf1595248f5e66005bb515053734f961f65be Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:16:29 +0100 Subject: [PATCH 025/132] Make constructor of abstract class protected --- src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs index c282c233a..4edf071de 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs @@ -7,7 +7,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit public abstract class XUnitResultsBase : MultipleTestResults where TSingleResult : XUnitSingleResultsBase { - public XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) + protected XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); From 056c6eaf1ca594a66685a3c79a2eadc2d37c98b5 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:22:52 +0100 Subject: [PATCH 026/132] TestResult sanitizing --- .../ObjectModel/TestResult.cs | 81 +++++-------------- .../MultipleTestResults.cs | 12 +-- 2 files changed, 19 insertions(+), 74 deletions(-) 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.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index b90f19f29..a8fb75fd5 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -80,17 +80,7 @@ public TestResult GetFeatureResult(Feature feature) protected static TestResult EvaluateTestResults(TestResult[] results) { - if (results.Any(r => r == TestResult.Failed)) - { - return TestResult.Failed; - } - - if (results.Any(r => r == TestResult.Passed)) - { - return TestResult.Passed; - } - - return TestResult.Inconclusive; + return results.Merge(true); } public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) From 7956038b8e99a129ef2f2eb4a2c0a8ca07fd7d84 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:25:24 +0100 Subject: [PATCH 027/132] Reorder methods --- .../MultipleTestResults.cs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index a8fb75fd5..20b24f93c 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -50,30 +50,23 @@ protected MultipleTestResults(bool supportsExampleResults, IConfiguration config public abstract TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues); - private IEnumerable GetSingleTestResults(IConfiguration configuration) + public TestResult GetFeatureResult(Feature feature) { - ITestResults[] results; - - if (configuration.HasTestResults) - { - results = configuration.TestResultsFiles.Select(this.ConstructSingleTestResult).ToArray(); - } - else - { - results = new ITestResults[0]; - } + var results = this.TestResults.Select(tr => tr.GetFeatureResult(feature)).ToArray(); - return results; + return EvaluateTestResults(results); } - protected ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - return this.singleResultLoader.Load(fileInfo); + var results = this.TestResults.Select(tr => tr.GetScenarioOutlineResult(scenarioOutline)).ToArray(); + + return EvaluateTestResults(results); } - public TestResult GetFeatureResult(Feature feature) + public TestResult GetScenarioResult(Scenario scenario) { - var results = this.TestResults.Select(tr => tr.GetFeatureResult(feature)).ToArray(); + var results = this.TestResults.Select(tr => tr.GetScenarioResult(scenario)).ToArray(); return EvaluateTestResults(results); } @@ -83,18 +76,25 @@ protected static TestResult EvaluateTestResults(TestResult[] results) return results.Merge(true); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + protected ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) { - var results = this.TestResults.Select(tr => tr.GetScenarioOutlineResult(scenarioOutline)).ToArray(); - - return EvaluateTestResults(results); + return this.singleResultLoader.Load(fileInfo); } - public TestResult GetScenarioResult(Scenario scenario) + private IEnumerable GetSingleTestResults(IConfiguration configuration) { - var results = this.TestResults.Select(tr => tr.GetScenarioResult(scenario)).ToArray(); + ITestResults[] results; - return EvaluateTestResults(results); + if (configuration.HasTestResults) + { + results = configuration.TestResultsFiles.Select(this.ConstructSingleTestResult).ToArray(); + } + else + { + results = new ITestResults[0]; + } + + return results; } } } From c28c6a8c483136cc19d82971de442df834e50422 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:36:09 +0100 Subject: [PATCH 028/132] Extract ScenarioOutlineExampleIsMatch --- .../XUnit/XUnit1/XUnit1SingleResult.cs | 8 +++++++- .../XUnit/XUnit2/XUnit2SingleResults.cs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 04ed4e294..6a51da7ac 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -79,7 +80,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str foreach (XElement exampleElement in exampleElements) { - if (signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty))) + if (this.ScenarioOutlineExampleIsMatch(signature, exampleElement)) { return this.GetResultFromElement(exampleElement); } @@ -88,6 +89,11 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return TestResult.Inconclusive; } + private bool ScenarioOutlineExampleIsMatch(Regex signature, XElement exampleElement) + { + return signature.IsMatch(exampleElement.Attribute("name").Value.ToLowerInvariant().Replace(@"\", string.Empty)); + } + private XElement GetFeatureElement(Feature feature) { IEnumerable featureQuery = diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 6f22a214b..a569d6b5a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; @@ -79,7 +80,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str foreach (var exampleElement in exampleElements) { - if (signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty))) + if (ScenarioOutlineExampleIsMatch(signature, exampleElement)) { return this.GetResultFromElement(exampleElement); } @@ -88,6 +89,11 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return TestResult.Inconclusive; } + private static bool ScenarioOutlineExampleIsMatch(Regex signature, assembliesAssemblyCollectionTest exampleElement) + { + return signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty)); + } + private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) { return HasTraitWithValue(test, "Description", description); From bae6fa1ee67336f721ded27e6cc226f21410f4ce Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:42:46 +0100 Subject: [PATCH 029/132] Introduce IExampleSignatureBuilder --- .../Pickles.TestFrameworks.csproj | 1 + .../XUnit/IExampleSignatureBuilder.cs | 32 +++++++++++++++++++ .../XUnit/XUnitResultsBase.cs | 4 +-- .../XUnit/XUnitSingleResultsBase.cs | 2 +- .../XUnit/xUnitExampleSignatureBuilder.cs | 2 +- 5 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 768a00d2c..ffc236647 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -79,6 +79,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs new file mode 100644 index 000000000..cd07ffb59 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.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; +using System.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.XUnit +{ + public interface IExampleSignatureBuilder + { + Regex Build(ScenarioOutline scenarioOutline, string[] row); + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs index 4edf071de..2071a758f 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs @@ -7,13 +7,13 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit public abstract class XUnitResultsBase : MultipleTestResults where TSingleResult : XUnitSingleResultsBase { - protected XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) + protected XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } - public void SetExampleSignatureBuilder(XUnitExampleSignatureBuilder exampleSignatureBuilder) + public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) { foreach (var testResult in TestResults.OfType()) { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs index c1004311f..013ce6ef5 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs @@ -8,7 +8,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit { public abstract class XUnitSingleResultsBase : ITestResults { - internal XUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } + internal IExampleSignatureBuilder ExampleSignatureBuilder { get; set; } public abstract bool SupportsExampleResults { get; } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs index 0b09475f4..4a0e0f2be 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs @@ -26,7 +26,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit { - public class XUnitExampleSignatureBuilder + public class XUnitExampleSignatureBuilder : IExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { From 3ecad080fc31234369037d255585498e3efebcb6 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:44:16 +0100 Subject: [PATCH 030/132] Make SingleResultsBase non-xunit-specific --- .../XUnit/{XUnitSingleResultsBase.cs => SingleTestRunBase.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Pickles/Pickles.TestFrameworks/XUnit/{XUnitSingleResultsBase.cs => SingleTestRunBase.cs} (100%) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/SingleTestRunBase.cs similarity index 100% rename from src/Pickles/Pickles.TestFrameworks/XUnit/XUnitSingleResultsBase.cs rename to src/Pickles/Pickles.TestFrameworks/XUnit/SingleTestRunBase.cs From 35572b34e6d4ae3617dc53d7151109aaa171bd59 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:49:07 +0100 Subject: [PATCH 031/132] Make XUnit base classes non-xunit-specific --- .../{XUnit => }/IExampleSignatureBuilder.cs | 3 +-- .../XUnitResultsBase.cs => MultipleTestRunsBase.cs} | 12 ++++++------ .../Pickles.TestFrameworks.csproj | 6 +++--- .../{XUnit => }/SingleTestRunBase.cs | 8 ++++---- .../XUnit/XUnit1/XUnit1Results.cs | 2 +- .../XUnit/XUnit1/XUnit1SingleResult.cs | 2 +- .../XUnit/XUnit2/XUnit2Results.cs | 2 +- .../XUnit/XUnit2/XUnit2SingleResults.cs | 2 +- 8 files changed, 18 insertions(+), 19 deletions(-) rename src/Pickles/Pickles.TestFrameworks/{XUnit => }/IExampleSignatureBuilder.cs (95%) rename src/Pickles/Pickles.TestFrameworks/{XUnit/XUnitResultsBase.cs => MultipleTestRunsBase.cs} (58%) rename src/Pickles/Pickles.TestFrameworks/{XUnit => }/SingleTestRunBase.cs (95%) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs similarity index 95% rename from src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs rename to src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs index cd07ffb59..c04cd5fe3 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/IExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs @@ -18,12 +18,11 @@ // // -------------------------------------------------------------------------------------------------------------------- -using System; using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit +namespace PicklesDoc.Pickles.TestFrameworks { public interface IExampleSignatureBuilder { diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs similarity index 58% rename from src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs rename to src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 2071a758f..cb2ff721e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnitResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -2,12 +2,12 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit +namespace PicklesDoc.Pickles.TestFrameworks { - public abstract class XUnitResultsBase : MultipleTestResults - where TSingleResult : XUnitSingleResultsBase + public abstract class MultipleTestRunsBase : MultipleTestResults + where TSingleTestRun : SingleTestRunBase { - protected XUnitResultsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) + protected MultipleTestRunsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); @@ -15,7 +15,7 @@ protected XUnitResultsBase(IConfiguration configuration, ISingleResultLoader sin public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) { - foreach (var testResult in TestResults.OfType()) + foreach (var testResult in TestResults.OfType()) { testResult.ExampleSignatureBuilder = exampleSignatureBuilder; } @@ -23,7 +23,7 @@ public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignature public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); + var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); return EvaluateTestResults(results); } diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index ffc236647..bf80aa524 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -54,11 +54,13 @@ + + @@ -71,6 +73,7 @@ results-example-nunit3.xsd + @@ -79,7 +82,6 @@ - @@ -90,8 +92,6 @@ - - diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/SingleTestRunBase.cs b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs similarity index 95% rename from src/Pickles/Pickles.TestFrameworks/XUnit/SingleTestRunBase.cs rename to src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs index 013ce6ef5..83d6693bd 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/SingleTestRunBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs @@ -4,14 +4,14 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.XUnit +namespace PicklesDoc.Pickles.TestFrameworks { - public abstract class XUnitSingleResultsBase : ITestResults + public abstract class SingleTestRunBase : ITestResults { - internal IExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - public abstract bool SupportsExampleResults { get; } + internal IExampleSignatureBuilder ExampleSignatureBuilder { get; set; } + public abstract TestResult GetFeatureResult(Feature feature); public abstract TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index cc994d895..f7533881c 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnit1Results : XUnitResultsBase + public class XUnit1Results : MultipleTestRunsBase { public XUnit1Results( IConfiguration configuration, diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 6a51da7ac..957288874 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -28,7 +28,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnit1SingleResult : XUnitSingleResultsBase + public class XUnit1SingleResult : SingleTestRunBase { private readonly XDocument resultsDocument; diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 6e36fec1e..1355aeb16 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2Results : XUnitResultsBase + public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index a569d6b5a..98bd64f45 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2SingleResults : XUnitSingleResultsBase + public class XUnit2SingleResults : SingleTestRunBase { private readonly assemblies resultsDocument; From 7306170ee8d3afa1985a2fb56f74199d9e163eb2 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 13:49:40 +0100 Subject: [PATCH 032/132] Rename file --- .../Pickles.TestFrameworks/Pickles.TestFrameworks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index bf80aa524..f9fb1685f 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -84,7 +84,7 @@ - + From 7029ab8ea10ccb993074810f1df5f3614cdf9fa8 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:13:19 +0100 Subject: [PATCH 033/132] Make the nUnit3 classes use the new infrastructure --- .../NUnit3/NUnit3ExampleSignatureBuilder.cs | 2 +- .../NUnit3/NUnit3Results.cs | 23 +-- .../NUnit3/NUnit3SingleResult.cs | 165 ++++++++++-------- 3 files changed, 96 insertions(+), 94 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs index 8b6051fbe..411ff0e48 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs @@ -26,7 +26,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { - public class NUnit3ExampleSignatureBuilder + public class NUnit3ExampleSignatureBuilder : IExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs index a6cf8232b..22be9cf37 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs @@ -19,33 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { - public class NUnit3Results : MultipleTestResults + public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(NUnit3ExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, 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); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs index f9c162e49..2e95372c5 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 { - public class NUnit3SingleResult : ITestResults + public class NUnit3SingleResult : SingleTestRunBase { private readonly XDocument resultsDocument; @@ -36,14 +36,12 @@ public NUnit3SingleResult(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return true; } } - internal NUnit3ExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var featureElement = this.GetFeatureElement(feature); @@ -58,43 +56,94 @@ public TestResult GetFeatureResult(Feature feature) return results.Merge(); } - public TestResult GetScenarioResult(Scenario scenario) + public override 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)); - } + var scenarioElement = this.GetScenarioElement(scenario); return this.GetResultFromElement(scenarioElement); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); - XElement scenarioOutlineElement = null; + var scenarioOutlineElement = this.GetScenarioOutlineElement(scenarioOutline); + + return this.DetermineScenarioOutlineResult(scenarioOutlineElement); + } + + public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) + { + Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); + + var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); + + return this.GetResultFromElement(examplesElement); + } + + 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; + } + + 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 XElement GetScenarioElement(Scenario scenario) + { + XElement featureElement = this.GetFeatureElement(scenario.Feature); + XElement scenarioElement = 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)); + 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; + } + + private TestResult DetermineScenarioOutlineResult(XElement scenarioOutlineElement) + { if (scenarioOutlineElement != null) { return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); } - return this.GetResultFromElement(scenarioOutlineElement); + return TestResult.Inconclusive; + } + + private 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; } private XElement GetFeatureElement(Feature feature) @@ -145,62 +194,34 @@ private TestResult GetResultFromElement(XElement element) } } - 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) + private XElement GetExamplesElement( + ScenarioOutline scenarioOutline, + Regex exampleSignature) { 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)); + 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)); + 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(); + return examplesElement; } } } From e64b9a32106d56d7dc865ed8c2b91ad397469ea1 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:21:30 +0100 Subject: [PATCH 034/132] Make NUnit2 use the new infrastructure --- .../NUnit2/NUnitExampleSignatureBuilder.cs | 2 +- .../NUnit2/NUnitResults.cs | 23 +-- .../NUnit2/NUnitSingleResults.cs | 138 ++++++++++-------- 3 files changed, 80 insertions(+), 83 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs index bbd4bfda3..ad613b686 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitExampleSignatureBuilder.cs @@ -26,7 +26,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { - public class NUnitExampleSignatureBuilder + public class NUnitExampleSignatureBuilder : IExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs index 46a958265..14d4671db 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs @@ -19,33 +19,14 @@ // -------------------------------------------------------------------------------------------------------------------- using System; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { - public class NUnitResults : MultipleTestResults + public class NUnitResults : MultipleTestRunsBase { public NUnitResults(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader) - { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(NUnitExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, 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); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs index 1c15da9fe..3a455a7d8 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs @@ -27,10 +27,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 { - public class NUnitSingleResults : ITestResults + public class NUnitSingleResults : SingleTestRunBase { - internal NUnitExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - private readonly XDocument resultsDocument; public NUnitSingleResults(XDocument resultsDocument) @@ -38,12 +36,12 @@ public NUnitSingleResults(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return true; } } - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var featureElement = this.GetFeatureElement(feature); @@ -58,39 +56,92 @@ public TestResult GetFeatureResult(Feature feature) return results.Merge(); } - public TestResult GetScenarioResult(Scenario scenario) + 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) + { + Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); + + var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); + + return this.GetResultFromElement(examplesElement); + } + + 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; + } + + 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(); + } + + private 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); + scenarioElement = + featureElement.Descendants("test-case") + .Where(x => x.Attribute("description") != null) + .FirstOrDefault(x => x.Attribute("description").Value == scenario.Name); } - - return this.GetResultFromElement(scenarioElement); + return scenarioElement; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + private 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); + scenarioOutlineElement = + this.GetFeatureElement(scenarioOutline.Feature) + .Descendants("test-suite") + .Where(x => x.Attribute("description") != null) + .FirstOrDefault(x => x.Attribute("description").Value == scenarioOutline.Name); } + return scenarioOutlineElement; + } + + private TestResult DetermineScenarioOutlineResult(XElement scenarioOutlineElement) + { if (scenarioOutlineElement != null) { return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); } - return this.GetResultFromElement(scenarioOutlineElement); + return TestResult.Inconclusive; } private XElement GetFeatureElement(Feature feature) @@ -138,59 +189,24 @@ private TestResult GetResultFromElement(XElement element) } } - 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) + private XElement GetExamplesElement(ScenarioOutline scenarioOutline, Regex exampleSignature) { 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)); + var parameterizedTestElement = + featureElement.Descendants("test-suite") + .FirstOrDefault(x => IsMatchingParameterizedTestElement(x, scenarioOutline)); if (parameterizedTestElement != null) { - examplesElement = parameterizedTestElement.Descendants("test-case") - .FirstOrDefault(x => IsMatchingTestCase(x, exampleSignature)); + 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(); + return examplesElement; } } } From 9aaf99e68e6970d2fbf51707a8fc3809673420f0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:25:40 +0100 Subject: [PATCH 035/132] Reorganize NUnit files --- ...erminingTheSignatureOfAnNUnitExampleRow.cs | 4 +- ...tipleNUnitResultsFilesForASingleFeature.cs | 4 +- .../NUnit2/WhenParsingNUnitResultsFile.cs | 14 +- ...arsingProblematicScenarioOutlineResults.cs | 6 +- ...rsingnUnit2ResultsFileWithMissingTraits.cs | 4 +- ...rminingTheSignatureOfAnNunit3ExampleRow.cs | 2 +- .../NUnit3/WhenParsingNunit3ResultsFile.cs | 2 +- ...rsingnUnit3ResultsFileWithMissingTraits.cs | 2 +- .../WhenResolvingTestResults.cs | 8 +- .../NUnit2/NUnit2Results.cs} | 8 +- .../NUnit2/NUnit2SingleResultLoader.cs | 4 +- .../NUnit2/NUnit2SingleResults.cs} | 8 +- .../{ => NUnit}/NUnit3/NUnit3Results.cs | 4 +- .../{ => NUnit}/NUnit3/NUnit3SingleResult.cs | 2 +- .../NUnit3/NUnit3SingleResultLoader.cs | 2 +- .../NUnit3/results-example-nunit3.cs | 1381 +++++++++-------- .../NUnit3/results-example-nunit3.xsd | 0 .../NUnitExampleSignatureBuilder.cs | 3 +- .../NUnit3/NUnit3ExampleSignatureBuilder.cs | 46 - .../Pickles.TestFrameworks.csproj | 19 +- src/Pickles/Pickles/PicklesModule.cs | 10 +- 21 files changed, 743 insertions(+), 790 deletions(-) rename src/Pickles/Pickles.TestFrameworks/{NUnit2/NUnitResults.cs => NUnit/NUnit2/NUnit2Results.cs} (75%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit2/NUnit2SingleResultLoader.cs (90%) rename src/Pickles/Pickles.TestFrameworks/{NUnit2/NUnitSingleResults.cs => NUnit/NUnit2/NUnit2SingleResults.cs} (96%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit3/NUnit3Results.cs (89%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit3/NUnit3SingleResult.cs (99%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit3/NUnit3SingleResultLoader.cs (96%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit3/results-example-nunit3.cs (77%) rename src/Pickles/Pickles.TestFrameworks/{ => NUnit}/NUnit3/results-example-nunit3.xsd (100%) rename src/Pickles/Pickles.TestFrameworks/{NUnit2 => NUnit}/NUnitExampleSignatureBuilder.cs (96%) delete mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs index 1e208a657..619f1f8b3 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { @@ -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 = Container.Resolve(); 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/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs index 76694f538..9940c11dd 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs @@ -25,12 +25,12 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.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") diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs index 3cbe23ffd..861894fce 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs @@ -25,12 +25,12 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { [TestFixture] - public class WhenParsingNUnitResultsFile : WhenParsingTestResultFiles + public class WhenParsingNUnitResultsFile : WhenParsingTestResultFiles { public WhenParsingNUnitResultsFile() : base("NUnit2." + "results-example-nunit.xml") @@ -200,7 +200,7 @@ public void ThenCanReadNotFoundFeatureCorrectly() public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -223,7 +223,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -246,7 +246,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_Shou public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -269,7 +269,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -301,7 +301,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs index 46ff7cfe0..f3c57ac2c 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs @@ -25,12 +25,12 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { [TestFixture] - public class WhenParsingProblematicScenarioOutlineResults : WhenParsingTestResultFiles + public class WhenParsingProblematicScenarioOutlineResults : WhenParsingTestResultFiles { public WhenParsingProblematicScenarioOutlineResults() : base("NUnit2." + "results-problem-with-outline-results-nunit.xml") @@ -41,7 +41,7 @@ public WhenParsingProblematicScenarioOutlineResults() public void ThenCanReadIndividualResultsFromScenarioOutline_ContainingDollarSigns_ShouldBeTestResultSuccess() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder()); + results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "ExampleWebFeature" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs index 10ad976a2..e78b33bfe 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs @@ -25,12 +25,12 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { [TestFixture] - public class WhenParsingnUnit2ResultsFileWithMissingTraits : WhenParsingTestResultFiles + public class WhenParsingnUnit2ResultsFileWithMissingTraits : WhenParsingTestResultFiles { public WhenParsingnUnit2ResultsFileWithMissingTraits() : base("NUnit2." + "results-example-nunit-missingTraits.xml") diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs index 68f8aa9d3..e372d7e0b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs index ce4a1c759..2551371ff 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs index f8b6f92cd..1b8ba6fc1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs @@ -25,7 +25,7 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit3 { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index b7384dde6..a4965bc36 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -30,7 +30,7 @@ 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.SpecRun; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; @@ -86,9 +86,9 @@ 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); } @@ -185,7 +185,7 @@ public void ThenCanResolveWhenTestResultsAreNUnit() var item = Container.Resolve(); Check.That(item).IsNotNull(); - Check.That(item).IsInstanceOf(); + Check.That(item).IsInstanceOf(); } [Test] diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs similarity index 75% rename from src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index 14d4671db..3d60569c5 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -20,11 +20,11 @@ using System; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnitResults : MultipleTestRunsBase + public class NUnit2Results : MultipleTestRunsBase { - public NUnitResults(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) + public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, singleResultLoader, exampleSignatureBuilder) { } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs similarity index 90% rename from src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs index 002c37727..4766c2485 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs @@ -23,7 +23,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { public class NUnit2SingleResultLoader : ISingleResultLoader { @@ -31,7 +31,7 @@ public class NUnit2SingleResultLoader : ISingleResultLoader public ITestResults Load(FileInfoBase fileInfo) { - return new NUnitSingleResults(this.documentLoader.Load(fileInfo)); + return new NUnit2SingleResults(this.documentLoader.Load(fileInfo)); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs index 3a455a7d8..06ea04e10 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit2/NUnitSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -25,13 +25,13 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnitSingleResults : SingleTestRunBase + public class NUnit2SingleResults : SingleTestRunBase { private readonly XDocument resultsDocument; - public NUnitSingleResults(XDocument resultsDocument) + public NUnit2SingleResults(XDocument resultsDocument) { this.resultsDocument = resultsDocument; } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs similarity index 89% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 22be9cf37..f9cf2aa2d 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -20,11 +20,11 @@ using System; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { public class NUnit3Results : MultipleTestRunsBase { - public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnit3ExampleSignatureBuilder exampleSignatureBuilder) + public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(configuration, singleResultLoader, exampleSignatureBuilder) { } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs similarity index 99% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs index 2e95372c5..717a32509 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs @@ -25,7 +25,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { public class NUnit3SingleResult : SingleTestRunBase { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs rename to src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs index 20008a25c..cfe61381c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs @@ -23,7 +23,7 @@ using PicklesDoc.Pickles.ObjectModel; -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { public class NUnit3SingleResultLoader : ISingleResultLoader { 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 ad613b686..f503e03ac 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 : IExampleSignatureBuilder { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs deleted file mode 100644 index 411ff0e48..000000000 --- a/src/Pickles/Pickles.TestFrameworks/NUnit3/NUnit3ExampleSignatureBuilder.cs +++ /dev/null @@ -1,46 +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.Text; -using System.Text.RegularExpressions; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.NUnit3 -{ - public class NUnit3ExampleSignatureBuilder : IExampleSignatureBuilder - { - 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); - - return new Regex(stringBuilder.ToString()); - } - } -} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index f9fb1685f..b079e2aa9 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -61,15 +61,14 @@ - - - - - - - - - + + + + + + + + results-example-nunit3.xsd @@ -94,7 +93,7 @@ - + Designer diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 13d8aa5e3..de2c78398 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -31,8 +31,8 @@ using PicklesDoc.Pickles.TestFrameworks; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using PicklesDoc.Pickles.TestFrameworks.MsTest; -using PicklesDoc.Pickles.TestFrameworks.NUnit2; -using PicklesDoc.Pickles.TestFrameworks.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; @@ -76,9 +76,9 @@ protected override void Load(ContainerBuilder builder) } }).SingleInstance(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); @@ -105,7 +105,7 @@ protected override void Load(ContainerBuilder builder) switch (configuration.TestResultsFormat) { case TestResultsFormat.NUnit: - return c.Resolve(); + return c.Resolve(); case TestResultsFormat.NUnit3: return c.Resolve(); case TestResultsFormat.XUnit: From 45cd8695806eb99a3e0fe9e76084c1ffc0df08e0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:40:23 +0100 Subject: [PATCH 036/132] Addendum to NUnit changes --- .../NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs | 4 ++-- .../NUnit2/WhenParsingNUnitResultsFile.cs | 5 ----- .../NUnit2/WhenParsingProblematicScenarioOutlineResults.cs | 1 - .../WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs | 4 ++-- .../NUnit3/WhenParsingNunit3ResultsFile.cs | 5 ----- src/Pickles/Pickles/PicklesModule.cs | 4 ++-- 6 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs index 619f1f8b3..357251766 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { @@ -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 = Container.Resolve(); 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/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs index 861894fce..7d28a04d4 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs @@ -200,7 +200,6 @@ public void ThenCanReadNotFoundFeatureCorrectly() public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -223,7 +222,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -246,7 +244,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_Shou public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -269,7 +266,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -301,7 +297,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs index f3c57ac2c..2e5a10340 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs @@ -41,7 +41,6 @@ public WhenParsingProblematicScenarioOutlineResults() public void ThenCanReadIndividualResultsFromScenarioOutline_ContainingDollarSigns_ShouldBeTestResultSuccess() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit2ExampleSignatureBuilder()); var feature = new Feature { Name = "ExampleWebFeature" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs index e372d7e0b..ef6d90954 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs @@ -29,7 +29,7 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.Test; -using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; +using PicklesDoc.Pickles.TestFrameworks.NUnit; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 { @@ -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 = Container.Resolve(); 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/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs index 2551371ff..8a1786d3b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -136,7 +136,6 @@ public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -159,7 +158,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -182,7 +180,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_Shou public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -205,7 +202,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -237,7 +233,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new NUnit3ExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index de2c78398..321747ea4 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -31,6 +31,7 @@ using PicklesDoc.Pickles.TestFrameworks; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using PicklesDoc.Pickles.TestFrameworks.MsTest; +using PicklesDoc.Pickles.TestFrameworks.NUnit; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; @@ -78,10 +79,9 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From 9bb737c048ef0ca6ad2e97e64f8a68b9f7302ef1 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:41:02 +0100 Subject: [PATCH 037/132] Make MsTest use the new infrastructure --- ...WithMetaInfoAndTestResultInMstestFormat.cs | 2 +- .../MsTest/MsTestExampleSignatureBuilder.cs | 35 +++++++++++++++++++ .../MsTest/MsTestResults.cs | 13 ++----- .../MsTest/MsTestSingleResults.cs | 12 +++---- .../Pickles.TestFrameworks.csproj | 1 + src/Pickles/Pickles/PicklesModule.cs | 1 + 6 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs b/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs index 38695a929..51bbb33d6 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, new MsTestSingleResultLoader()); + ITestResults testResults = new MsTestResults(configuration, new MsTestSingleResultLoader(), new MsTestExampleSignatureBuilder()); var jsonDocumentationBuilder = new JsonDocumentationBuilder(configuration, testResults, FileSystem); jsonDocumentationBuilder.Build(features); string content = FileSystem.File.ReadAllText(filePath); diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs new file mode 100644 index 000000000..392576be1 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.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.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.MsTest +{ + public class MsTestExampleSignatureBuilder : IExampleSignatureBuilder + { + public Regex Build(ScenarioOutline scenarioOutline, string[] row) + { + throw new NotSupportedException(); + } + } +} \ 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 ce84abed5..0ffa78256 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -20,20 +20,13 @@ using System; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestResults : MultipleTestResults + public class MsTestResults : MultipleTestRunsBase { - public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader) - : base(false, configuration, singleResultLoader) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, exampleSignatureBuilder) { - throw new NotSupportedException(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 488c81c35..efe11c277 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestSingleResults : ITestResults + public class MsTestSingleResults : SingleTestRunBase { private const string Failed = "failed"; @@ -39,7 +39,7 @@ public MsTestSingleResults(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return false; } } @@ -89,12 +89,12 @@ private static Guid ResultExecutionIdOf(XElement unitTestResult) return executionIdAttribute != null ? new Guid(executionIdAttribute.Value) : Guid.Empty; } - public TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { throw new NotSupportedException(); } - public TestResult GetFeatureResult(Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var featureExecutionIds = from scenario in this.AllScenariosInResultFile() @@ -108,7 +108,7 @@ where FeatureNamePropertyExistsWith(feature.Name, among: properties) return result; } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { var queriedFeatureName = scenarioOutline.Feature.Name; var queriedScenarioOutlineName = scenarioOutline.Name; @@ -129,7 +129,7 @@ where NameOf(scenario).StartsWith(queriedScenarioOutlineName) return result; } - public TestResult GetScenarioResult(Scenario scenario) + public override TestResult GetScenarioResult(Scenario scenario) { Guid scenarioExecutionId = this.GetScenarioExecutionId(scenario); return this.GetExecutionResult(scenarioExecutionId); diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index b079e2aa9..1df40505c 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -56,6 +56,7 @@ + diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 321747ea4..4033fdaad 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -89,6 +89,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From f9d5c25ed6f186407ecb1237699a7ae443dbfac7 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:41:28 +0100 Subject: [PATCH 038/132] Make CucumberJson use new infrastructure --- .../CucumberJsonExampleSignatureBuilder.cs | 35 +++++++++++++++++++ .../CucumberJson/CucumberJsonResults.cs | 13 ++----- .../CucumberJson/CucumberJsonSingleResults.cs | 16 ++++----- .../Pickles.TestFrameworks.csproj | 1 + src/Pickles/Pickles/PicklesModule.cs | 1 + 5 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs new file mode 100644 index 000000000..a648d3e3d --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.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.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson +{ + public class CucumberJsonExampleSignatureBuilder : IExampleSignatureBuilder + { + public Regex Build(ScenarioOutline scenarioOutline, string[] row) + { + throw new NotSupportedException(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index dd1fac32b..30f39ccce 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -20,20 +20,13 @@ using System; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonResults : MultipleTestResults + public class CucumberJsonResults : MultipleTestRunsBase { - public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) - : base(false, configuration, singleResultLoader) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, exampleSignatureBuilder) { - throw new NotSupportedException(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 33b73524e..ece093c60 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -32,7 +32,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonSingleResults : ITestResults + public class CucumberJsonSingleResults : SingleTestRunBase { private readonly List resultsDocument; @@ -41,29 +41,29 @@ public CucumberJsonSingleResults(FileInfoBase configuration) this.resultsDocument = this.ReadResultsFile(configuration); } - public bool SupportsExampleResults + public override bool SupportsExampleResults { get { return false; } } - public TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { throw new NotSupportedException(); } - public TestResult GetFeatureResult(ObjectModel.Feature feature) + public override TestResult GetFeatureResult(ObjectModel.Feature feature) { var cucumberFeature = this.GetFeatureElement(feature); return this.GetResultFromFeature(cucumberFeature); } - public TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { // Not applicable - return new TestResult(); + return TestResult.Inconclusive; } - public TestResult GetScenarioResult(Scenario scenario) + public override TestResult GetScenarioResult(Scenario scenario) { Parser.JsonResult.Element cucumberScenario = null; var cucumberFeature = this.GetFeatureElement(scenario.Feature); @@ -106,7 +106,7 @@ private TestResult GetResultFromScenario(Parser.JsonResult.Element cucumberScena return wasSuccessful ? TestResult.Passed : TestResult.Failed; } - private static bool CheckScenarioStatus(Parser.JsonResult.Element cucumberScenario) + private bool CheckScenarioStatus(Parser.JsonResult.Element cucumberScenario) { return cucumberScenario.steps.All(x => x.result.status == "passed"); } diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 1df40505c..1f5097299 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -45,6 +45,7 @@ + diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 4033fdaad..a3e37e90b 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -92,6 +92,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From 4baec66bab865ea3816a2968ad8d850210767b5c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:48:32 +0100 Subject: [PATCH 039/132] Make SpecRun use the new infrastructure --- .../Pickles.TestFrameworks.csproj | 1 + .../SpecRun/SpecRunExampleSignatureBuilder.cs | 35 +++++++++++++++++++ .../SpecRun/SpecRunResults.cs | 13 ++----- .../SpecRun/SpecRunSingleResults.cs | 33 +++++------------ src/Pickles/Pickles/PicklesModule.cs | 1 + 5 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 1f5097299..a0ba645ae 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -78,6 +78,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs new file mode 100644 index 000000000..4a52e7500 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.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.Text.RegularExpressions; + +using PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.SpecRun +{ + public class SpecRunExampleSignatureBuilder : IExampleSignatureBuilder + { + public Regex Build(ScenarioOutline scenarioOutline, string[] row) + { + throw new NotSupportedException(); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index c354ee867..b7b2ce167 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -20,20 +20,13 @@ using System; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunResults : MultipleTestResults + public class SpecRunResults : MultipleTestRunsBase { - public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader) - : base(false, configuration, singleResultLoader) - { - } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) + : base(configuration, singleResultLoader, exampleSignatureBuilder) { - throw new NotSupportedException(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs index ab2c33879..089f3ddaf 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -32,7 +32,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunSingleResults : ITestResults + public class SpecRunSingleResults : SingleTestRunBase { private readonly List specRunFeatures; @@ -44,13 +44,13 @@ public SpecRunSingleResults(FileInfoBase fileInfo) resultsDocument.Descendants("feature").Select(Parser.SpecRun.Factory.ToSpecRunFeature).ToList(); } - public TestResult GetFeatureResult(ObjectModel.Feature feature) + public override bool SupportsExampleResults { - if (this.specRunFeatures == null) - { - return TestResult.Inconclusive; - } + get { return false; } + } + public override TestResult GetFeatureResult(ObjectModel.Feature feature) + { var specRunFeature = this.FindSpecRunFeature(feature); if (specRunFeature == null) @@ -64,13 +64,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) @@ -90,13 +85,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,16 +104,11 @@ 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(); } - public bool SupportsExampleResults - { - get { return false; } - } - private static TestResult StringsToTestResult(IEnumerable results) { if (results == null) diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index a3e37e90b..f7451aff7 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -95,6 +95,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.Register(c => { From 868bdb9f31c7ee9b926016ca11a34a6932ed9dc4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:55:48 +0100 Subject: [PATCH 040/132] Correctly propagate the SupportsExampleResults value --- .../CucumberJson/CucumberJsonResults.cs | 2 +- src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs | 2 +- src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs | 4 ++-- .../Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs | 2 +- .../Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs | 2 +- src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 30f39ccce..32b911a9c 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson public class CucumberJsonResults : MultipleTestRunsBase { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(false, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 0ffa78256..db346e9b0 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(false, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index cb2ff721e..956c5d0e5 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -7,8 +7,8 @@ namespace PicklesDoc.Pickles.TestFrameworks public abstract class MultipleTestRunsBase : MultipleTestResults where TSingleTestRun : SingleTestRunBase { - protected MultipleTestRunsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader) + protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) + : base(supportsExampleResults, configuration, singleResultLoader) { this.SetExampleSignatureBuilder(exampleSignatureBuilder); } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index 3d60569c5..60218f4c2 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 public class NUnit2Results : MultipleTestRunsBase { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index f9cf2aa2d..8317838d4 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index b7b2ce167..06e69d16e 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(false, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index f7533881c..ba413954f 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -28,7 +28,7 @@ public XUnit1Results( IConfiguration configuration, XUnit1SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 1355aeb16..85c50d5ff 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } From 1a36eb34a3c6db14d6402a39235cc76a65285294 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 14:58:16 +0100 Subject: [PATCH 041/132] Mock the base class instead of the interface --- .../SpecRun/WhenParsingMultipleTestResultsTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index e36ea0453..f4acb5318 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -68,9 +68,9 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e } } - 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; } From 10e6482571c62e5f2916c391d3f4c367052fcea9 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:02:59 +0100 Subject: [PATCH 042/132] Use SingleTestRunBase instead of ITestResults --- .../SpecRun/WhenParsingMultipleTestResultsTests.cs | 12 ++++++------ .../CucumberJson/CucumberJsonSingleResultLoader.cs | 2 +- .../Pickles.TestFrameworks/ISingleResultLoader.cs | 2 +- .../MsTest/MsTestSingleResultLoader.cs | 2 +- .../Pickles.TestFrameworks/MultipleTestResults.cs | 12 ++++++------ .../NUnit/NUnit2/NUnit2SingleResultLoader.cs | 2 +- .../NUnit/NUnit3/NUnit3SingleResultLoader.cs | 2 +- .../SpecRun/SpecRunSingleResultLoader.cs | 2 +- .../XUnit/XUnit1/XUnit1SingleResultLoader.cs | 2 +- .../XUnit/XUnit2/XUnit2SingleResultLoader.cs | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index f4acb5318..96a486688 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -50,14 +50,14 @@ public void GetFeatureResult_OnePassingOneInconclusive_ReturnsPassed() Check.That(result).IsEqualTo(TestResult.Passed); } - private static MultipleTestResults CreateMultipleTestResults(ITestResults testResults1, ITestResults testResults2) + private static MultipleTestResults CreateMultipleTestResults(SingleTestRunBase testResults1, SingleTestRunBase testResults2) { return new TestableMultipleTestResults(new[] { testResults1, testResults2 }); } private class TestableMultipleTestResults : MultipleTestResults { - public TestableMultipleTestResults(IEnumerable testResults) + public TestableMultipleTestResults(IEnumerable testResults) : base(false, testResults) { } @@ -120,9 +120,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; } @@ -172,9 +172,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/CucumberJson/CucumberJsonSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs index 2962da764..9b9e0d9b9 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonSingleResultLoader : ISingleResultLoader { - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new CucumberJsonSingleResults(fileInfo); } diff --git a/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs index 8b55c264a..106051444 100644 --- a/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/ISingleResultLoader.cs @@ -6,6 +6,6 @@ namespace PicklesDoc.Pickles.TestFrameworks { public interface ISingleResultLoader { - ITestResults Load(FileInfoBase fileInfo); + SingleTestRunBase Load(FileInfoBase fileInfo); } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs index 7624eb346..e95817c43 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs @@ -29,7 +29,7 @@ public class MsTestSingleResultLoader : ISingleResultLoader { private readonly XDocumentLoader documentLoader = new XDocumentLoader(); - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new MsTestSingleResults(this.documentLoader.Load(fileInfo)); } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index 20b24f93c..0af418dc1 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -31,7 +31,7 @@ public abstract class MultipleTestResults : ITestResults { private readonly ISingleResultLoader singleResultLoader; - protected MultipleTestResults(bool supportsExampleResults, IEnumerable testResults) + protected MultipleTestResults(bool supportsExampleResults, IEnumerable testResults) { this.SupportsExampleResults = supportsExampleResults; this.TestResults = testResults; @@ -46,7 +46,7 @@ protected MultipleTestResults(bool supportsExampleResults, IConfiguration config public bool SupportsExampleResults { get; } - protected IEnumerable TestResults { get; } + protected IEnumerable TestResults { get; } public abstract TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues); @@ -76,14 +76,14 @@ protected static TestResult EvaluateTestResults(TestResult[] results) return results.Merge(true); } - protected ITestResults ConstructSingleTestResult(FileInfoBase fileInfo) + protected SingleTestRunBase ConstructSingleTestResult(FileInfoBase fileInfo) { return this.singleResultLoader.Load(fileInfo); } - private IEnumerable GetSingleTestResults(IConfiguration configuration) + private IEnumerable GetSingleTestResults(IConfiguration configuration) { - ITestResults[] results; + SingleTestRunBase[] results; if (configuration.HasTestResults) { @@ -91,7 +91,7 @@ private IEnumerable GetSingleTestResults(IConfiguration configurat } else { - results = new ITestResults[0]; + results = new SingleTestRunBase[0]; } return results; diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs index 4766c2485..f30861e2f 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs @@ -29,7 +29,7 @@ public class NUnit2SingleResultLoader : ISingleResultLoader { private readonly XDocumentLoader documentLoader = new XDocumentLoader(); - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new NUnit2SingleResults(this.documentLoader.Load(fileInfo)); } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs index cfe61381c..9f2fccd6c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResultLoader.cs @@ -29,7 +29,7 @@ public class NUnit3SingleResultLoader : ISingleResultLoader { private readonly XDocumentLoader documentLoader = new XDocumentLoader(); - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new NUnit3SingleResult(this.documentLoader.Load(fileInfo)); } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs index 49b7817d8..4ea00a23d 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs @@ -27,7 +27,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { public class SpecRunSingleResultLoader : ISingleResultLoader { - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new SpecRunSingleResults(fileInfo); } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs index d000d9450..6b9bae8a9 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -29,7 +29,7 @@ public class XUnit1SingleResultLoader : ISingleResultLoader { private readonly XDocumentLoader documentLoader = new XDocumentLoader(); - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new XUnit1SingleResult(this.documentLoader.Load(fileInfo)); } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs index 220ea9bee..a530b5279 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResultLoader.cs @@ -29,7 +29,7 @@ public class XUnit2SingleResultLoader : ISingleResultLoader { private readonly XmlDeserializer xmlDeserializer = new XmlDeserializer(); - public ITestResults Load(FileInfoBase fileInfo) + public SingleTestRunBase Load(FileInfoBase fileInfo) { return new XUnit2SingleResults(this.xmlDeserializer.Load(fileInfo)); } From caafae03e6e6ce1ab7da89ff43de75dcba3129e4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:03:54 +0100 Subject: [PATCH 043/132] Remove generic parameter --- .../CucumberJson/CucumberJsonResults.cs | 2 +- src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs | 2 +- src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs | 7 +++---- .../Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs | 2 +- .../Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs | 2 +- .../Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 32b911a9c..ac8a60992 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonResults : MultipleTestRunsBase + public class CucumberJsonResults : MultipleTestRunsBase { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index db346e9b0..66583aac3 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestResults : MultipleTestRunsBase + public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 956c5d0e5..6a8c99d81 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -4,8 +4,7 @@ namespace PicklesDoc.Pickles.TestFrameworks { - public abstract class MultipleTestRunsBase : MultipleTestResults - where TSingleTestRun : SingleTestRunBase + public abstract class MultipleTestRunsBase : MultipleTestResults { protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) : base(supportsExampleResults, configuration, singleResultLoader) @@ -15,7 +14,7 @@ protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration confi public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) { - foreach (var testResult in TestResults.OfType()) + foreach (var testResult in this.TestResults) { testResult.ExampleSignatureBuilder = exampleSignatureBuilder; } @@ -23,7 +22,7 @@ public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignature public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) { - var results = TestResults.OfType().Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); + var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); return EvaluateTestResults(results); } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index 60218f4c2..f6356981c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnit2Results : MultipleTestRunsBase + public class NUnit2Results : MultipleTestRunsBase { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 8317838d4..8393f1362 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { - public class NUnit3Results : MultipleTestRunsBase + public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 06e69d16e..cfe1a7cac 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunResults : MultipleTestRunsBase + public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index ba413954f..32092eaf0 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnit1Results : MultipleTestRunsBase + public class XUnit1Results : MultipleTestRunsBase { public XUnit1Results( IConfiguration configuration, diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 85c50d5ff..058c9b3bd 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2Results : MultipleTestRunsBase + public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) From cc8286b21393236da32695b4fbfa434d788233ed Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:05:23 +0100 Subject: [PATCH 044/132] :lipstick: remove unused using --- .../NUnit/NUnit2/NUnit2SingleResultLoader.cs | 2 -- .../XUnit/XUnit1/XUnit1SingleResultLoader.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs index f30861e2f..4eae740b3 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResultLoader.cs @@ -21,8 +21,6 @@ using System; using System.IO.Abstractions; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { public class NUnit2SingleResultLoader : ISingleResultLoader diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs index 6b9bae8a9..0c1191bf4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResultLoader.cs @@ -21,8 +21,6 @@ using System; using System.IO.Abstractions; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { public class XUnit1SingleResultLoader : ISingleResultLoader From a33d6c8c92f99ade3700c3bdfc011d72e20470dc Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:11:37 +0100 Subject: [PATCH 045/132] Remove public setter method for ExampleSignatureBuilder --- .../NUnit2/WhenParsingNUnitResultsFile.cs | 13 ------------ .../NUnit3/WhenParsingNunit3ResultsFile.cs | 13 ------------ .../XUnit1/WhenParsingxUnitResultsFile.cs | 18 ----------------- .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 6 ------ .../MultipleTestRunsBase.cs | 20 ++++++++++++------- 5 files changed, 13 insertions(+), 57 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs index 7d28a04d4..18c380ac3 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs @@ -68,19 +68,6 @@ public void ThenCanReadScenarioOutlineResultSuccessfully() 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() { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs index 8a1786d3b..91ef10a05 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -119,19 +119,6 @@ public void ThenCanReadNotFoundScenarioCorrectly() 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() { diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs index de2cf409a..a10c52bc4 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs @@ -120,24 +120,10 @@ public void ThenCanReadNotFoundScenarioCorrectly() 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" }; @@ -160,7 +146,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -183,7 +168,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -206,7 +190,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -238,7 +221,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs index 627508658..dacacae84 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -135,7 +135,6 @@ public void ThenCanReadNotFoundFeatureCorrectly() public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(null); var feature = new Feature { Name = "Addition" }; @@ -148,7 +147,6 @@ public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -171,7 +169,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTest public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -194,7 +191,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -217,7 +213,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTe public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; @@ -249,7 +244,6 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSecti public void ThenCanReadResultsWithBackslashes() { var results = ParseResultsFile(); - results.SetExampleSignatureBuilder(new XUnitExampleSignatureBuilder()); var feature = new Feature { Name = "Scenario Outlines" }; diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 6a8c99d81..01188dcd6 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -9,15 +10,12 @@ public abstract class MultipleTestRunsBase : MultipleTestResults protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) : base(supportsExampleResults, configuration, singleResultLoader) { - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in this.TestResults) + if (exampleSignatureBuilder == null) { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; + throw new ArgumentNullException(nameof(exampleSignatureBuilder)); } + + this.SetExampleSignatureBuilder(exampleSignatureBuilder); } public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) @@ -26,5 +24,13 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return EvaluateTestResults(results); } + + private void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) + { + foreach (var testResult in this.TestResults) + { + testResult.ExampleSignatureBuilder = exampleSignatureBuilder; + } + } } } \ No newline at end of file From 65744b45122965fba8cab15aea9a21fbf2281bcb Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:17:30 +0100 Subject: [PATCH 046/132] Merge MultipleTestRunsBase into MultipleTestResults --- .../WhenParsingMultipleTestResultsTests.cs | 5 --- .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 12 ------- .../CucumberJson/CucumberJsonResults.cs | 2 +- .../MsTest/MsTestResults.cs | 2 +- .../MultipleTestResults.cs | 31 ++++++++++++++-- .../MultipleTestRunsBase.cs | 36 ------------------- .../NUnit/NUnit2/NUnit2Results.cs | 2 +- .../NUnit/NUnit3/NUnit3Results.cs | 2 +- .../Pickles.TestFrameworks.csproj | 1 - .../SpecRun/SpecRunResults.cs | 2 +- .../XUnit/XUnit1/XUnit1Results.cs | 2 +- .../XUnit/XUnit2/XUnit2Results.cs | 2 +- 12 files changed, 36 insertions(+), 63 deletions(-) delete mode 100644 src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index 96a486688..f8e079965 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -61,11 +61,6 @@ public TestableMultipleTestResults(IEnumerable testResults) : base(false, testResults) { } - - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) - { - throw new NotSupportedException(); - } } private static Mock SetupStubForGetFeatureResult(Feature feature, TestResult resultOfGetFeatureResult) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs index dacacae84..3e4d080e6 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -131,18 +131,6 @@ public void ThenCanReadNotFoundFeatureCorrectly() Check.That(result).IsEqualTo(TestResult.Inconclusive); } - [Test] - public void WithoutExampleSignatureBuilderThrowsInvalidOperationException() - { - var results = ParseResultsFile(); - - 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() { diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index ac8a60992..0a1f9aeb0 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonResults : MultipleTestRunsBase + public class CucumberJsonResults : MultipleTestResults { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 66583aac3..7a9e4a958 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestResults : MultipleTestRunsBase + public class MsTestResults : MultipleTestResults { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs index 0af418dc1..fae22eddb 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs @@ -37,18 +37,45 @@ protected MultipleTestResults(bool supportsExampleResults, IEnumerable TestResults { get; } - public abstract TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues); + public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) + { + if (SupportsExampleResults) + { + var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); + + return EvaluateTestResults(results); + } + else + { + return TestResult.Passed; + } + } public TestResult GetFeatureResult(Feature feature) { diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs deleted file mode 100644 index 01188dcd6..000000000 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Linq; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks -{ - public abstract class MultipleTestRunsBase : MultipleTestResults - { - protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) - : base(supportsExampleResults, configuration, singleResultLoader) - { - if (exampleSignatureBuilder == null) - { - throw new ArgumentNullException(nameof(exampleSignatureBuilder)); - } - - this.SetExampleSignatureBuilder(exampleSignatureBuilder); - } - - public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) - { - var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - - return EvaluateTestResults(results); - } - - private void SetExampleSignatureBuilder(IExampleSignatureBuilder exampleSignatureBuilder) - { - foreach (var testResult in this.TestResults) - { - testResult.ExampleSignatureBuilder = exampleSignatureBuilder; - } - } - } -} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index f6356981c..8fca833c7 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnit2Results : MultipleTestRunsBase + public class NUnit2Results : MultipleTestResults { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 8393f1362..4e93b3f40 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { - public class NUnit3Results : MultipleTestRunsBase + public class NUnit3Results : MultipleTestResults { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index a0ba645ae..6b6cfdf47 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -62,7 +62,6 @@ - diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index cfe1a7cac..6b1466832 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunResults : MultipleTestRunsBase + public class SpecRunResults : MultipleTestResults { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 32092eaf0..7ef07ee2e 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnit1Results : MultipleTestRunsBase + public class XUnit1Results : MultipleTestResults { public XUnit1Results( IConfiguration configuration, diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 058c9b3bd..eef2530b2 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2Results : MultipleTestRunsBase + public class XUnit2Results : MultipleTestResults { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) From 56b41136264fc9046c71f179c061727ed7e50ecd Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 29 Jan 2016 15:18:32 +0100 Subject: [PATCH 047/132] Rename MultipleTestResults into MultipleTestRunsBase --- .../SpecRun/WhenParsingMultipleTestResultsTests.cs | 4 ++-- .../CucumberJson/CucumberJsonResults.cs | 2 +- .../Pickles.TestFrameworks/MsTest/MsTestResults.cs | 2 +- .../{MultipleTestResults.cs => MultipleTestRunsBase.cs} | 8 ++++---- .../Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs | 2 +- .../Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs | 2 +- .../Pickles.TestFrameworks/Pickles.TestFrameworks.csproj | 2 +- .../Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs | 2 +- .../Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) rename src/Pickles/Pickles.TestFrameworks/{MultipleTestResults.cs => MultipleTestRunsBase.cs} (90%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index f8e079965..007fe9dc0 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -50,12 +50,12 @@ public void GetFeatureResult_OnePassingOneInconclusive_ReturnsPassed() Check.That(result).IsEqualTo(TestResult.Passed); } - private static MultipleTestResults CreateMultipleTestResults(SingleTestRunBase testResults1, SingleTestRunBase 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) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 0a1f9aeb0..ac8a60992 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonResults : MultipleTestResults + public class CucumberJsonResults : MultipleTestRunsBase { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 7a9e4a958..66583aac3 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestResults : MultipleTestResults + public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs similarity index 90% rename from src/Pickles/Pickles.TestFrameworks/MultipleTestResults.cs rename to src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index fae22eddb..32201532d 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,17 +27,17 @@ namespace PicklesDoc.Pickles.TestFrameworks { - public abstract class MultipleTestResults : ITestResults + public abstract class MultipleTestRunsBase : ITestResults { private readonly ISingleResultLoader singleResultLoader; - protected MultipleTestResults(bool supportsExampleResults, IEnumerable testResults) + protected MultipleTestRunsBase(bool supportsExampleResults, IEnumerable testResults) { this.SupportsExampleResults = supportsExampleResults; this.TestResults = testResults; } - protected MultipleTestResults(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) + protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IExampleSignatureBuilder exampleSignatureBuilder) { if (exampleSignatureBuilder == null) { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index 8fca833c7..f6356981c 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnit2Results : MultipleTestResults + public class NUnit2Results : MultipleTestRunsBase { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 4e93b3f40..8393f1362 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { - public class NUnit3Results : MultipleTestResults + public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 6b6cfdf47..781bcb068 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -61,7 +61,7 @@ - + diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 6b1466832..cfe1a7cac 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunResults : MultipleTestResults + public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) : base(false, configuration, singleResultLoader, exampleSignatureBuilder) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 7ef07ee2e..32092eaf0 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1 { - public class XUnit1Results : MultipleTestResults + public class XUnit1Results : MultipleTestRunsBase { public XUnit1Results( IConfiguration configuration, diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index eef2530b2..058c9b3bd 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -22,7 +22,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { - public class XUnit2Results : MultipleTestResults + public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) : base(true, configuration, singleResultLoader, exampleSignatureBuilder) From d38939c0a081a1188a55ca66101c63d488dffccf Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 14:52:51 +0100 Subject: [PATCH 048/132] Remove unused using --- .../CucumberJson/CucumberJsonSingleResultLoader.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs index 9b9e0d9b9..52540f24f 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs @@ -21,8 +21,6 @@ using System; using System.IO.Abstractions; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonSingleResultLoader : ISingleResultLoader From 36366382a276a1622d8aafbb2dd7b13c5277efd9 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 14:54:51 +0100 Subject: [PATCH 049/132] Add NCrunch configuration --- .../Pickles.ObjectModel.v2.ncrunchproject | 26 +++++++++++++++++++ ...TestFrameworks.UnitTests.v2.ncrunchproject | 26 +++++++++++++++++++ .../Pickles.TestFrameworks.v2.ncrunchproject | 26 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/Pickles/Pickles.ObjectModel/Pickles.ObjectModel.v2.ncrunchproject create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.v2.ncrunchproject create mode 100644 src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.v2.ncrunchproject 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.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/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 From 1aed9efd6e94c2e3d84c060b3776a44953458efe Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 14:54:59 +0100 Subject: [PATCH 050/132] Add this qualifier --- .../CucumberJson/CucumberJsonSingleResults.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index ece093c60..df8d8478c 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -101,7 +101,7 @@ private TestResult GetResultFromScenario(Parser.JsonResult.Element cucumberScena return TestResult.Inconclusive; } - bool wasSuccessful = CheckScenarioStatus(cucumberScenario); + bool wasSuccessful = this.CheckScenarioStatus(cucumberScenario); return wasSuccessful ? TestResult.Passed : TestResult.Failed; } @@ -118,7 +118,7 @@ private TestResult GetResultFromFeature(Feature cucumberFeature) return TestResult.Inconclusive; } - bool wasSuccessful = cucumberFeature.elements.All(CheckScenarioStatus); + bool wasSuccessful = cucumberFeature.elements.All(this.CheckScenarioStatus); return wasSuccessful ? TestResult.Passed : TestResult.Failed; } From e4011202384e9c349cb53e3d17ec7988ea580cbb Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 14:59:19 +0100 Subject: [PATCH 051/132] Adjust namespace --- .../CucumberJson/WhenParsingCucumberJsonResultsFile.cs | 2 ++ .../CucumberJson/CucumberJsonSingleResults.cs | 8 ++++---- .../Pickles.TestFrameworks/CucumberJson/Element.cs | 2 +- .../Pickles.TestFrameworks/CucumberJson/Feature.cs | 2 +- src/Pickles/Pickles.TestFrameworks/CucumberJson/Match.cs | 2 +- src/Pickles/Pickles.TestFrameworks/CucumberJson/Result.cs | 2 +- src/Pickles/Pickles.TestFrameworks/CucumberJson/Step.cs | 2 +- src/Pickles/Pickles.TestFrameworks/CucumberJson/Tag.cs | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs index e639d0fae..e8bdab25f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs @@ -27,6 +27,8 @@ using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; +using Feature = PicklesDoc.Pickles.ObjectModel.Feature; + namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index df8d8478c..d6f2d5feb 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -28,7 +28,7 @@ using PicklesDoc.Pickles.ObjectModel; -using Feature = PicklesDoc.Pickles.Parser.JsonResult.Feature; +using Feature = PicklesDoc.Pickles.TestFrameworks.CucumberJson.Feature; namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { @@ -65,7 +65,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl public override TestResult GetScenarioResult(Scenario scenario) { - Parser.JsonResult.Element cucumberScenario = null; + Element cucumberScenario = null; var cucumberFeature = this.GetFeatureElement(scenario.Feature); if (cucumberFeature != null) { @@ -94,7 +94,7 @@ private Feature GetFeatureElement(ObjectModel.Feature feature) return this.resultsDocument.FirstOrDefault(x => x.name == feature.Name); } - private TestResult GetResultFromScenario(Parser.JsonResult.Element cucumberScenario) + private TestResult GetResultFromScenario(Element cucumberScenario) { if (cucumberScenario == null) { @@ -106,7 +106,7 @@ private TestResult GetResultFromScenario(Parser.JsonResult.Element cucumberScena return wasSuccessful ? TestResult.Passed : TestResult.Failed; } - private bool CheckScenarioStatus(Parser.JsonResult.Element cucumberScenario) + private bool CheckScenarioStatus(Element cucumberScenario) { return cucumberScenario.steps.All(x => x.result.status == "passed"); } 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.")] From afbe0e28ab6c0b00ba7365675c36898a984851c4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 14:59:38 +0100 Subject: [PATCH 052/132] Fix typo --- .../CucumberJson/WhenParsingCucumberJsonResultsFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs index e8bdab25f..3aba77970 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs @@ -40,7 +40,7 @@ public WhenParsingCucumberJsonResultsFile() } [Test] - public void ThenCanReadFeatureResultSuccesfully() + public void ThenCanReadFeatureResultSuccessfully() { var results = ParseResultsFile(); From 0fc0142037848416c02c4a37ac32ff399a94cde8 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 15:03:09 +0100 Subject: [PATCH 053/132] Move file reading concern to SingleResultLoader --- .../CucumberJsonSingleResultLoader.cs | 20 ++++++++++++++++++- .../CucumberJson/CucumberJsonSingleResults.cs | 17 ++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs index 52540f24f..929fafea9 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResultLoader.cs @@ -19,15 +19,33 @@ // -------------------------------------------------------------------------------------------------------------------- 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(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 d6f2d5feb..347990a34 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -36,9 +36,9 @@ 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 override bool SupportsExampleResults @@ -75,19 +75,6 @@ public override TestResult GetScenarioResult(Scenario scenario) return this.GetResultFromScenario(cucumberScenario); } - 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; - } private Feature GetFeatureElement(ObjectModel.Feature feature) { From b70fc62fbb576c77bafa8a82c30e3a7e6040d0ed Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 15:06:56 +0100 Subject: [PATCH 054/132] Implement GetScenarioResult in a map-reduce-like fashion --- .../CucumberJson/CucumberJsonSingleResults.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 347990a34..dcc9b9d29 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -64,6 +64,13 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl } public override TestResult GetScenarioResult(Scenario scenario) + { + var cucumberScenario = this.GetCucumberScenario(scenario); + + return this.GetResultFromScenario(cucumberScenario); + } + + private Element GetCucumberScenario(Scenario scenario) { Element cucumberScenario = null; var cucumberFeature = this.GetFeatureElement(scenario.Feature); @@ -72,10 +79,9 @@ public override TestResult GetScenarioResult(Scenario scenario) cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name); } - return this.GetResultFromScenario(cucumberScenario); + return cucumberScenario; } - private Feature GetFeatureElement(ObjectModel.Feature feature) { return this.resultsDocument.FirstOrDefault(x => x.name == feature.Name); From 80e08c8477f292f93a7f84db4eefb43560b2338b Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 15:13:26 +0100 Subject: [PATCH 055/132] Refactor file --- .../CucumberJson/CucumberJsonSingleResults.cs | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index dcc9b9d29..3d64be1ee 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -20,16 +20,10 @@ 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.TestFrameworks.CucumberJson.Feature; - namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonSingleResults : SingleTestRunBase @@ -53,10 +47,38 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e public override TestResult GetFeatureResult(ObjectModel.Feature feature) { - var cucumberFeature = this.GetFeatureElement(feature); + var cucumberFeature = this.GetCucumberFeature(feature); + return this.GetResultFromFeature(cucumberFeature); } + private Feature GetCucumberFeature(ObjectModel.Feature feature) + { + return this.resultsDocument.FirstOrDefault(f => f.name == feature.Name); + } + + private TestResult GetResultFromFeature(Feature cucumberFeature) + { + if (cucumberFeature?.elements == null) + { + return TestResult.Inconclusive; + } + + bool wasSuccessful = cucumberFeature.elements.All(this.DoAllStepsPass); + + return ConvertBooleanToTestResult(wasSuccessful); + } + + private bool DoAllStepsPass(Element cucumberScenario) + { + return cucumberScenario.steps.All(x => x.result.status == "passed"); + } + + private static TestResult ConvertBooleanToTestResult(bool wasSuccessful) + { + return wasSuccessful ? TestResult.Passed : TestResult.Failed; + } + public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { // Not applicable @@ -73,7 +95,7 @@ public override TestResult GetScenarioResult(Scenario scenario) private Element GetCucumberScenario(Scenario scenario) { Element cucumberScenario = null; - var cucumberFeature = this.GetFeatureElement(scenario.Feature); + var cucumberFeature = this.GetCucumberFeature(scenario.Feature); if (cucumberFeature != null) { cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name); @@ -82,11 +104,6 @@ private Element GetCucumberScenario(Scenario scenario) return cucumberScenario; } - private Feature GetFeatureElement(ObjectModel.Feature feature) - { - return this.resultsDocument.FirstOrDefault(x => x.name == feature.Name); - } - private TestResult GetResultFromScenario(Element cucumberScenario) { if (cucumberScenario == null) @@ -94,26 +111,9 @@ private TestResult GetResultFromScenario(Element cucumberScenario) return TestResult.Inconclusive; } - bool wasSuccessful = this.CheckScenarioStatus(cucumberScenario); - - return wasSuccessful ? TestResult.Passed : TestResult.Failed; - } - - private bool CheckScenarioStatus(Element cucumberScenario) - { - return cucumberScenario.steps.All(x => x.result.status == "passed"); - } - - private TestResult GetResultFromFeature(Feature cucumberFeature) - { - if (cucumberFeature == null || cucumberFeature.elements == null) - { - return TestResult.Inconclusive; - } - - bool wasSuccessful = cucumberFeature.elements.All(this.CheckScenarioStatus); + bool wasSuccessful = this.DoAllStepsPass(cucumberScenario); - return wasSuccessful ? TestResult.Passed : TestResult.Failed; + return ConvertBooleanToTestResult(wasSuccessful); } } } From 42477f5a34b7bb813450a6ebaba20386eafde14c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 15:14:37 +0100 Subject: [PATCH 056/132] Remove unused using --- .../Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs index e95817c43..50ebe5599 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResultLoader.cs @@ -21,8 +21,6 @@ using System; using System.IO.Abstractions; -using PicklesDoc.Pickles.ObjectModel; - namespace PicklesDoc.Pickles.TestFrameworks.MsTest { public class MsTestSingleResultLoader : ISingleResultLoader From c86ba6d76b3787a8caa9a631860e61d4c70d65a0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 17:05:16 +0100 Subject: [PATCH 057/132] Sanitize some of the XML madness --- .../MsTest/MsTestElementExtensions.cs | 118 ++++++++++++++ .../MsTest/MsTestSingleResults.cs | 151 +++++++----------- .../Pickles.TestFrameworks.csproj | 1 + 3 files changed, 177 insertions(+), 93 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs new file mode 100644 index 000000000..76d536f0a --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs @@ -0,0 +1,118 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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) + { + return scenario.Element(Ns + "Description").Value; + } + + internal static IEnumerable AllExecutionResults(this XDocument document) + { + 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). + 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 ExecutionIds(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; + } + } +} \ 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 efe11c277..8cdb5422f 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 { + /// + /// 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) @@ -44,137 +53,93 @@ public override bool SupportsExampleResults get { return false; } } - private Guid GetScenarioExecutionId(Scenario queriedScenario) + public override TestResult GetFeatureResult(Feature feature) { - 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 scenarios = this.GetScenariosForFeature(feature); - 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; - } - } + var featureExecutionIds = scenarios.ExecutionIds(); - private static string ResultOutcomeOf(XElement scenarioResult) - { - var outcomeAttribute = scenarioResult.Attribute("outcome"); - return outcomeAttribute != null ? outcomeAttribute.Value : Failed; + TestResult result = this.GetExecutionResult(featureExecutionIds); + + 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 override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) + private TestResult GetExecutionResult(IEnumerable featureExecutionIds) { - throw new NotSupportedException(); + TestResult result = featureExecutionIds.Select(this.GetExecutionResult).Merge(); + return result; } - public override 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 override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - var queriedFeatureName = scenarioOutline.Feature.Name; - var queriedScenarioOutlineName = scenarioOutline.Name; - - var allScenariosForAFeature = - from scenario in this.AllScenariosInResultFile() - let scenarioProperties = PropertiesOf(scenario) - where scenarioProperties != null - where FeatureNamePropertyExistsWith(queriedFeatureName, among: scenarioProperties) - select scenario; + var scenarios = this.GetScenariosForScenarioOutline(scenarioOutline); - var scenarioOutlineExecutionIds = from scenario in allScenariosForAFeature - where NameOf(scenario).StartsWith(queriedScenarioOutlineName) - select ScenarioExecutionIdOf(scenario); + var executionIds = scenarios.Select(scenario => scenario.ExecutionIdElement()); - TestResult result = scenarioOutlineExecutionIds.Select(this.GetExecutionResult).Merge(); + TestResult result = this.GetExecutionResult(executionIds); return result; } - public override 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); - private static bool FeatureNamePropertyExistsWith(string featureName, XElement among) - { - 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(); + return testResult; } - private IEnumerable AllScenariosInResultFile() + private IEnumerable GetScenariosForScenario(Scenario scenario) { - // 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 scenarios = + this.GetScenariosForFeature(scenario.Feature) + .Where(s => s.Name() == scenario.Name); + + return scenarios; } - private IEnumerable AllScenarioExecutionResultsInResultFile() + public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - return this.resultsDocument.Root.Descendants(Ns + "UnitTestResult"); + throw new NotSupportedException(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 781bcb068..73ab6f4f6 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -57,6 +57,7 @@ + From 04020fdd4f91aaf1a3e82c07e72985a362325fa8 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 23:20:03 +0100 Subject: [PATCH 058/132] Add more documentation and some null checks --- .../MsTest/MsTestElementExtensions.cs | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs index 76d536f0a..c852c2cf3 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs @@ -59,15 +59,25 @@ internal static bool HasPropertyFeatureTitle(this XElement parentElement, string internal static string Name(this XElement scenario) { - return scenario.Element(Ns + "Description").Value; + //// + //// 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. @@ -78,12 +88,22 @@ internal static IEnumerable AllExecutionResults(this XDocument documen /// internal static IEnumerable AllScenarios(this XDocument document) { - // TestRun/TestDefinitions/UnitTests that have a non-empty Description (which is the title of a Scenario). + //// 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; @@ -96,6 +116,8 @@ internal static IEnumerable ExecutionIds(this IEnumerable scenar internal static TestResult Outcome(this XElement scenarioResult) { + //// + var outcomeAttribute = scenarioResult.Attribute("outcome")?.Value ?? Failed; switch (outcomeAttribute.ToLowerInvariant()) @@ -111,6 +133,8 @@ internal static TestResult Outcome(this XElement scenarioResult) internal static Guid ExecutionIdAttribute(this XElement unitTestResult) { + //// + var executionIdAttribute = unitTestResult.Attribute("executionId"); return executionIdAttribute != null ? new Guid(executionIdAttribute.Value) : Guid.Empty; } From 7bc5ec3791eef0871072df4de1d33a8065bc92ab Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 23:20:11 +0100 Subject: [PATCH 059/132] Rename method --- .../Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs | 2 +- .../Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs index c852c2cf3..7d364d808 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs @@ -109,7 +109,7 @@ internal static Guid ExecutionIdElement(this XElement scenario) return xElement != null ? new Guid(xElement.Attribute("id").Value) : Guid.Empty; } - internal static IEnumerable ExecutionIds(this IEnumerable scenarios) + internal static IEnumerable ExecutionIdElements(this IEnumerable scenarios) { return scenarios.Select(ExecutionIdElement); } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 8cdb5422f..66e2c5774 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -57,7 +57,7 @@ public override TestResult GetFeatureResult(Feature feature) { var scenarios = this.GetScenariosForFeature(feature); - var featureExecutionIds = scenarios.ExecutionIds(); + var featureExecutionIds = scenarios.ExecutionIdElements(); TestResult result = this.GetExecutionResult(featureExecutionIds); From 1e335650d4809bf24eae002266a494d269282788 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 13 Feb 2016 23:58:34 +0100 Subject: [PATCH 060/132] Clean up nUnit test providers --- .../NUnit/NUnit2/NUnit2SingleResults.cs | 149 +++--------------- .../NUnit/NUnit3/NUnit3SingleResult.cs | 129 ++------------- .../NUnit/NUnitSingleResultsBase.cs | 137 ++++++++++++++++ .../NUnit/NUnitXElementExtensions.cs | 39 +++++ .../NUnit/TestResultAndName.cs | 37 +++++ .../Pickles.TestFrameworks.csproj | 3 + 6 files changed, 257 insertions(+), 237 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit/NUnitXElementExtensions.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit/TestResultAndName.cs diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs index 06ea04e10..fa9a10014 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs @@ -27,84 +27,22 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { - public class NUnit2SingleResults : SingleTestRunBase + public class NUnit2SingleResults : NUnitSingleResultsBase { - private readonly XDocument resultsDocument; - 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"), + }) { - this.resultsDocument = resultsDocument; - } - - public override bool SupportsExampleResults - { - get { return true; } - } - - 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 results.Merge(); - } - - 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) - { - Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - - var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); - - return this.GetResultFromElement(examplesElement); - } - - 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; - } - - 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(); } - private XElement GetScenarioElement(Scenario scenario) + protected override XElement GetScenarioElement(Scenario scenario) { XElement featureElement = this.GetFeatureElement(scenario.Feature); XElement scenarioElement = null; @@ -115,10 +53,11 @@ private XElement GetScenarioElement(Scenario scenario) .Where(x => x.Attribute("description") != null) .FirstOrDefault(x => x.Attribute("description").Value == scenario.Name); } + return scenarioElement; } - private XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) + protected override XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) { XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); XElement scenarioOutlineElement = null; @@ -134,17 +73,7 @@ private XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) return scenarioOutlineElement; } - private TestResult DetermineScenarioOutlineResult(XElement scenarioOutlineElement) - { - if (scenarioOutlineElement != null) - { - return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); - } - - return TestResult.Inconclusive; - } - - private XElement GetFeatureElement(Feature feature) + protected override XElement GetFeatureElement(Feature feature) { return this.resultsDocument .Descendants("test-suite") @@ -152,44 +81,9 @@ private XElement GetFeatureElement(Feature feature) .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 XElement GetExamplesElement(ScenarioOutline scenarioOutline, Regex exampleSignature) + protected override XElement GetExamplesElement( + ScenarioOutline scenarioOutline, + Regex exampleSignature) { XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); XElement examplesElement = null; @@ -208,5 +102,14 @@ private XElement GetExamplesElement(ScenarioOutline scenarioOutline, Regex examp } 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/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs index 717a32509..8c8be6533 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs @@ -27,75 +27,22 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { - public class NUnit3SingleResult : SingleTestRunBase + public class NUnit3SingleResult : NUnitSingleResultsBase { - private readonly XDocument resultsDocument; - 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"), + }) { - this.resultsDocument = resultsDocument; - } - - public override bool SupportsExampleResults - { - get { return true; } - } - - 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 results.Merge(); - } - - 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) - { - Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - - var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); - - return this.GetResultFromElement(examplesElement); - } - - 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; - } - - 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 XElement GetScenarioElement(Scenario scenario) + protected override XElement GetScenarioElement(Scenario scenario) { XElement featureElement = this.GetFeatureElement(scenario.Feature); XElement scenarioElement = null; @@ -115,17 +62,7 @@ private XElement GetScenarioElement(Scenario scenario) return scenarioElement; } - private TestResult DetermineScenarioOutlineResult(XElement scenarioOutlineElement) - { - if (scenarioOutlineElement != null) - { - return scenarioOutlineElement.Descendants("test-case").Select(this.GetResultFromElement).Merge(); - } - - return TestResult.Inconclusive; - } - - private XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) + protected override XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) { XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); XElement scenarioOutlineElement = null; @@ -143,10 +80,11 @@ private XElement GetScenarioOutlineElement(ScenarioOutline scenarioOutline) p.Attribute("name").Value == "Description" && p.Attribute("value").Value == scenarioOutline.Name)); } + return scenarioOutlineElement; } - private XElement GetFeatureElement(Feature feature) + protected override XElement GetFeatureElement(Feature feature) { return this.resultsDocument @@ -157,44 +95,7 @@ private XElement GetFeatureElement(Feature feature) .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 XElement GetExamplesElement( + protected override XElement GetExamplesElement( ScenarioOutline scenarioOutline, Regex exampleSignature) { diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs new file mode 100644 index 000000000..f2f4e5600 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs @@ -0,0 +1,137 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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; + } + + public override bool SupportsExampleResults + { + get { return true; } + } + + 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) + { + Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); + + var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); + + 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, + Regex exampleSignature); + } +} \ 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/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 73ab6f4f6..85c8ddcd3 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -73,6 +73,9 @@ results-example-nunit3.xsd + + + From 98e51206b4a44c897d25a2fb43d5b3f8fd575984 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 14 Feb 2016 00:16:07 +0100 Subject: [PATCH 061/132] Rework SpecRun provider --- .../Pickles.TestFrameworks.csproj | 4 +- .../Pickles.TestFrameworks/SpecRun/Factory.cs | 13 +++-- .../SpecRun/{Feature.cs => SpecRunFeature.cs} | 6 +- .../{Scenario.cs => SpecRunScenario.cs} | 8 ++- .../SpecRun/SpecRunSingleResultLoader.cs | 47 ++++++++++++++-- .../SpecRun/SpecRunSingleResults.cs | 56 +++---------------- 6 files changed, 69 insertions(+), 65 deletions(-) rename src/Pickles/Pickles.TestFrameworks/SpecRun/{Feature.cs => SpecRunFeature.cs} (88%) rename src/Pickles/Pickles.TestFrameworks/SpecRun/{Scenario.cs => SpecRunScenario.cs} (86%) diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 85c8ddcd3..115158865 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -79,8 +79,8 @@ - - + + 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/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/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/SpecRunSingleResultLoader.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs index 4ea00a23d..ea5d82e3d 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResultLoader.cs @@ -1,4 +1,4 @@ -// -------------------------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------------------------- // // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors @@ -19,9 +19,11 @@ // -------------------------------------------------------------------------------------------------------------------- using System; +using System.Collections.Generic; using System.IO.Abstractions; - -using PicklesDoc.Pickles.ObjectModel; +using System.Linq; +using System.Xml; +using System.Xml.Linq; namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { @@ -29,7 +31,44 @@ public class SpecRunSingleResultLoader : ISingleResultLoader { public SingleTestRunBase Load(FileInfoBase fileInfo) { - return new SpecRunSingleResults(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 089f3ddaf..1e7e1a539 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -20,28 +20,19 @@ 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 : 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 override bool SupportsExampleResults @@ -49,7 +40,7 @@ public override bool SupportsExampleResults get { return false; } } - public override TestResult GetFeatureResult(ObjectModel.Feature feature) + public override TestResult GetFeatureResult(Feature feature) { var specRunFeature = this.FindSpecRunFeature(feature); @@ -73,7 +64,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl return TestResult.Inconclusive; } - Parser.SpecRun.Scenario[] specRunScenarios = FindSpecRunScenarios(scenarioOutline, specRunFeature); + SpecRunScenario[] specRunScenarios = FindSpecRunScenarios(scenarioOutline, specRunFeature); if (specRunScenarios.Length == 0) { @@ -145,50 +136,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; - } } } From d8ff66cf26f3d68c5f634aad399d2303189fb480 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 14 Feb 2016 00:32:06 +0100 Subject: [PATCH 062/132] Create Standard Test Suite --- .../MsTest/WhenParsingMsTestResultsFile.cs | 109 +++---------- .../Pickles.TestFrameworks.UnitTests.csproj | 1 + .../StandardTestSuite.cs | 149 ++++++++++++++++++ .../WhenParsingTestResultFiles.cs | 4 +- 4 files changed, 172 insertions(+), 91 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs index 3b4aee247..caaab808e 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,57 @@ 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); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - 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); - } - - 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() + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() { - return new Feature { Name = "Passing" }; + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index c49865948..7e3e7d114 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -66,6 +66,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs new file mode 100644 index 000000000..08d9ef12b --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.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 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 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); + } + + 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); + } + + 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/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(); From 9d0fa1f28237ccfde9d8cb2e6de017857f1b48eb Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 14 Feb 2016 00:56:18 +0100 Subject: [PATCH 063/132] Introduce standard test suite in NUnit --- .../MsTest/WhenParsingMsTestResultsFile.cs | 24 ++ .../NUnit2/WhenParsingNUnitResultsFile.cs | 240 ++---------------- ...ngNUnitResultsFileWithIndividualResults.cs | 138 ++++++++++ .../Pickles.TestFrameworks.UnitTests.csproj | 1 + .../StandardTestSuite.cs | 54 ++++ 5 files changed, 242 insertions(+), 215 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs index caaab808e..b0776fecf 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs @@ -87,5 +87,29 @@ public WhenParsingMsTestResultsFile() { 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(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs index 18c380ac3..c96a3cf40 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs @@ -20,17 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { [TestFixture] - public class WhenParsingNUnitResultsFile : WhenParsingTestResultFiles + public class WhenParsingNUnitResultsFile : StandardTestSuite { public WhenParsingNUnitResultsFile() : base("NUnit2." + "results-example-nunit.xml") @@ -38,262 +35,75 @@ public WhenParsingNUnitResultsFile() } [Test] - public void ThenCanReadFeatureResultSuccessfully() + public new 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); + base.ThenCanReadFeatureResultSuccessfully(); } [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() + public new 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); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new 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); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() + public new 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); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() + public new 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); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveScenarioResultSuccessfully() + public new 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); + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } [Test] - public void ThenCanReadInconclusiveFeatureResultSuccessfully() + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() { - var results = ParseResultsFile(); - var result = results.GetFeatureResult(this.InconclusiveFeature()); - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); } [Test] - public void ThenCanReadPassedFeatureResultSuccessfully() + public new void ThenCanReadPassedFeatureResultSuccessfully() { - var results = ParseResultsFile(); - var result = results.GetFeatureResult(this.PassingFeature()); - Check.That(result).IsEqualTo(TestResult.Passed); + base.ThenCanReadPassedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadFailedFeatureResultSuccessfully() + public new 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); + base.ThenCanReadFailedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadNotFoundFeatureCorrectly() + public new void ThenCanReadNotFoundScenarioCorrectly() { - var results = ParseResultsFile(); - var feature = new Feature { Name = "NotInTheFile" }; - var result = results.GetFeatureResult(feature); - - Check.That(result).IsEqualTo(TestResult.Inconclusive); + base.ThenCanReadNotFoundScenarioCorrectly(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadNotFoundFeatureCorrectly() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadNotFoundFeatureCorrectly(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + public new void ThenCanReadResultsWithBackslashes() { - var results = ParseResultsFile(); - - 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(); - - 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(); - - 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(); - - 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); + base.ThenCanReadResultsWithBackslashes(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..4838af49c --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,138 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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.NUnit.NUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +{ + [TestFixture] + public class WhenParsingNUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + { + public WhenParsingNUnitResultsFileWithIndividualResults() + : base("NUnit2." + "results-example-nunit.xml") + { + } + + + [Test] + public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + var results = ParseResultsFile(); + + 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(); + + 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(); + + 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(); + + 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); + } + } +} diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 7e3e7d114..c622f804d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -61,6 +61,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs index 08d9ef12b..0e632e90d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -32,6 +32,17 @@ protected StandardTestSuite(string 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() }; @@ -80,6 +91,12 @@ public void ThenCanReadScenarioOutlineResultSuccessfully() 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); } public void ThenCanReadSuccessfulScenarioResultSuccessfully() @@ -126,6 +143,43 @@ public void ThenCanReadInconclusiveScenarioResultSuccessfully() 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); + } + private Feature AdditionFeature() { return new Feature { Name = "Addition" }; From 90367a34bdb0080da7c306bf0f7b3affbc656717 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Mon, 15 Feb 2016 15:34:08 +0100 Subject: [PATCH 064/132] Fix Typo --- .../Examples/Features/00BasicGherkin/BasicGherkin.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 1c37937b52590a22e4d7496efdd39328d8932dde Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 13:39:52 +0100 Subject: [PATCH 065/132] Use standard test suite in nUnit3 --- ...ngNUnitResultsFileWithIndividualResults.cs | 135 +++++++++++++ .../NUnit3/WhenParsingNunit3ResultsFile.cs | 186 ++---------------- .../Pickles.TestFrameworks.UnitTests.csproj | 1 + 3 files changed, 151 insertions(+), 171 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..2bda764ce --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,135 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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 NUnit.Framework; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit3 +{ + [TestFixture] + public class WhenParsingNUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + { + public WhenParsingNUnitResultsFileWithIndividualResults() + : base("NUnit3." + "results-example-nunit3.xml") + { + } + + [Test] + public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + var results = ParseResultsFile(); + + 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(); + + 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(); + + 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(); + + 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); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs index 91ef10a05..7beeffd71 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -20,17 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 { [TestFixture] - public class WhenParsingNunit3ResultsFile : WhenParsingTestResultFiles + public class WhenParsingNunit3ResultsFile : StandardTestSuite { public WhenParsingNunit3ResultsFile() : base("NUnit3." + "results-example-nunit3.xml") @@ -38,198 +35,45 @@ public WhenParsingNunit3ResultsFile() } [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() + public new void ThenCanReadFeatureResultSuccessfully() { - 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); + base.ThenCanReadFeatureResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new void ThenCanReadScenarioOutlineResultSuccessfully() { - 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); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + public new void ThenCanReadFailedScenarioResultSuccessfully() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadIgnoredScenarioResultSuccessfully() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadNotFoundScenarioCorrectly() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadNotFoundScenarioCorrectly(); } [Test] - public void ThenCanReadResultsWithBackslashes() + public new 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); + base.ThenCanReadResultsWithBackslashes(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index c622f804d..a749c070d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -65,6 +65,7 @@ + From 0081b51fbd093b787fc47958b23f3fad12c07105 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 13:58:45 +0100 Subject: [PATCH 066/132] Use standard test suite in SpecRun --- .../WhenParsingSpecRunTestResultsFile.cs | 109 +++--------------- 1 file changed, 19 insertions(+), 90 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs index 0128ddfd9..5734b1c80 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,57 @@ 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() - { - 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); - } - - 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() + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() { - return new Feature { Name = "Passing" }; + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } } } From 6e0c2b7561fa397125a794fb114b2ce40719267c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 14:10:42 +0100 Subject: [PATCH 067/132] Use standard test suite in xUnit --- .../Pickles.TestFrameworks.UnitTests.csproj | 2 + ...ngXUnitResultsFileWithIndividualResults.cs | 136 ++++++++++++ .../XUnit1/WhenParsingxUnitResultsFile.cs | 185 ++--------------- ...ngXUnitResultsFileWithIndividualResults.cs | 136 ++++++++++++ .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 193 ++---------------- 5 files changed, 308 insertions(+), 344 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index a749c070d..a6a89c6f2 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -79,12 +79,14 @@ + + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..f873ba9fe --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,136 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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 NUnit.Framework; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +{ + [TestFixture] + public class WhenParsingXUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + { + public WhenParsingXUnitResultsFileWithIndividualResults() + : base("XUnit1." + "results-example-xunit.xml") + { + } + + + [Test] + public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + var results = ParseResultsFile(); + + 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(); + + 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(); + + 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(); + + 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); + } + } +} \ 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 index a10c52bc4..d589f1b77 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs @@ -20,18 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { [TestFixture] - public class WhenParsingxUnitResultsFile : WhenParsingTestResultFiles + public class WhenParsingxUnitResultsFile : StandardTestSuite { public WhenParsingxUnitResultsFile() : base("XUnit1." + "results-example-xunit.xml") @@ -39,198 +35,51 @@ public WhenParsingxUnitResultsFile() } [Test] - public void ThenCanReadFeatureResultSuccessfully() + public new 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); + base.ThenCanReadFeatureResultSuccessfully(); } [Test] - public void ThenCanReadScenarioOutlineResultSuccessfully() + public new 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); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new 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); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() + public new 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 ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() - { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() + public new void ThenCanReadIgnoredScenarioResultSuccessfully() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadNotFoundScenarioCorrectly() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadNotFoundScenarioCorrectly(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadResultsWithBackslashes() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadResultsWithBackslashes(); } [Test] - public void ThenCanReadResultsWithBackslashes() + public new void ThenCanReadNotFoundFeatureCorrectly() { - 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); + base.ThenCanReadNotFoundFeatureCorrectly(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..794bca859 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -0,0 +1,136 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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 NUnit.Framework; + +using PicklesDoc.Pickles.ObjectModel; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +{ + [TestFixture] + public class WhenParsingXUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + { + public WhenParsingXUnitResultsFileWithIndividualResults() + : base("XUnit2." + "results-example-xunit2.xml") + { + } + + + [Test] + public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + var results = ParseResultsFile(); + + 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(); + + 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(); + + 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(); + + 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); + } + } +} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs index 3e4d080e6..778eda4de 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -25,13 +25,12 @@ using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; -using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { [TestFixture] - public class WhenParsingxUnit2ResultsFile : WhenParsingTestResultFiles + public class WhenParsingxUnit2ResultsFile : StandardTestSuite { public WhenParsingxUnit2ResultsFile() : base("XUnit2." + "results-example-xunit2.xml") @@ -39,209 +38,51 @@ public WhenParsingxUnit2ResultsFile() } [Test] - public void ThenCanReadFeatureResultSuccessfully() + public new 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); + base.ThenCanReadFeatureResultSuccessfully(); } [Test] - public void ThenCanReadSuccessfulScenarioResultSuccessfully() + public new void ThenCanReadScenarioOutlineResultSuccessfully() { - 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); + base.ThenCanReadScenarioOutlineResultSuccessfully(); } [Test] - public void ThenCanReadFailedScenarioResultSuccessfully() + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() { - 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); + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadIgnoredScenarioResultSuccessfully() + public new void ThenCanReadFailedScenarioResultSuccessfully() { - 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); + base.ThenCanReadFailedScenarioResultSuccessfully(); } [Test] - public void ThenCanReadNotFoundScenarioCorrectly() + public new void ThenCanReadIgnoredScenarioResultSuccessfully() { - 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); + base.ThenCanReadIgnoredScenarioResultSuccessfully(); } [Test] - public void ThenCanReadNotFoundFeatureCorrectly() + public new void ThenCanReadNotFoundScenarioCorrectly() { - 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); + base.ThenCanReadNotFoundScenarioCorrectly(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadResultsWithBackslashes() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadResultsWithBackslashes(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() + public new void ThenCanReadNotFoundFeatureCorrectly() { - var results = ParseResultsFile(); - - 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(); - - 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(); - - 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(); - - 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); + base.ThenCanReadNotFoundFeatureCorrectly(); } } } From 4f74345d5f927f04081b7c1e904aaf50eb5b7d1c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 14:17:26 +0100 Subject: [PATCH 068/132] Use standard suite for scenario outlines --- ...ngNUnitResultsFileWithIndividualResults.cs | 92 ++----------- ...ngNUnitResultsFileWithIndividualResults.cs | 92 ++----------- .../Pickles.TestFrameworks.UnitTests.csproj | 1 + .../StandardTestSuiteForScenarioOutlines.cs | 130 ++++++++++++++++++ 4 files changed, 149 insertions(+), 166 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs index 4838af49c..5af9a2375 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -30,109 +30,35 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 { [TestFixture] - public class WhenParsingNUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingNUnitResultsFileWithIndividualResults() : base("NUnit2." + "results-example-nunit.xml") { } - [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs index 2bda764ce..6ffe09eed 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -22,13 +22,12 @@ using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit3 { [TestFixture] - public class WhenParsingNUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingNUnitResultsFileWithIndividualResults() : base("NUnit3." + "results-example-nunit3.xml") @@ -36,100 +35,27 @@ public WhenParsingNUnitResultsFileWithIndividualResults() } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index a6a89c6f2..2a2e2d694 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -69,6 +69,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs new file mode 100644 index 000000000..894be592f --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs @@ -0,0 +1,130 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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 PicklesDoc.Pickles.ObjectModel; + +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests +{ + public class StandardTestSuiteForScenarioOutlines : WhenParsingTestResultFiles + where TResults : ITestResults + { + protected StandardTestSuiteForScenarioOutlines(string resultsFileName) + : base(resultsFileName) + { + } + + public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + { + var results = ParseResultsFile(); + + 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); + } + + public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() + { + var results = ParseResultsFile(); + + 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); + } + + public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + { + var results = ParseResultsFile(); + + 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); + } + + public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + { + var results = ParseResultsFile(); + + 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); + } + } +} From b6e8179c375c7967a7eb93c9c820bc5dc76f7829 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 16:14:49 +0100 Subject: [PATCH 069/132] Use standard test suite for scenario outlines in xUnit --- .../StandardTestSuiteForScenarioOutlines.cs | 13 ++- ...ngXUnitResultsFileWithIndividualResults.cs | 96 +++---------------- ...ngXUnitResultsFileWithIndividualResults.cs | 96 +++---------------- 3 files changed, 30 insertions(+), 175 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs index 894be592f..bb647fcb1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuiteForScenarioOutlines.cs @@ -29,9 +29,12 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests public class StandardTestSuiteForScenarioOutlines : WhenParsingTestResultFiles where TResults : ITestResults { - protected StandardTestSuiteForScenarioOutlines(string resultsFileName) + private readonly TestResult valueForInconclusive; + + protected StandardTestSuiteForScenarioOutlines(string resultsFileName, bool treatInconclusiveAsFailed = false) : base(resultsFileName) { + this.valueForInconclusive = treatInconclusiveAsFailed ? TestResult.Failed : TestResult.Inconclusive; } public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() @@ -64,7 +67,7 @@ public void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_Shou 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); @@ -73,7 +76,7 @@ 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); } public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() @@ -115,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); diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs index f873ba9fe..a5235532d 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -18,119 +18,45 @@ // // -------------------------------------------------------------------------------------------------------------------- -using NFluent; +using System; using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 { [TestFixture] - public class WhenParsingXUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingXUnitResultsFileWithIndividualResults() - : base("XUnit1." + "results-example-xunit.xml") + : base("XUnit1." + "results-example-xunit.xml", true) { } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs index 794bca859..bef994f37 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -18,119 +18,45 @@ // // -------------------------------------------------------------------------------------------------------------------- -using NFluent; +using System; using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 { [TestFixture] - public class WhenParsingXUnitResultsFileWithIndividualResults : WhenParsingTestResultFiles + public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingXUnitResultsFileWithIndividualResults() - : base("XUnit2." + "results-example-xunit2.xml") + : base("XUnit2." + "results-example-xunit2.xml", true) { } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_AllPass_ShouldBeTestResultPassed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed_xUnitDoesNotSupportInconclusive() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneInconclusive_ShouldBeTestResultInconclusive(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed(); } [Test] - public void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() + public new void ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed() { - var results = ParseResultsFile(); - - 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); + base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed(); } } } \ No newline at end of file From 33b6aa7451450999e04387fb29356b8769547e0d Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 16:17:42 +0100 Subject: [PATCH 070/132] Move nUnit files to an nUnit directory --- ...erminingTheSignatureOfAnNUnitExampleRow.cs | 2 +- ...tipleNUnitResultsFilesForASingleFeature.cs | 4 +-- .../NUnit2/WhenParsingNUnitResultsFile.cs | 4 +-- ...ngNUnitResultsFileWithIndividualResults.cs | 7 ++-- ...arsingProblematicScenarioOutlineResults.cs | 4 +-- ...rsingnUnit2ResultsFileWithMissingTraits.cs | 4 +-- .../NUnit2/results-example-nunit - Run 1.xml | 0 .../NUnit2/results-example-nunit - Run 2.xml | 0 .../results-example-nunit-missingTraits.xml | 0 .../NUnit2/results-example-nunit.xml | 0 ...lts-problem-with-outline-results-nunit.xml | 0 ...rminingTheSignatureOfAnNunit3ExampleRow.cs | 2 +- ...ngNUnitResultsFileWithIndividualResults.cs | 6 ++-- .../NUnit3/WhenParsingNunit3ResultsFile.cs | 4 +-- ...rsingnUnit3ResultsFileWithMissingTraits.cs | 4 +-- .../results-example-nunit3-missingTraits.xml | 0 .../NUnit3/results-example-nunit3.xml | 0 .../Pickles.TestFrameworks.UnitTests.csproj | 34 +++++++++---------- .../WhenResolvingTestResults.cs | 4 +-- 19 files changed, 38 insertions(+), 41 deletions(-) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs (96%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs (93%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenParsingNUnitResultsFile.cs (96%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs (93%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs (93%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs (92%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/results-example-nunit - Run 1.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/results-example-nunit - Run 2.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/results-example-nunit-missingTraits.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/results-example-nunit.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit2/results-problem-with-outline-results-nunit.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs (96%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs (94%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/WhenParsingNunit3ResultsFile.cs (94%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs (92%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/results-example-nunit3-missingTraits.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => NUnit}/NUnit3/results-example-nunit3.xml (100%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs index 357251766..bdac53b23 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs @@ -31,7 +31,7 @@ using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.NUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] public class WhenDeterminingTheSignatureOfAnNUnitExampleRow : BaseFixture diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs similarity index 93% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs index 9940c11dd..26d5c2348 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingMultipleNUnitResultsFilesForASingleFeature.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 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/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs index c96a3cf40..4764c4811 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs @@ -24,13 +24,13 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] public class WhenParsingNUnitResultsFile : StandardTestSuite { public WhenParsingNUnitResultsFile() - : base("NUnit2." + "results-example-nunit.xml") + : base("NUnit.NUnit2." + "results-example-nunit.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs similarity index 93% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs index 5af9a2375..b3b6acc4a 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -20,20 +20,17 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit2 { [TestFixture] public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingNUnitResultsFileWithIndividualResults() - : base("NUnit2." + "results-example-nunit.xml") + : base("NUnit.NUnit2." + "results-example-nunit.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs similarity index 93% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs index 2e5a10340..146ee8c79 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingProblematicScenarioOutlineResults.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 WhenParsingProblematicScenarioOutlineResults() - : base("NUnit2." + "results-problem-with-outline-results-nunit.xml") + : base("NUnit.NUnit2." + "results-problem-with-outline-results-nunit.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs similarity index 92% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs index e78b33bfe..0f7f0c88f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingnUnit2ResultsFileWithMissingTraits.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 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 100% 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 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 96% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs index ef6d90954..6e8edfc92 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs @@ -31,7 +31,7 @@ using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.NUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 { [TestFixture] public class WhenDeterminingTheSignatureOfAnNunit3ExampleRow : BaseFixture diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs index 6ffe09eed..00d0ad342 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNUnitResultsFileWithIndividualResults.cs @@ -18,19 +18,19 @@ // // -------------------------------------------------------------------------------------------------------------------- -using NFluent; +using System; using NUnit.Framework; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 { [TestFixture] public class WhenParsingNUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingNUnitResultsFileWithIndividualResults() - : base("NUnit3." + "results-example-nunit3.xml") + : base("NUnit.NUnit3." + "results-example-nunit3.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs index 7beeffd71..61d14f7d1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -24,13 +24,13 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.Nunit3 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.NUnit.NUnit3 { [TestFixture] public class WhenParsingNunit3ResultsFile : StandardTestSuite { public WhenParsingNunit3ResultsFile() - : base("NUnit3." + "results-example-nunit3.xml") + : base("NUnit.NUnit3." + "results-example-nunit3.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs similarity index 92% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs index 1b8ba6fc1..bb2c568ba 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingnUnit3ResultsFileWithMissingTraits.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 100% 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 diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 2a2e2d694..9ee0ae390 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -60,24 +60,24 @@ - - - - - - + + + + + + - + - + - - + + @@ -108,13 +108,13 @@ - + - + - + Designer @@ -130,7 +130,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -172,12 +172,12 @@ - + Designer - + Designer diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index a4965bc36..390773cf8 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -76,7 +76,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; @@ -176,7 +176,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; From 26a463e3922c37d3172706b5a47071e91d509a36 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 16:19:50 +0100 Subject: [PATCH 071/132] Move xUnit files to an xUnit directory --- .../Pickles.TestFrameworks.UnitTests.csproj | 24 +++++++++---------- .../WhenResolvingTestResults.cs | 4 ++-- ...erminingTheSignatureOfAnXUnitExampleRow.cs | 2 +- ...ngXUnitResultsFileWithIndividualResults.cs | 4 ++-- .../XUnit1/WhenParsingxUnitResultsFile.cs | 4 ++-- ...arsingxUnitResultsFileWithMissingTraits.cs | 4 ++-- .../XUnit1/results-example-xunit.xml | 0 .../results-example-xunit1-missingTraits.xml | 0 ...rminingTheSignatureOfAnXUnit2ExampleRow.cs | 2 +- ...ngXUnitResultsFileWithIndividualResults.cs | 4 ++-- .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 7 ++---- ...rsingxUnit2ResultsFileWithMissingTraits.cs | 4 ++-- .../results-example-xunit2-missingTraits.xml | 0 .../XUnit2/results-example-xunit2.xml | 0 14 files changed, 28 insertions(+), 31 deletions(-) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs (96%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs (94%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/WhenParsingxUnitResultsFile.cs (95%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs (92%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/results-example-xunit.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit1/results-example-xunit1-missingTraits.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs (96%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs (94%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/WhenParsingxUnit2ResultsFile.cs (93%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs (92%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/results-example-xunit2-missingTraits.xml (100%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/{ => XUnit}/XUnit2/results-example-xunit2.xml (100%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 9ee0ae390..8a04a4c2f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -70,7 +70,7 @@ - + @@ -80,14 +80,14 @@ - - - - - - + + + + + + - + @@ -122,12 +122,12 @@ - + Designer - + @@ -164,10 +164,10 @@ - + - + Designer diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index 390773cf8..aab0f7ed0 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -95,7 +95,7 @@ public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit() [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.XUnit1; @@ -191,7 +191,7 @@ public void ThenCanResolveWhenTestResultsAreNUnit() [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.XUnit1; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs index 8d2d81eb1..e63b41a14 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs @@ -31,7 +31,7 @@ using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.XUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 { [TestFixture] public class WhenDeterminingTheSignatureOfAnXUnitExampleRow : BaseFixture diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs index a5235532d..b67a36d22 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -24,13 +24,13 @@ using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 { [TestFixture] public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingXUnitResultsFileWithIndividualResults() - : base("XUnit1." + "results-example-xunit.xml", true) + : base("XUnit.XUnit1." + "results-example-xunit.xml", true) { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs similarity index 95% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs index d589f1b77..56341dac7 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs @@ -24,13 +24,13 @@ using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit1 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit1 { [TestFixture] public class WhenParsingxUnitResultsFile : StandardTestSuite { public WhenParsingxUnitResultsFile() - : base("XUnit1." + "results-example-xunit.xml") + : base("XUnit.XUnit1." + "results-example-xunit.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs similarity index 92% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs index 46af8c48d..e31fc8854 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFileWithMissingTraits.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 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 100% 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 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/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs similarity index 96% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index fb2cfa907..5f917f836 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -31,7 +31,7 @@ using PicklesDoc.Pickles.Test; using PicklesDoc.Pickles.TestFrameworks.XUnit; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 { [TestFixture] public class WhenDeterminingTheSignatureOfAnXUnit2ExampleRow : BaseFixture diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs index bef994f37..c554970d4 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingXUnitResultsFileWithIndividualResults.cs @@ -24,13 +24,13 @@ using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 { [TestFixture] public class WhenParsingXUnitResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { public WhenParsingXUnitResultsFileWithIndividualResults() - : base("XUnit2." + "results-example-xunit2.xml", true) + : base("XUnit.XUnit2." + "results-example-xunit2.xml", true) { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs similarity index 93% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs index 778eda4de..4a8e33c78 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -20,20 +20,17 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; -namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit2 +namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.XUnit.XUnit2 { [TestFixture] public class WhenParsingxUnit2ResultsFile : StandardTestSuite { public WhenParsingxUnit2ResultsFile() - : base("XUnit2." + "results-example-xunit2.xml") + : base("XUnit.XUnit2." + "results-example-xunit2.xml") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs similarity index 92% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs index 2b7fd40b9..1e7b411e1 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFileWithMissingTraits.cs @@ -27,13 +27,13 @@ using PicklesDoc.Pickles.ObjectModel; 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 100% 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 From 028c62467954a4a7cee99378af36ae9bc60c74a4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 17:32:58 +0100 Subject: [PATCH 072/132] Add missing value --- .../Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs index 0e632e90d..39e577d94 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -92,10 +92,10 @@ public void ThenCanReadScenarioOutlineResultSuccessfully() Check.That(result).IsEqualTo(TestResult.Passed); - TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "40", "50", "90" }); + 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" }); + TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "60", "70", "130", "260" }); Check.That(exampleResult2).IsEqualTo(TestResult.Passed); } From 394c11eeec8a0957426cd97028df43312a1f0b58 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 17:47:41 +0100 Subject: [PATCH 073/132] MsTest now supports results of individual examples in a scenario outline --- ...gMsTestResultsFileWithIndividualResults.cs | 61 +++++++++++++++++++ .../Pickles.TestFrameworks.UnitTests.csproj | 1 + .../MsTest/MsTestElementExtensions.cs | 20 ++++++ .../MsTest/MsTestExampleSignatureBuilder.cs | 4 +- .../MsTest/MsTestResults.cs | 2 +- .../MsTest/MsTestSingleResults.cs | 32 +++++++++- 6 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFileWithIndividualResults.cs 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/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 8a04a4c2f..77a9769c9 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -60,6 +60,7 @@ + diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs index 7d364d808..bb0ccdb6a 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestElementExtensions.cs @@ -138,5 +138,25 @@ 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/MsTest/MsTestExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs index 392576be1..2c35817d8 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs @@ -29,7 +29,9 @@ public class MsTestExampleSignatureBuilder : IExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { - throw new NotSupportedException(); + // 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 66583aac3..a2c5e87cf 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) - : base(false, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 66e2c5774..f79e96c1c 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -50,7 +51,7 @@ public MsTestSingleResults(XDocument resultsDocument) public override bool SupportsExampleResults { - get { return false; } + get { return true; } } public override TestResult GetFeatureResult(Feature feature) @@ -139,7 +140,34 @@ private IEnumerable GetScenariosForScenario(Scenario scenario) public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - throw new NotSupportedException(); + var scenarioElements = this.GetScenariosForScenarioOutline(scenario); + + var theScenario = this.GetScenarioThatMatchesTheExampleValues(exampleValues, scenarioElements); + + Guid executionId = theScenario.ExecutionIdElement(); + + TestResult testResult = this.GetExecutionResult(executionId); + + return testResult; + } + + private XElement GetScenarioThatMatchesTheExampleValues(string[] exampleValues, IEnumerable scenarioElements) + { + // filter for example values + XElement theScenario = null; + + foreach (var element in scenarioElements) + { + var valuesInScenario = element.DetermineValuesInScenario(); + + if (exampleValues.OrderBy(e => e).SequenceEqual(valuesInScenario.OrderBy(v => v))) + { + theScenario = element; + break; + } + } + + return theScenario; } } } From 8082cdb851450039eb557106ecdc69d6d7d7b009 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Tue, 16 Feb 2016 17:52:26 +0100 Subject: [PATCH 074/132] Update change log --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d62b6b12..b070cf629 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ 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] + +### Added + +- 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/276)) (by [@dirkrombauts](https://github.com/dirkrombauts)). + ## [2.3.0] - 2016-01-27 ### Added From 44fa82e386115e59afa99e737d73ae051ecbce73 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:33:52 +0100 Subject: [PATCH 075/132] Add unit tests for new requirements of WordDescriptionFormatter --- .../Word/WordDescriptionFormatterTests.cs | 49 +++++++++++++++++++ src/Pickles/Pickles.Test/Pickles.Test.csproj | 1 + 2 files changed, 50 insertions(+) create mode 100644 src/Pickles/Pickles.Test/DocumentationBuilders/Word/WordDescriptionFormatterTests.cs 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/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 + From 729cd9ffc36efc780826db15202eafd82e512944 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:34:00 +0100 Subject: [PATCH 076/132] Make the tests green --- .../DocumentationBuilders/Word/WordDescriptionFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pickles/Pickles/DocumentationBuilders/Word/WordDescriptionFormatter.cs b/src/Pickles/Pickles/DocumentationBuilders/Word/WordDescriptionFormatter.cs index 0c139ad92..8940ce167 100644 --- a/src/Pickles/Pickles/DocumentationBuilders/Word/WordDescriptionFormatter.cs +++ b/src/Pickles/Pickles/DocumentationBuilders/Word/WordDescriptionFormatter.cs @@ -36,7 +36,7 @@ public void Format(Body body, string description) public static string[] SplitDescription(string description) { - return description.Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); + return (description ?? string.Empty).Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); } } } From 6b3ba45ed7a487da98f5ca66042fdf6fa82c7f3c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:39:35 +0100 Subject: [PATCH 077/132] Add entry to change log --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b070cf629..9d31612d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt - 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/276)) (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)). + ## [2.3.0] - 2016-01-27 ### Added From 322d7b1fbfd14fd3c1562648da9bafad7acc554e Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:40:28 +0100 Subject: [PATCH 078/132] fix wrong link in change log --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d31612d4..5acb9563b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Added -- 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/276)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- 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)). ### Fixed From 31acd0aa179b529d91f300d08ee9b6d029f2c58e Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 11:30:07 +0100 Subject: [PATCH 079/132] Add tests for scenario outline examples in SpecRun --- .../Pickles.TestFrameworks.UnitTests.csproj | 1 + ...RunTestResultsFileWithIndividualResults.cs | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFileWithIndividualResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 77a9769c9..817151460 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -69,6 +69,7 @@ + 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(); + } + } +} From 83f7e914f2e7055a9387e7c540306e0232e06bce Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 11:31:00 +0100 Subject: [PATCH 080/132] Declare our support for scenario outline examples --- src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 2 +- .../Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index cfe1a7cac..09d16be6c 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) - : base(false, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs index 1e7e1a539..76f5a697a 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -37,7 +37,7 @@ public SpecRunSingleResults(IEnumerable specRunFeatures) public override bool SupportsExampleResults { - get { return false; } + get { return true; } } public override TestResult GetFeatureResult(Feature feature) From 5da982c7b9095836a29e6fec876d77aa486965ea Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 11:46:37 +0100 Subject: [PATCH 081/132] Make SpecRun support scenario outline examples --- .../SpecRun/SpecRunExampleSignatureBuilder.cs | 8 ++++++- .../SpecRun/SpecRunSingleResults.cs | 21 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs index 4a52e7500..55efa49ae 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs @@ -19,6 +19,7 @@ // -------------------------------------------------------------------------------------------------------------------- using System; +using System.Text; using System.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; @@ -29,7 +30,12 @@ public class SpecRunExampleSignatureBuilder : IExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { - throw new NotSupportedException(); + var stringBuilder = new StringBuilder(); + stringBuilder.Append(scenarioOutline.Name); + stringBuilder.Append("(, Examples (\\d*))?"); + stringBuilder.Append(", " + row[0]); + + return new Regex(stringBuilder.ToString()); } } } \ 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 76f5a697a..a95cfea37 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -97,7 +97,26 @@ public override TestResult GetScenarioResult(Scenario scenario) public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - throw new NotSupportedException(); + var specRunFeature = this.FindSpecRunFeature(scenario.Feature); + + if (specRunFeature == null) + { + return TestResult.Inconclusive; + } + + var specRunScenarios = FindSpecRunScenarios(scenario, specRunFeature); + + var signature = this.CreateSignatureRegex(scenario, exampleValues); + + foreach (var specRunScenario in specRunScenarios) + { + if (signature.IsMatch(specRunScenario.Title)) + { + return StringToTestResult(specRunScenario.Result); + } + } + + return TestResult.Inconclusive; } private static TestResult StringsToTestResult(IEnumerable results) From 957215bc4a0551a79b0166c040570c4275542f59 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:06:17 +0100 Subject: [PATCH 082/132] Introduce IScenarioOutlineExampleMatcher --- .../IScenarioOutlineExampleMatcher.cs | 37 +++++++++++++++++++ .../MultipleTestRunsBase.cs | 7 ++-- .../Pickles.TestFrameworks.csproj | 1 + .../SingleTestRunBase.cs | 2 + 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/IScenarioOutlineExampleMatcher.cs 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/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 32201532d..ab33cfde4 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -37,7 +37,7 @@ protected MultipleTestRunsBase(bool supportsExampleResults, IEnumerable + diff --git a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs index 83d6693bd..3230bed6d 100644 --- a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs @@ -12,6 +12,8 @@ public abstract class SingleTestRunBase : ITestResults internal IExampleSignatureBuilder ExampleSignatureBuilder { get; set; } + internal IScenarioOutlineExampleMatcher ScenarioOutlineExampleMatcher { get; set; } + public abstract TestResult GetFeatureResult(Feature feature); public abstract TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline); From 85a9e305786a4c477771a27a0c5b89add4fe982e Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:06:55 +0100 Subject: [PATCH 083/132] NUnit users IScenarioOutlineExampleMatcher --- .../NUnit/NUnit2/NUnit2Results.cs | 2 +- .../NUnit/NUnit2/NUnit2SingleResults.cs | 6 +-- .../NUnit/NUnit3/NUnit3Results.cs | 2 +- .../NUnit/NUnit3/NUnit3SingleResult.cs | 6 +-- .../NUnitScenarioOutlineExampleMatcher.cs | 46 +++++++++++++++++++ .../NUnit/NUnitSingleResultsBase.cs | 6 +-- .../Pickles.TestFrameworks.csproj | 1 + 7 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index f6356981c..8be6c0b28 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 public class NUnit2Results : MultipleTestRunsBase { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new NUnitScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs index fa9a10014..979227bf8 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2SingleResults.cs @@ -81,9 +81,7 @@ protected override XElement GetFeatureElement(Feature feature) .FirstOrDefault(x => x.Attribute("description").Value == feature.Name); } - protected override XElement GetExamplesElement( - ScenarioOutline scenarioOutline, - Regex exampleSignature) + protected override XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values) { XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); XElement examplesElement = null; @@ -97,7 +95,7 @@ protected override XElement GetExamplesElement( { examplesElement = parameterizedTestElement.Descendants("test-case") - .FirstOrDefault(x => IsMatchingTestCase(x, exampleSignature)); + .FirstOrDefault(x => this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, values, x)); } } return examplesElement; diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 8393f1362..f57326f22 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new NUnitScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs index 8c8be6533..0ded1a74b 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3SingleResult.cs @@ -95,9 +95,7 @@ protected override XElement GetFeatureElement(Feature feature) .Any(p => p.Attribute("name").Value == "Description" && p.Attribute("value").Value == feature.Name)); } - protected override XElement GetExamplesElement( - ScenarioOutline scenarioOutline, - Regex exampleSignature) + protected override XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values) { XElement featureElement = this.GetFeatureElement(scenarioOutline.Feature); XElement examplesElement = null; @@ -118,7 +116,7 @@ protected override XElement GetExamplesElement( { examplesElement = parameterizedTestElement.Descendants("test-case") - .FirstOrDefault(x => IsMatchingTestCase(x, exampleSignature)); + .FirstOrDefault(x => this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, values, x)); } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs new file mode 100644 index 000000000..124373240 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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 index f2f4e5600..b32468036 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs @@ -76,7 +76,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str { Regex exampleSignature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - var examplesElement = this.GetExamplesElement(scenarioOutline, exampleSignature); + var examplesElement = this.GetExamplesElement(scenarioOutline, exampleValues); return this.GetResultFromElement(examplesElement); } @@ -130,8 +130,6 @@ private TestResult GetResultFromElement(XElement element) protected abstract XElement GetFeatureElement(Feature feature); - protected abstract XElement GetExamplesElement( - ScenarioOutline scenarioOutline, - Regex exampleSignature); + protected abstract XElement GetExamplesElement(ScenarioOutline scenarioOutline, string[] values); } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 9585db308..47665dd5d 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -74,6 +74,7 @@ results-example-nunit3.xsd + From 9a1d41a8253ad0fa7129efaee3c04886c49f1218 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:07:38 +0100 Subject: [PATCH 084/132] remove blank line --- .../NUnit/NUnitScenarioOutlineExampleMatcher.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs index 124373240..065804aea 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitScenarioOutlineExampleMatcher.cs @@ -29,7 +29,6 @@ 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); From 376cf47f12f59692bb7290eb8e662aac7edb3cbe Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:16:02 +0100 Subject: [PATCH 085/132] XUnit uses IScenarioOutlineExampleMatcher --- .../Pickles.TestFrameworks.csproj | 2 + .../XUnit/XUnit1/XUnit1Results.cs | 2 +- .../XUnit1ScenarioOutlineExampleMatcher.cs | 44 +++++++++++++++++++ .../XUnit/XUnit1/XUnit1SingleResult.cs | 2 +- .../XUnit/XUnit2/XUnit2Results.cs | 2 +- .../XUnit2ScenarioOutlineExampleMatcher.cs | 43 ++++++++++++++++++ .../XUnit/XUnit2/XUnit2SingleResults.cs | 7 +-- 7 files changed, 93 insertions(+), 9 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1ScenarioOutlineExampleMatcher.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2ScenarioOutlineExampleMatcher.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 47665dd5d..b18fbeb97 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -89,7 +89,9 @@ + + diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 32092eaf0..438acecd1 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -28,7 +28,7 @@ public XUnit1Results( IConfiguration configuration, XUnit1SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new XUnit1ScenarioOutlineExampleMatcher()) { } } 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/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 957288874..019825230 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -80,7 +80,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str foreach (XElement exampleElement in exampleElements) { - if (this.ScenarioOutlineExampleIsMatch(signature, exampleElement)) + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, exampleElement)) { return this.GetResultFromElement(exampleElement); } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 058c9b3bd..a9b75e287 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new XUnit2ScenarioOutlineExampleMatcher()) { } } 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/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 98bd64f45..1ef10e995 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -80,7 +80,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str foreach (var exampleElement in exampleElements) { - if (ScenarioOutlineExampleIsMatch(signature, exampleElement)) + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, exampleElement)) { return this.GetResultFromElement(exampleElement); } @@ -89,11 +89,6 @@ public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, str return TestResult.Inconclusive; } - private static bool ScenarioOutlineExampleIsMatch(Regex signature, assembliesAssemblyCollectionTest exampleElement) - { - return signature.IsMatch(exampleElement.name.ToLowerInvariant().Replace(@"\", string.Empty)); - } - private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) { return HasTraitWithValue(test, "Description", description); From c27360a59c4714eaf7e4b00d11d0deb696833e57 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:21:18 +0100 Subject: [PATCH 086/132] Make SpecRun use ScenarioOutlineExampleMatcher --- .../SpecRun/SpecRunResults.cs | 2 +- .../SpecRunScenarioOutlineExampleMatcher.cs | 36 +++++++++++++++++++ .../SpecRun/SpecRunSingleResults.cs | 4 +-- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunScenarioOutlineExampleMatcher.cs diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 09d16be6c..932633d5d 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new SpecRunScenarioOutlineExampleMatcher()) { } } 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/SpecRunSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs index a95cfea37..43d977ccb 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -106,11 +106,9 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e var specRunScenarios = FindSpecRunScenarios(scenario, specRunFeature); - var signature = this.CreateSignatureRegex(scenario, exampleValues); - foreach (var specRunScenario in specRunScenarios) { - if (signature.IsMatch(specRunScenario.Title)) + if (this.ScenarioOutlineExampleMatcher.IsMatch(scenario, exampleValues, specRunScenario)) { return StringToTestResult(specRunScenario.Result); } From 5531df4a1d3e10c9faa60fbfe62a833b1fc9aed0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:28:52 +0100 Subject: [PATCH 087/132] Make MsTest use ScenarioOutlineExampleMatcher --- .../MsTest/MsTestResults.cs | 2 +- .../MsTestScenarioOutlineExampleMatcher.cs | 40 +++++++++++++++++++ .../MsTest/MsTestSingleResults.cs | 8 ++-- .../Pickles.TestFrameworks.csproj | 2 + 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 src/Pickles/Pickles.TestFrameworks/MsTest/MsTestScenarioOutlineExampleMatcher.cs diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index a2c5e87cf..9f414ee2c 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder) + : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new MsTestScenarioOutlineExampleMatcher()) { } } 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/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index f79e96c1c..3c6f4482e 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -142,7 +142,7 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { var scenarioElements = this.GetScenariosForScenarioOutline(scenario); - var theScenario = this.GetScenarioThatMatchesTheExampleValues(exampleValues, scenarioElements); + var theScenario = this.GetScenarioThatMatchesTheExampleValues(scenario, exampleValues, scenarioElements); Guid executionId = theScenario.ExecutionIdElement(); @@ -151,16 +151,16 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e return testResult; } - private XElement GetScenarioThatMatchesTheExampleValues(string[] exampleValues, IEnumerable scenarioElements) + private XElement GetScenarioThatMatchesTheExampleValues(ScenarioOutline scenarioOutline, string[] exampleValues, IEnumerable scenarioElements) { // filter for example values XElement theScenario = null; foreach (var element in scenarioElements) { - var valuesInScenario = element.DetermineValuesInScenario(); + var isMatch = this.ScenarioOutlineExampleMatcher.IsMatch(scenarioOutline, exampleValues, element); - if (exampleValues.OrderBy(e => e).SequenceEqual(valuesInScenario.OrderBy(v => v))) + if (isMatch) { theScenario = element; break; diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index b18fbeb97..7a24d943c 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -61,6 +61,7 @@ + @@ -85,6 +86,7 @@ + From fdb7095d0e5c89848041c29768a35f6736cc6909 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 18 Feb 2016 12:34:07 +0100 Subject: [PATCH 088/132] Get rid of IExampleSignatureBuilder --- .../CucumberJsonExampleSignatureBuilder.cs | 2 +- .../CucumberJson/CucumberJsonResults.cs | 4 +- .../IExampleSignatureBuilder.cs | 31 --------------- .../MsTest/MsTestExampleSignatureBuilder.cs | 2 +- .../MsTest/MsTestResults.cs | 2 +- .../MultipleTestRunsBase.cs | 12 ++---- .../NUnit/NUnit2/NUnit2Results.cs | 4 +- .../NUnit/NUnit3/NUnit3Results.cs | 4 +- .../NUnit/NUnitExampleSignatureBuilder.cs | 2 +- .../NUnit/NUnitSingleResultsBase.cs | 2 - .../Pickles.TestFrameworks.csproj | 1 - .../SingleTestRunBase.cs | 39 ++++++++++--------- .../SpecRun/SpecRunExampleSignatureBuilder.cs | 2 +- .../SpecRun/SpecRunResults.cs | 2 +- .../XUnit/XUnit1/XUnit1Results.cs | 5 +-- .../XUnit/XUnit1/XUnit1SingleResult.cs | 2 - .../XUnit/XUnit2/XUnit2Results.cs | 4 +- .../XUnit/XUnit2/XUnit2SingleResults.cs | 2 - .../XUnit/xUnitExampleSignatureBuilder.cs | 2 +- 19 files changed, 41 insertions(+), 83 deletions(-) delete mode 100644 src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs index a648d3e3d..633329867 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { - public class CucumberJsonExampleSignatureBuilder : IExampleSignatureBuilder + public class CucumberJsonExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index ac8a60992..507d96460 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson { public class CucumberJsonResults : MultipleTestRunsBase { - public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader, CucumberJsonExampleSignatureBuilder exampleSignatureBuilder) - : base(false, configuration, singleResultLoader, exampleSignatureBuilder) + public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) + : base(false, configuration, singleResultLoader) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs deleted file mode 100644 index c04cd5fe3..000000000 --- a/src/Pickles/Pickles.TestFrameworks/IExampleSignatureBuilder.cs +++ /dev/null @@ -1,31 +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.Text.RegularExpressions; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks -{ - public interface IExampleSignatureBuilder - { - Regex Build(ScenarioOutline scenarioOutline, string[] row); - } -} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs index 2c35817d8..52939a02e 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestExampleSignatureBuilder.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { - public class MsTestExampleSignatureBuilder : IExampleSignatureBuilder + public class MsTestExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index 9f414ee2c..f5df87fa4 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new MsTestScenarioOutlineExampleMatcher()) + : base(true, configuration, singleResultLoader, new MsTestScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index ab33cfde4..3628ab0c8 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -37,25 +37,19 @@ protected MultipleTestRunsBase(bool supportsExampleResults, IEnumerable - diff --git a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs index 3230bed6d..c3e36793b 100644 --- a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs @@ -1,6 +1,25 @@ -using System; +// -------------------------------------------------------------------------------------------------------------------- +// +// 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.Text.RegularExpressions; using PicklesDoc.Pickles.ObjectModel; @@ -10,8 +29,6 @@ public abstract class SingleTestRunBase : ITestResults { public abstract bool SupportsExampleResults { get; } - internal IExampleSignatureBuilder ExampleSignatureBuilder { get; set; } - internal IScenarioOutlineExampleMatcher ScenarioOutlineExampleMatcher { get; set; } public abstract TestResult GetFeatureResult(Feature feature); @@ -67,19 +84,5 @@ protected TestResult DetermineAggregateResult(IEnumerable exampleRes return this.GetAggregateResult(passedCount, failedCount, skippedCount); } - - protected Regex CreateSignatureRegex(ScenarioOutline scenarioOutline, string[] exampleValues) - { - var signatureBuilder = this.ExampleSignatureBuilder; - - if (signatureBuilder == null) - { - throw new InvalidOperationException( - "You need to set the ExampleSignatureBuilder before using GetExampleResult."); - } - - Regex signature = signatureBuilder.Build(scenarioOutline, exampleValues); - return signature; - } } } \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs index 55efa49ae..0118113a3 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunExampleSignatureBuilder.cs @@ -26,7 +26,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { - public class SpecRunExampleSignatureBuilder : IExampleSignatureBuilder + public class SpecRunExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 932633d5d..50ba8087f 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new SpecRunScenarioOutlineExampleMatcher()) + : base(true, configuration, singleResultLoader, new SpecRunScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 438acecd1..485da3f01 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -26,9 +26,8 @@ public class XUnit1Results : MultipleTestRunsBase { public XUnit1Results( IConfiguration configuration, - XUnit1SingleResultLoader singleResultLoader, - XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new XUnit1ScenarioOutlineExampleMatcher()) + XUnit1SingleResultLoader singleResultLoader) + : base(true, configuration, singleResultLoader, new XUnit1ScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index 019825230..efe0ebc41 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -74,8 +74,6 @@ public override TestResult GetScenarioResult(Scenario scenario) public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { - var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); foreach (XElement exampleElement in exampleElements) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index a9b75e287..43da385c4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2Results : MultipleTestRunsBase { - public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnitExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, exampleSignatureBuilder, new XUnit2ScenarioOutlineExampleMatcher()) + public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader) + : base(true, configuration, singleResultLoader, new XUnit2ScenarioOutlineExampleMatcher()) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 1ef10e995..33903cad4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -74,8 +74,6 @@ public override TestResult GetScenarioResult(Scenario scenario) public override TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] exampleValues) { - var signature = this.CreateSignatureRegex(scenarioOutline, exampleValues); - IEnumerable exampleElements = this.GetScenarioOutlineElements(scenarioOutline); foreach (var exampleElement in exampleElements) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs index 4a0e0f2be..0b09475f4 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/xUnitExampleSignatureBuilder.cs @@ -26,7 +26,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit { - public class XUnitExampleSignatureBuilder : IExampleSignatureBuilder + public class XUnitExampleSignatureBuilder { public Regex Build(ScenarioOutline scenarioOutline, string[] row) { From 420fdd4ba4a1e737c5addf75d6742e946bea6494 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:14:59 +0100 Subject: [PATCH 089/132] Get the scenarioOutlineExampleMatcher from the constructor parameter --- .../Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs | 5 +++-- .../Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs | 4 ++-- src/Pickles/Pickles/PicklesModule.cs | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 485da3f01..05b07294a 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -26,8 +26,9 @@ public class XUnit1Results : MultipleTestRunsBase { public XUnit1Results( IConfiguration configuration, - XUnit1SingleResultLoader singleResultLoader) - : base(true, configuration, singleResultLoader, new XUnit1ScenarioOutlineExampleMatcher()) + XUnit1SingleResultLoader singleResultLoader, + XUnit1ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index 43da385c4..e997010ee 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 { public class XUnit2Results : MultipleTestRunsBase { - public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader) - : base(true, configuration, singleResultLoader, new XUnit2ScenarioOutlineExampleMatcher()) + public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnit2ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index f7451aff7..2c22c00c0 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -84,9 +84,11 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From e36d8bbe402b41c9984d77a04b857c8cd2ab22e9 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:15:31 +0100 Subject: [PATCH 090/132] Remove XUnitExampleSignatureBuilder from IoC --- .../XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs | 4 +--- .../XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs | 4 +--- src/Pickles/Pickles/PicklesModule.cs | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs index e63b41a14..82bd74b7b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenDeterminingTheSignatureOfAnXUnitExampleRow.cs @@ -21,8 +21,6 @@ using System; using System.Text.RegularExpressions; -using Autofac; - using NFluent; using NUnit.Framework; @@ -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/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs index 5f917f836..5baf10e2b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenDeterminingTheSignatureOfAnXUnit2ExampleRow.cs @@ -21,8 +21,6 @@ using System; using System.Text.RegularExpressions; -using Autofac; - using NFluent; using NUnit.Framework; @@ -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/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 2c22c00c0..2a28342e7 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -85,7 +85,6 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From f4b5418d1e8c302d0c08f9facde3e1e2fbe6172d Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:17:39 +0100 Subject: [PATCH 091/132] Retrieve ScenarioOutlineExampleMatcher from IoC and remove signature matcher --- src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs | 4 ++-- src/Pickles/Pickles/PicklesModule.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index 50ba8087f..f7cd6ac45 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun { public class SpecRunResults : MultipleTestRunsBase { - public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, new SpecRunScenarioOutlineExampleMatcher()) + public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 2a28342e7..da5d35970 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -96,7 +96,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.Register(c => { From 5851a05569264379efe4004eb6db1dbd5486370b Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:20:14 +0100 Subject: [PATCH 092/132] The same for NUnit --- .../NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs | 2 +- .../NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs | 2 +- .../Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs | 4 ++-- .../Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs | 4 ++-- src/Pickles/Pickles/PicklesModule.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs index bdac53b23..4610cddaf 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenDeterminingTheSignatureOfAnNUnitExampleRow.cs @@ -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/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs index 6e8edfc92..e7e96aa64 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenDeterminingTheSignatureOfAnNunit3ExampleRow.cs @@ -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/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index f88dfab7f..ed9407ddd 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 { public class NUnit2Results : MultipleTestRunsBase { - public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader) - : base(true, configuration, singleResultLoader, new NUnitScenarioOutlineExampleMatcher()) + public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index 32bba758e..e484647e2 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 { public class NUnit3Results : MultipleTestRunsBase { - public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader) - : base(true, configuration, singleResultLoader, new NUnitScenarioOutlineExampleMatcher()) + public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index da5d35970..bae879789 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -79,7 +79,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From a89e27bfbf5aa63fd1eb0af9ba4a11531f41aebf Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:22:13 +0100 Subject: [PATCH 093/132] The same for MsTest --- ...CreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs | 2 +- src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs | 4 ++-- src/Pickles/Pickles/PicklesModule.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs b/src/Pickles/Pickles.Test/Formatters/JSON/WhenCreatingAFeatureWithMetaInfoAndTestResultInMstestFormat.cs index 51bbb33d6..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, new MsTestSingleResultLoader(), new MsTestExampleSignatureBuilder()); + 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.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index f5df87fa4..ed9d0ac9b 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -24,8 +24,8 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest { public class MsTestResults : MultipleTestRunsBase { - public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestExampleSignatureBuilder exampleSignatureBuilder) - : base(true, configuration, singleResultLoader, new MsTestScenarioOutlineExampleMatcher()) + public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) + : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index bae879789..bfffd3828 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -90,7 +90,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From b9ea29d6935bae2e97f9418591702f1eb4270e84 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Fri, 19 Feb 2016 12:53:31 +0100 Subject: [PATCH 094/132] Add entry to change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5acb9563b..1c1867f81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Added - 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)). + ### Fixed From af9736b406137b07ddb4a30f860bb6f3682217d2 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 14:26:32 +0100 Subject: [PATCH 095/132] Rename SpecRun --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ------------ From cbee3093bbef2af82839e19f7b98379378217d98 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 14:47:14 +0100 Subject: [PATCH 096/132] Replace the Cucumber JSON results file --- .../CucumberJson/results-example-json.json | 1244 ++++++++++++++++- 1 file changed, 1207 insertions(+), 37 deletions(-) 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..623a022ce 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,521 @@ [ { - "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": "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": "@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:10" + }, + "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:16" + }, + "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": "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:10" + }, + "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:16" + }, + "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;add-two-numbers", "keyword": "Scenario", - "id": "one-passing-scenario,-one-failing-scenario;passing", - "name": "Passing", - "line": 5, + "name": "Add two numbers", "description": "", + "line": 23, + "type": "scenario", "tags": [ { - "name": "@b", - "line": 4 + "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": 1009000 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 26, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "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:16" + }, + "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": 1002000 + } + } + ] + }, + { + "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": "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/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 33, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "the result should be 3.2 on the screen", + "line": 34, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:16" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "keyword": "Background", + "name": "", + "description": "", + "line": 6, + "type": "background", "steps": [ { "keyword": "Given ", - "name": "a passing step", - "line": 6, + "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;ignored-adding-two-numbers", "keyword": "Scenario", - "id": "one-passing-scenario,-one-failing-scenario;failing", - "name": "Failing", - "line": 9, + "name": "Ignored adding two numbers", "description": "", + "line": 37, + "type": "scenario", "tags": [ { - "name": "@c", - "line": 8 + "name": "@ignore", + "line": 36 } ], + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 1 into the calculator", + "line": 38, + "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": 39, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 40, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "the result should be 3.2 on the screen", + "line": 41, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:16" + }, + "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;not-automated-adding-two-numbers", + "keyword": "Scenario", + "name": "Not automated adding two numbers", + "description": "", + "line": 43, "type": "scenario", "steps": [ { "keyword": "Given ", - "name": "a failing step", - "line": 10, + "name": "unimplemented step", + "line": 44, "match": { - "location": "features/step_definitions/steps.rb:5" + "location": "features/Addition.feature:44" }, "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'" + "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 +523,734 @@ ] }, { - "uri": "features/no_scenarios.feature", + "uri": "features/Minimal Features/Failing.feature", + "id": "failing", "keyword": "Feature", - "id": "no-scenarios", - "name": "Feature Without Scenarios", - "line": 2, + "name": "Failing", "description": "", - "tags": [ + "line": 1, + "elements": [ { - "name": "@a", - "line": 1 + "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": 1000000 + } + } + ] + }, + { + "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": 13004000 + } + } + ] + } + ] + }, + { + "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": 1000000 + } + } + ] + }, + { + "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": 1000000 + } + } + ] + }, + { + "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": 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": 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 + } + } + ] } ] } From 98fdf1595d0de2c1f85848b0d362b629c845b28d Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 14:47:29 +0100 Subject: [PATCH 097/132] Use standard test suite for Cucumber JSON --- .../WhenParsingCucumberJsonResultsFile.cs | 77 +++++++++++++------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs index 3aba77970..a5e6f99b0 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs @@ -20,19 +20,14 @@ using System; -using NFluent; - using NUnit.Framework; -using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; -using Feature = PicklesDoc.Pickles.ObjectModel.Feature; - namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] - public class WhenParsingCucumberJsonResultsFile : WhenParsingTestResultFiles + public class WhenParsingCucumberJsonResultsFile : StandardTestSuite { public WhenParsingCucumberJsonResultsFile() : base("CucumberJson." + "results-example-json.json") @@ -40,43 +35,75 @@ public WhenParsingCucumberJsonResultsFile() } [Test] - public void ThenCanReadFeatureResultSuccessfully() + public new void ThenCanReadFeatureResultSuccessfully() { - var results = ParseResultsFile(); + base.ThenCanReadFeatureResultSuccessfully(); + } - var feature = new Feature { Name = "Test Feature" }; - TestResult result = results.GetFeatureResult(feature); + [Test] + public new void ThenCanReadScenarioOutlineResultSuccessfully() + { + base.ThenCanReadScenarioOutlineResultSuccessfully(); + } - Check.That(result).IsEqualTo(TestResult.Failed); + [Test] + public new void ThenCanReadSuccessfulScenarioResultSuccessfully() + { + base.ThenCanReadSuccessfulScenarioResultSuccessfully(); } [Test] - public void ThenCanReadScenarioResultSuccessfully() + public new void ThenCanReadFailedScenarioResultSuccessfully() { - var results = ParseResultsFile(); + base.ThenCanReadFailedScenarioResultSuccessfully(); + } - var feature = new Feature { Name = "Test Feature" }; + [Test] + public new void ThenCanReadIgnoredScenarioResultSuccessfully() + { + base.ThenCanReadIgnoredScenarioResultSuccessfully(); + } - var scenario1 = new Scenario { Name = "Passing", Feature = feature }; - TestResult result1 = results.GetScenarioResult(scenario1); + [Test] + public new void ThenCanReadInconclusiveScenarioResultSuccessfully() + { + base.ThenCanReadInconclusiveScenarioResultSuccessfully(); + } - Check.That(result1).IsEqualTo(TestResult.Passed); + [Test] + public new void ThenCanReadInconclusiveFeatureResultSuccessfully() + { + base.ThenCanReadInconclusiveFeatureResultSuccessfully(); + } - var scenario2 = new Scenario { Name = "Failing", Feature = feature }; - TestResult result2 = results.GetScenarioResult(scenario2); + [Test] + public new void ThenCanReadPassedFeatureResultSuccessfully() + { + base.ThenCanReadPassedFeatureResultSuccessfully(); + } - Check.That(result2).IsEqualTo(TestResult.Failed); + [Test] + public new void ThenCanReadFailedFeatureResultSuccessfully() + { + base.ThenCanReadFailedFeatureResultSuccessfully(); } [Test] - public void ThenCanReadFeatureWithoutScenariosSuccessfully_ShouldReturnInconclusive() + public new void ThenCanReadNotFoundScenarioCorrectly() { - var results = ParseResultsFile(); - var feature = new Feature { Name = "Feature Without Scenarios" }; + base.ThenCanReadNotFoundScenarioCorrectly(); + } - TestResult result = results.GetFeatureResult(feature); + [Test] + public new void ThenCanReadNotFoundFeatureCorrectly() + { + base.ThenCanReadNotFoundFeatureCorrectly(); + } - Check.That(result).IsEqualTo(TestResult.Inconclusive); + [Test] + public new void ThenCanReadResultsWithBackslashes() + { + base.ThenCanReadResultsWithBackslashes(); } } } From adb077131c90994c1b3c7efec92a4ee950a55511 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:10:46 +0100 Subject: [PATCH 098/132] Correct the result file --- .../CucumberJson/results-example-json.json | 2472 ++++++++--------- 1 file changed, 1233 insertions(+), 1239 deletions(-) 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 623a022ce..e3f42a654 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -1,1257 +1,1251 @@ [ - { - "uri": "features/Addition.feature", - "id": "addition", - "keyword": "Feature", - "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": "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 + { + "uri": "features/Addition.feature", + "id": "addition", + "keyword": "Feature", + "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": "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": "@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:10" + }, + "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:16" + }, + "result": { + "status": "passed", + "duration": 901000 + } + } + ] + }, + { + "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": "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": 1000000 + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 20, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "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:16" + }, + "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;add-two-numbers", + "keyword": "Scenario", + "name": "Add two numbers", + "description": "", + "line": 23, + "type": "scenario", + "tags": [ + { + "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:10" + }, + "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:16" + }, + "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": "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/Addition.feature:32" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 33, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 3.2 on the screen", + "line": 34, + "match": { + "location": "features/Addition.feature:34" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "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;ignored-adding-two-numbers", + "keyword": "Scenario", + "name": "Ignored adding two numbers", + "description": "", + "line": 37, + "type": "scenario", + "tags": [ + { + "name": "@ignore", + "line": 36 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 1 into the calculator", + "line": 38, + "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": 39, + "match": { + "location": "features/Addition.feature:39" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 40, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:10" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 3.2 on the screen", + "line": 41, + "match": { + "location": "features/Addition.feature:41" + }, + "result": { + "status": "undefined" + } + } + ] + }, + { + "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" + } + } + ] } - } ] - }, - { - "id": "addition;adding-several-numbers;;2", - "keyword": "Scenario Outline", - "name": "Adding several numbers", + }, + { + "uri": "features/Minimal Features/Failing.feature", + "id": "failing", + "keyword": "Feature", + "name": "Failing", "description": "", - "line": 19, - "type": "scenario", - "tags": [ - { - "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:10" - }, - "result": { - "status": "passed", - "duration": 0 + "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": 13013000 + } + } + ] } - }, - { - "keyword": "Then ", - "name": "the result should be 260 on the screen", - "line": 19, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" - }, - "result": { - "status": "passed", - "duration": 999000 - } - } ] - }, - { - "keyword": "Background", - "name": "", + }, + { + "uri": "features/Minimal Features/Inconclusive.feature", + "id": "inconclusive", + "keyword": "Feature", + "name": "Inconclusive", "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 + "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": 499000 + } + } + ] } - } ] - }, - { - "id": "addition;adding-several-numbers;;3", - "keyword": "Scenario Outline", - "name": "Adding several numbers", + }, + { + "uri": "features/Minimal Features/Passing.feature", + "id": "passing", + "keyword": "Feature", + "name": "Passing", "description": "", - "line": 20, - "type": "scenario", - "tags": [ - { - "name": "@tag2", - "line": 9 - } - ], - "steps": [ - { - "keyword": "Given ", - "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:10" - }, - "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:16" - }, - "result": { - "status": "passed", - "duration": 0 + "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 + } + } + ] } - } ] - }, - { - "keyword": "Background", - "name": "", + }, + { + "uri": "features/NotAutomatedAtAll.feature", + "id": "not-automated-at-all", + "keyword": "Feature", + "name": "Not Automated At All", "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 + "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" + } + } + ] } - } ] - }, - { - "id": "addition;add-two-numbers", - "keyword": "Scenario", - "name": "Add two numbers", - "description": "", - "line": 23, - "type": "scenario", - "tags": [ - { - "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": 1009000 - } - }, - { - "keyword": "When ", - "name": "I press add", - "line": 26, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" - }, - "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:16" - }, - "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": 1002000 - } - } - ] - }, - { - "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": "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/AdditionSteps.rb:6" - }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "When ", - "name": "I press add", - "line": 33, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" - }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "Then ", - "name": "the result should be 3.2 on the screen", - "line": 34, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" - }, - "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;ignored-adding-two-numbers", - "keyword": "Scenario", - "name": "Ignored adding two numbers", - "description": "", - "line": 37, - "type": "scenario", - "tags": [ - { - "name": "@ignore", - "line": 36 - } - ], - "steps": [ - { - "keyword": "Given ", - "name": "I have entered 1 into the calculator", - "line": 38, - "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": 39, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:6" - }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "When ", - "name": "I press add", - "line": 40, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" - }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "Then ", - "name": "the result should be 3.2 on the screen", - "line": 41, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" - }, - "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;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" - } - } - ] - } - ] - }, - { - "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": 1000000 - } - } - ] - }, - { - "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": 13004000 - } - } - ] - } - ] - }, - { - "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": 1000000 - } - } - ] - }, - { - "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": 1000000 - } - } - ] - }, - { - "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": 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": 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 + }, + { + "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": 493000 + } + } + ] + }, + { + "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": 498000 + } + } + ] + }, + { + "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": 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": 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 + } + } + ] } - } ] - } - ] - } + } ] \ No newline at end of file From be52db54b32f67cd47b5367bcd2a1ebfed1dd7e0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:11:54 +0100 Subject: [PATCH 099/132] Be able to deal with inconclusive results --- .../CucumberJson/CucumberJsonSingleResults.cs | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 3d64be1ee..062797072 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -37,7 +38,10 @@ public CucumberJsonSingleResults(IEnumerable cucumberFeatures) public override bool SupportsExampleResults { - get { return false; } + get + { + return false; + } } public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) @@ -64,19 +68,46 @@ private TestResult GetResultFromFeature(Feature cucumberFeature) return TestResult.Inconclusive; } - bool wasSuccessful = cucumberFeature.elements.All(this.DoAllStepsPass); + return ToTestResult(cucumberFeature); + } - return ConvertBooleanToTestResult(wasSuccessful); + private TestResult ToTestResult(Feature feature) + { + return feature.elements.Select(ToTestResult).Merge(); } - private bool DoAllStepsPass(Element cucumberScenario) + private TestResult ToTestResult(Element scenario) { - return cucumberScenario.steps.All(x => x.result.status == "passed"); + return scenario.steps.Select(ToTestResult).Merge(); } - private static TestResult ConvertBooleanToTestResult(bool wasSuccessful) + private TestResult ToTestResult(Step step) { - return wasSuccessful ? TestResult.Passed : TestResult.Failed; + return ToTestResult(step.result.status); + } + + private TestResult ToTestResult(string cucumberResult) + { + switch (cucumberResult) + { + default: + case "skipped": + case "undefined": + case "pending": + { + return TestResult.Inconclusive; + } + + case "failed": + { + return TestResult.Failed; + } + + case "passed": + { + return TestResult.Passed; + } + } } public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) @@ -111,9 +142,8 @@ private TestResult GetResultFromScenario(Element cucumberScenario) return TestResult.Inconclusive; } - bool wasSuccessful = this.DoAllStepsPass(cucumberScenario); - return ConvertBooleanToTestResult(wasSuccessful); + return ToTestResult(cucumberScenario); } } } From 61e89454e407ab202037ca38f70130415aa23c03 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:19:33 +0100 Subject: [PATCH 100/132] Correct the results file once more --- .../CucumberJson/results-example-json.json | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) 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 e3f42a654..21a15484b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -99,7 +99,7 @@ }, "result": { "status": "passed", - "duration": 901000 + "duration": 999000 } } ] @@ -172,7 +172,7 @@ }, "result": { "status": "passed", - "duration": 1000000 + "duration": 0 } }, { @@ -196,7 +196,7 @@ }, "result": { "status": "passed", - "duration": 0 + "duration": 499000 } } ] @@ -302,7 +302,7 @@ }, "result": { "status": "passed", - "duration": 0 + "duration": 500000 } } ] @@ -338,10 +338,11 @@ "name": "I have entered 2.2 into the calculator", "line": 32, "match": { - "location": "features/Addition.feature:32" + "location": "features/step_definitions/AdditionSteps.rb:6" }, "result": { - "status": "undefined" + "status": "passed", + "duration": 0 } }, { @@ -352,7 +353,8 @@ "location": "features/step_definitions/AdditionSteps.rb:10" }, "result": { - "status": "skipped" + "status": "passed", + "duration": 0 } }, { @@ -360,10 +362,12 @@ "name": "the result should be 3.2 on the screen", "line": 34, "match": { - "location": "features/Addition.feature:34" + "location": "features/step_definitions/AdditionSteps.rb:16" }, "result": { - "status": "undefined" + "status": "failed", + "error_message": "\nexpected: \"3.2\"\n got: \"3\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:17:in `/^the result should be (.*) on the screen$/'\nfeatures/Addition.feature:34:in `Then the result should be 3.2 on the screen", + "duration": 12491000 } } ] @@ -420,10 +424,11 @@ "name": "I have entered 2.2 into the calculator", "line": 39, "match": { - "location": "features/Addition.feature:39" + "location": "features/step_definitions/AdditionSteps.rb:6" }, "result": { - "status": "undefined" + "status": "passed", + "duration": 0 } }, { @@ -434,7 +439,8 @@ "location": "features/step_definitions/AdditionSteps.rb:10" }, "result": { - "status": "skipped" + "status": "passed", + "duration": 0 } }, { @@ -442,10 +448,12 @@ "name": "the result should be 3.2 on the screen", "line": 41, "match": { - "location": "features/Addition.feature:41" + "location": "features/step_definitions/AdditionSteps.rb:16" }, "result": { - "status": "undefined" + "status": "failed", + "error_message": "\nexpected: \"3.2\"\n got: \"3\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:17:in `/^the result should be (.*) on the screen$/'\nfeatures/Addition.feature:41:in `Then the result should be 3.2 on the screen", + "duration": 500000 } } ] @@ -587,7 +595,7 @@ "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": 13013000 + "duration": 510000 } } ] @@ -642,7 +650,7 @@ "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": 499000 + "duration": 501000 } } ] @@ -1016,7 +1024,7 @@ "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": 493000 + "duration": 0 } } ] @@ -1038,7 +1046,7 @@ }, "result": { "status": "passed", - "duration": 498000 + "duration": 0 } } ] From 5a3cf4e3f5633217c53076612a1def5e5ddb3fe7 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:46:26 +0100 Subject: [PATCH 101/132] update results file --- .../CucumberJson/results-example-json.json | 128 +++--------------- 1 file changed, 20 insertions(+), 108 deletions(-) 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 21a15484b..13c84d1de 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -83,7 +83,7 @@ "name": "I press add", "line": 19, "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" + "location": "features/step_definitions/AdditionSteps.rb:14" }, "result": { "status": "passed", @@ -95,11 +95,11 @@ "name": "the result should be 260 on the screen", "line": 19, "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" + "location": "features/step_definitions/AdditionSteps.rb:20" }, "result": { "status": "passed", - "duration": 999000 + "duration": 1001000 } } ] @@ -180,7 +180,7 @@ "name": "I press add", "line": 20, "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" + "location": "features/step_definitions/AdditionSteps.rb:14" }, "result": { "status": "passed", @@ -192,11 +192,11 @@ "name": "the result should be 180 on the screen", "line": 20, "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" + "location": "features/step_definitions/AdditionSteps.rb:20" }, "result": { "status": "passed", - "duration": 499000 + "duration": 0 } } ] @@ -265,7 +265,7 @@ "name": "I press add", "line": 26, "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" + "location": "features/step_definitions/AdditionSteps.rb:14" }, "result": { "status": "passed", @@ -277,7 +277,7 @@ "name": "the result should be 3 on the screen", "line": 27, "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" + "location": "features/step_definitions/AdditionSteps.rb:20" }, "result": { "status": "passed", @@ -302,7 +302,7 @@ }, "result": { "status": "passed", - "duration": 500000 + "duration": 0 } } ] @@ -337,123 +337,35 @@ "keyword": "And ", "name": "I have entered 2.2 into the calculator", "line": 32, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:6" - }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "When ", - "name": "I press add", - "line": 33, "match": { "location": "features/step_definitions/AdditionSteps.rb:10" }, - "result": { - "status": "passed", - "duration": 0 - } - }, - { - "keyword": "Then ", - "name": "the result should be 3.2 on the screen", - "line": 34, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" - }, "result": { "status": "failed", - "error_message": "\nexpected: \"3.2\"\n got: \"3\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:17:in `/^the result should be (.*) on the screen$/'\nfeatures/Addition.feature:34:in `Then the result should be 3.2 on the screen", - "duration": 12491000 - } - } - ] - }, - { - "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;ignored-adding-two-numbers", - "keyword": "Scenario", - "name": "Ignored adding two numbers", - "description": "", - "line": 37, - "type": "scenario", - "tags": [ - { - "name": "@ignore", - "line": 36 - } - ], - "steps": [ - { - "keyword": "Given ", - "name": "I have entered 1 into the calculator", - "line": 38, - "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": 39, - "match": { - "location": "features/step_definitions/AdditionSteps.rb:6" - }, - "result": { - "status": "passed", - "duration": 0 + "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": 13994000 } }, { "keyword": "When ", "name": "I press add", - "line": 40, + "line": 33, "match": { - "location": "features/step_definitions/AdditionSteps.rb:10" + "location": "features/step_definitions/AdditionSteps.rb:14" }, "result": { - "status": "passed", - "duration": 0 + "status": "skipped" } }, { "keyword": "Then ", "name": "the result should be 3.2 on the screen", - "line": 41, + "line": 34, "match": { - "location": "features/step_definitions/AdditionSteps.rb:16" + "location": "features/step_definitions/AdditionSteps.rb:24" }, "result": { - "status": "failed", - "error_message": "\nexpected: \"3.2\"\n got: \"3\"\n\n(compared using eql?)\n (RSpec::Expectations::ExpectationNotMetError)\n./features/step_definitions/AdditionSteps.rb:17:in `/^the result should be (.*) on the screen$/'\nfeatures/Addition.feature:41:in `Then the result should be 3.2 on the screen", - "duration": 500000 + "status": "skipped" } } ] @@ -595,7 +507,7 @@ "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": 510000 + "duration": 0 } } ] @@ -650,7 +562,7 @@ "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": 501000 + "duration": 0 } } ] @@ -1091,7 +1003,7 @@ "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 + "duration": 1001000 } } ] From ab1188f61991ef52e457941866f92c43d87a665c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:46:52 +0100 Subject: [PATCH 102/132] Add test suite for scenario outlines --- ...berJsonResultsFileWithIndividualResults.cs | 61 +++++++++++++++++++ .../Pickles.TestFrameworks.UnitTests.csproj | 1 + 2 files changed, 62 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs new file mode 100644 index 000000000..bcea76966 --- /dev/null +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.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 WhenParsingCucumberJsonResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + { + public WhenParsingCucumberJsonResultsFileWithIndividualResults() + : 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/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 817151460..5bc2a2abb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -59,6 +59,7 @@ + From 70e3b4cc5b361759fa9d281831a10fb51649d5f6 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 15:48:12 +0100 Subject: [PATCH 103/132] Declare our support for scenario outline examples --- .../Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs | 2 +- .../CucumberJson/CucumberJsonSingleResults.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index 507d96460..d9d4a45ae 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson public class CucumberJsonResults : MultipleTestRunsBase { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) - : base(false, configuration, singleResultLoader) + : base(true, configuration, singleResultLoader) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 062797072..79a0546cf 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -20,7 +20,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using PicklesDoc.Pickles.ObjectModel; @@ -40,7 +39,7 @@ public override bool SupportsExampleResults { get { - return false; + return true; } } From c31ee6dcdabaa15b115fb6e00a033ed42af430fd Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 16:08:37 +0100 Subject: [PATCH 104/132] Enable dealing with scenario outlines and examples --- .../CucumberJson/CucumberJsonSingleResults.cs | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 79a0546cf..b59ca1b33 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -45,7 +45,22 @@ public override bool SupportsExampleResults public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { - throw new NotSupportedException(); + var cucumberScenarios = this.GetCucumberScenarios(scenario); + + var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs, exampleValues)) + .Select(ToTestResult); + + return query.FirstOrDefault(); + } + + private bool ScenarioHasStepsForAllExampleValues(Element cucumberScenario, string[] exampleValues) + { + return exampleValues.All(exampleValue => this.ScenarioHasAStepWithThisExampleValue(cucumberScenario, exampleValue)); + } + + private bool ScenarioHasAStepWithThisExampleValue(Element cucumberScenario, string exampleValue) + { + return cucumberScenario.steps.Any(step => step.name.Contains(exampleValue)); } public override TestResult GetFeatureResult(ObjectModel.Feature feature) @@ -111,10 +126,12 @@ private TestResult ToTestResult(string cucumberResult) public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutline) { - // Not applicable - return TestResult.Inconclusive; + var cucumberScenarios = this.GetCucumberScenarios(scenarioOutline); + + return cucumberScenarios.Select(ToTestResult).Merge(); } + public override TestResult GetScenarioResult(Scenario scenario) { var cucumberScenario = this.GetCucumberScenario(scenario); @@ -134,6 +151,18 @@ private Element GetCucumberScenario(Scenario scenario) return cucumberScenario; } + private IEnumerable GetCucumberScenarios(ScenarioOutline scenarioOutline) + { + IEnumerable cucumberScenarios = null; + var cucumberFeature = this.GetCucumberFeature(scenarioOutline.Feature); + if (cucumberFeature != null) + { + cucumberScenarios = cucumberFeature.elements.Where(x => x.name == scenarioOutline.Name); + } + + return cucumberScenarios; + } + private TestResult GetResultFromScenario(Element cucumberScenario) { if (cucumberScenario == null) From c236779bf2eb279ff2496ce409d4b000e5227a02 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 16:18:01 +0100 Subject: [PATCH 105/132] Remove ITestResults.SupportsExampleResults --- .../ObjectModel/ITestResults.cs | 2 -- .../HTML/WhenFormattingStep.cs | 5 ++++- .../HtmlScenarioOutlineFormatterTests.cs | 1 - .../CucumberJson/CucumberJsonSingleResults.cs | 8 ------- .../MsTest/MsTestSingleResults.cs | 5 ----- .../NUnit/NUnitSingleResultsBase.cs | 5 ----- .../SingleTestRunBase.cs | 2 -- .../SpecRun/SpecRunSingleResults.cs | 5 ----- .../XUnit/XUnit1/XUnit1SingleResult.cs | 5 ----- .../XUnit/XUnit2/XUnit2SingleResults.cs | 5 ----- .../HTML/HtmlImageResultFormatter.cs | 2 +- .../HTML/HtmlScenarioOutlineFormatter.cs | 2 +- .../HTML/HtmlTableFormatter.cs | 15 ++++++------- src/Pickles/Pickles/Runner.cs | 21 ++++++------------- 14 files changed, 18 insertions(+), 65 deletions(-) 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.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/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.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index b59ca1b33..994185a02 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -35,14 +35,6 @@ public CucumberJsonSingleResults(IEnumerable cucumberFeatures) this.resultsDocument = cucumberFeatures.ToList(); } - public override bool SupportsExampleResults - { - get - { - return true; - } - } - public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues) { var cucumberScenarios = this.GetCucumberScenarios(scenario); diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 3c6f4482e..06cab4a8f 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -49,11 +49,6 @@ public MsTestSingleResults(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public override bool SupportsExampleResults - { - get { return true; } - } - public override TestResult GetFeatureResult(Feature feature) { var scenarios = this.GetScenariosForFeature(feature); diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs index 8b5defe7a..9f7e362a6 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnitSingleResultsBase.cs @@ -36,11 +36,6 @@ protected NUnitSingleResultsBase(XDocument resultsDocument, TestResultAndName[] this.testResultAndNames = testResultAndNames; } - public override bool SupportsExampleResults - { - get { return true; } - } - protected XDocument resultsDocument { get; } public override TestResult GetFeatureResult(Feature feature) diff --git a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs index c3e36793b..82b23b8a5 100644 --- a/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/SingleTestRunBase.cs @@ -27,8 +27,6 @@ namespace PicklesDoc.Pickles.TestFrameworks { public abstract class SingleTestRunBase : ITestResults { - public abstract bool SupportsExampleResults { get; } - internal IScenarioOutlineExampleMatcher ScenarioOutlineExampleMatcher { get; set; } public abstract TestResult GetFeatureResult(Feature feature); diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs index 43d977ccb..7563f8f24 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunSingleResults.cs @@ -35,11 +35,6 @@ public SpecRunSingleResults(IEnumerable specRunFeatures) this.specRunFeatures = specRunFeatures.ToList(); } - public override bool SupportsExampleResults - { - get { return true; } - } - public override TestResult GetFeatureResult(Feature feature) { var specRunFeature = this.FindSpecRunFeature(feature); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs index efe0ebc41..59a3d2dda 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1SingleResult.cs @@ -37,11 +37,6 @@ public XUnit1SingleResult(XDocument resultsDocument) this.resultsDocument = resultsDocument; } - public override bool SupportsExampleResults - { - get { return true; } - } - public override TestResult GetFeatureResult(Feature feature) { XElement featureElement = this.GetFeatureElement(feature); diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs index 33903cad4..f50d1c87c 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2SingleResults.cs @@ -36,11 +36,6 @@ public XUnit2SingleResults(assemblies resultsDocument) this.resultsDocument = resultsDocument; } - public override bool SupportsExampleResults - { - get { return true; } - } - public override TestResult GetFeatureResult(Feature feature) { var featureElement = this.GetFeatureElement(feature); diff --git a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlImageResultFormatter.cs b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlImageResultFormatter.cs index 65a003f54..2094bed1f 100644 --- a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlImageResultFormatter.cs +++ b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlImageResultFormatter.cs @@ -152,7 +152,7 @@ public XElement Format(ScenarioOutline scenarioOutline) public XElement Format(ScenarioOutline scenarioOutline, params string[] exampleValues) { - if (this.configuration.HasTestResults && this.results.SupportsExampleResults) + if (this.configuration.HasTestResults) { TestResult exampleResult = this.results.GetExampleResult(scenarioOutline, exampleValues); diff --git a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlScenarioOutlineFormatter.cs b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlScenarioOutlineFormatter.cs index 1a797a1ad..901e9d5fe 100644 --- a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlScenarioOutlineFormatter.cs +++ b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlScenarioOutlineFormatter.cs @@ -103,7 +103,7 @@ private XElement FormatExamples(ScenarioOutline scenarioOutline) new XAttribute("class", "examples"), new XElement(this.xmlns + "h3", "Examples: " + example.Name), this.htmlDescriptionFormatter.Format(example.Description), - (example.TableArgument == null) ? null : this.htmlTableFormatter.Format(example.TableArgument, scenarioOutline, this.testResults.SupportsExampleResults))); + (example.TableArgument == null) ? null : this.htmlTableFormatter.Format(example.TableArgument, scenarioOutline))); } return exampleDiv; diff --git a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlTableFormatter.cs b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlTableFormatter.cs index 8c4bbe93b..6ac532a21 100644 --- a/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlTableFormatter.cs +++ b/src/Pickles/Pickles/DocumentationBuilders/HTML/HtmlTableFormatter.cs @@ -39,10 +39,10 @@ public HtmlTableFormatter(HtmlImageResultFormatter htmlImageResultFormatter) public XElement Format(Table table) { - return this.Format(table, null, false); + return this.Format(table, null); } - public XElement Format(Table table, ScenarioOutline scenarioOutline, bool includeResults) + public XElement Format(Table table, ScenarioOutline scenarioOutline) { if (table == null) { @@ -51,10 +51,7 @@ public XElement Format(Table table, ScenarioOutline scenarioOutline, bool includ var headerCells = table.HeaderRow.Cells.ToArray(); - if (includeResults) - { - headerCells = headerCells.Concat(new[] { " " }).ToArray(); - } + headerCells = headerCells.Concat(new[] { " " }).ToArray(); return new XElement( this.xmlns + "div", @@ -70,10 +67,10 @@ public XElement Format(Table table, ScenarioOutline scenarioOutline, bool includ cell => new XElement(this.xmlns + "th", cell)))), new XElement( this.xmlns + "tbody", - table.DataRows.Select(row => this.FormatRow(row, scenarioOutline, includeResults))))); + table.DataRows.Select(row => this.FormatRow(row, scenarioOutline))))); } - private XElement FormatRow(TableRow row, ScenarioOutline scenarioOutline, bool includeResults) + private XElement FormatRow(TableRow row, ScenarioOutline scenarioOutline) { var formattedCells = row.Cells.Select( cell => @@ -81,7 +78,7 @@ private XElement FormatRow(TableRow row, ScenarioOutline scenarioOutline, bool i this.xmlns + "td", cell)).ToList(); - if (includeResults && scenarioOutline != null) + if (scenarioOutline != null) { formattedCells.Add( new XElement(this.xmlns + "td", this.htmlImageResultFormatter.Format(scenarioOutline, row.Cells.ToArray()))); diff --git a/src/Pickles/Pickles/Runner.cs b/src/Pickles/Pickles/Runner.cs index 36e40e902..4cfbc1f59 100644 --- a/src/Pickles/Pickles/Runner.cs +++ b/src/Pickles/Pickles/Runner.cs @@ -109,24 +109,15 @@ private static void SetResultsForIndividualScenariosUnderFeature(FeatureNode fea if (scenarioOutline != null) { - if (testResults.SupportsExampleResults) + foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows)) { - foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows)) - { - example.Result = testResults.GetExampleResult(scenarioOutline, example.Cells.ToArray()); - } - - scenarioOutline.Result = - scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows) - .Select(row => row.Result) - .Merge(); - } - else - { - featureElement.Result = testResults.GetScenarioOutlineResult(scenarioOutline); + example.Result = testResults.GetExampleResult(scenarioOutline, example.Cells.ToArray()); } - continue; + scenarioOutline.Result = + scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows) + .Select(row => row.Result) + .Merge(); } } } From f29bb5a9193a783f34b754bab3a34a39394b1e64 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 16:20:18 +0100 Subject: [PATCH 106/132] Remove MultipleTestRunsBase.SupportsExampleResults --- .../WhenParsingMultipleTestResultsTests.cs | 2 +- .../CucumberJson/CucumberJsonResults.cs | 2 +- .../MsTest/MsTestResults.cs | 2 +- .../MultipleTestRunsBase.cs | 19 ++++--------------- .../NUnit/NUnit2/NUnit2Results.cs | 2 +- .../NUnit/NUnit3/NUnit3Results.cs | 2 +- .../SpecRun/SpecRunResults.cs | 2 +- .../XUnit/XUnit1/XUnit1Results.cs | 2 +- .../XUnit/XUnit2/XUnit2Results.cs | 2 +- 9 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs index 007fe9dc0..0b323fbab 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingMultipleTestResultsTests.cs @@ -58,7 +58,7 @@ private static MultipleTestRunsBase CreateMultipleTestResults(SingleTestRunBase private class TestableMultipleTestResults : MultipleTestRunsBase { public TestableMultipleTestResults(IEnumerable testResults) - : base(false, testResults) + : base(testResults) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs index d9d4a45ae..26757b098 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson public class CucumberJsonResults : MultipleTestRunsBase { public CucumberJsonResults(IConfiguration configuration, CucumberJsonSingleResultLoader singleResultLoader) - : base(true, configuration, singleResultLoader) + : base(configuration, singleResultLoader) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs index ed9d0ac9b..fbaf644c0 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.MsTest public class MsTestResults : MultipleTestRunsBase { public MsTestResults(IConfiguration configuration, MsTestSingleResultLoader singleResultLoader, MsTestScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs index 3628ab0c8..3b6130d05 100644 --- a/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs +++ b/src/Pickles/Pickles.TestFrameworks/MultipleTestRunsBase.cs @@ -31,15 +31,13 @@ public abstract class MultipleTestRunsBase : ITestResults { private readonly ISingleResultLoader singleResultLoader; - protected MultipleTestRunsBase(bool supportsExampleResults, IEnumerable testResults) + protected MultipleTestRunsBase(IEnumerable testResults) { - this.SupportsExampleResults = supportsExampleResults; this.TestResults = testResults; } - protected MultipleTestRunsBase(bool supportsExampleResults, IConfiguration configuration, ISingleResultLoader singleResultLoader, IScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher = null) + protected MultipleTestRunsBase(IConfiguration configuration, ISingleResultLoader singleResultLoader, IScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher = null) { - this.SupportsExampleResults = supportsExampleResults; this.singleResultLoader = singleResultLoader; this.TestResults = this.GetSingleTestResults(configuration); @@ -54,22 +52,13 @@ private void SetExampleSignatureBuilder(IScenarioOutlineExampleMatcher scenarioO } } - public bool SupportsExampleResults { get; } - protected IEnumerable TestResults { get; } public TestResult GetExampleResult(ScenarioOutline scenarioOutline, string[] arguments) { - if (SupportsExampleResults) - { - var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); + var results = TestResults.Select(tr => tr.GetExampleResult(scenarioOutline, arguments)).ToArray(); - return EvaluateTestResults(results); - } - else - { - return TestResult.Passed; - } + return EvaluateTestResults(results); } public TestResult GetFeatureResult(Feature feature) diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs index ed9407ddd..a70b897e1 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit2/NUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2 public class NUnit2Results : MultipleTestRunsBase { public NUnit2Results(IConfiguration configuration, NUnit2SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs index e484647e2..78f4996bb 100644 --- a/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/NUnit/NUnit3/NUnit3Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3 public class NUnit3Results : MultipleTestRunsBase { public NUnit3Results(IConfiguration configuration, NUnit3SingleResultLoader singleResultLoader, NUnitScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs index f7cd6ac45..0a6282f87 100644 --- a/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/SpecRun/SpecRunResults.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.SpecRun public class SpecRunResults : MultipleTestRunsBase { public SpecRunResults(IConfiguration configuration, SpecRunSingleResultLoader singleResultLoader, SpecRunScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs index 05b07294a..416406214 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit1/XUnit1Results.cs @@ -28,7 +28,7 @@ public XUnit1Results( IConfiguration configuration, XUnit1SingleResultLoader singleResultLoader, XUnit1ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } diff --git a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs index e997010ee..a3f43b9e9 100644 --- a/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs +++ b/src/Pickles/Pickles.TestFrameworks/XUnit/XUnit2/XUnit2Results.cs @@ -25,7 +25,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2 public class XUnit2Results : MultipleTestRunsBase { public XUnit2Results(IConfiguration configuration, XUnit2SingleResultLoader singleResultLoader, XUnit2ScenarioOutlineExampleMatcher scenarioOutlineExampleMatcher) - : base(true, configuration, singleResultLoader, scenarioOutlineExampleMatcher) + : base(configuration, singleResultLoader, scenarioOutlineExampleMatcher) { } } From 1ee7b02e0391607797cc2bf1f3ae329ddfc0b7b0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 16:21:04 +0100 Subject: [PATCH 107/132] Remove CucumberJsonExampleSignatureBuilder --- .../CucumberJsonExampleSignatureBuilder.cs | 35 ------------------- .../Pickles.TestFrameworks.csproj | 1 - src/Pickles/Pickles/PicklesModule.cs | 1 - 3 files changed, 37 deletions(-) delete mode 100644 src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs deleted file mode 100644 index 633329867..000000000 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonExampleSignatureBuilder.cs +++ /dev/null @@ -1,35 +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.Text.RegularExpressions; - -using PicklesDoc.Pickles.ObjectModel; - -namespace PicklesDoc.Pickles.TestFrameworks.CucumberJson -{ - public class CucumberJsonExampleSignatureBuilder - { - public Regex Build(ScenarioOutline scenarioOutline, string[] row) - { - throw new NotSupportedException(); - } - } -} \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index 73210cc99..d5e03eca6 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -45,7 +45,6 @@ - diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index bfffd3828..e6cdd9190 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -93,7 +93,6 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); - builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); From 01eb92c603716bfd21a9a94e61ff9c266322e5e9 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 16:24:05 +0100 Subject: [PATCH 108/132] Add entry to change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c1867f81..99cc94230 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt - 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)). ### Fixed From ea691f69a4085c376f1a1da55a4befcac72ceb65 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 17:34:42 +0100 Subject: [PATCH 109/132] Update test result files --- .../CucumberJson/results-example-json.json | 2392 +++++++++-------- .../MsTest/results-example-mstest.trx | 253 +- .../NUnit/NUnit2/results-example-nunit.xml | 107 +- .../NUnit/NUnit3/results-example-nunit3.xml | 147 +- .../SpecRun/results-example-specrun.html | 16 +- .../XUnit/XUnit1/results-example-xunit.xml | 118 +- .../XUnit/XUnit2/results-example-xunit2.xml | 283 +- 7 files changed, 1784 insertions(+), 1532 deletions(-) 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 13c84d1de..e9756f354 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -1,1171 +1,1257 @@ [ - { - "uri": "features/Addition.feature", - "id": "addition", - "keyword": "Feature", - "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": "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": "@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": 1001000 - } - } - ] - }, - { - "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": "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/AdditionSteps.rb:1" - }, - "result": { - "status": "passed", - "duration": 0 - } - } - ] - }, - { - "id": "addition;add-two-numbers", - "keyword": "Scenario", - "name": "Add two numbers", - "description": "", - "line": 23, - "type": "scenario", - "tags": [ - { - "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": "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/AdditionSteps.rb:10" - }, - "result": { - "status": "failed", - "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": 13994000 - } - }, - { - "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" - } - } - ] + { + "uri": "features/Addition.feature", + "id": "addition", + "keyword": "Feature", + "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": "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 } + } ] - }, - { - "uri": "features/Minimal Features/Failing.feature", - "id": "failing", - "keyword": "Feature", - "name": "Failing", + }, + { + "id": "addition;adding-several-numbers;;2", + "keyword": "Scenario Outline", + "name": "Adding several numbers", "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 - } - } - ] + "line": 19, + "type": "scenario", + "tags": [ + { + "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": 500000 + } + }, + { + "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": 1000000 + } + } ] - }, - { - "uri": "features/Minimal Features/Inconclusive.feature", - "id": "inconclusive", - "keyword": "Feature", - "name": "Inconclusive", + }, + { + "keyword": "Background", + "name": "", "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 - } - } - ] + "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 } + } ] - }, - { - "uri": "features/Minimal Features/Passing.feature", - "id": "passing", - "keyword": "Feature", - "name": "Passing", + }, + { + "id": "addition;adding-several-numbers;;3", + "keyword": "Scenario Outline", + "name": "Adding several numbers", "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 - } - } - ] + "line": 20, + "type": "scenario", + "tags": [ + { + "name": "@tag2", + "line": 9 + } + ], + "steps": [ + { + "keyword": "Given ", + "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 } + } ] - }, - { - "uri": "features/NotAutomatedAtAll.feature", - "id": "not-automated-at-all", - "keyword": "Feature", - "name": "Not Automated At All", + }, + { + "keyword": "Background", + "name": "", "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" - } - } - ] + "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 } + } ] - }, - { - "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": 1001000 - } - } - ] - }, - { - "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": 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": 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 - } - } - ] + }, + { + "id": "addition;add-two-numbers", + "keyword": "Scenario", + "name": "Add two numbers", + "description": "", + "line": 23, + "type": "scenario", + "tags": [ + { + "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": "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/AdditionSteps.rb:10" + }, + "result": { + "status": "failed", + "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": 15501000 + } + }, + { + "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" + } + } + ] + } + ] + }, + { + "uri": "features/FailingBackground.feature", + "id": "failing-background", + "keyword": "Feature", + "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 + } + } + ] + }, + { + "id": "failing-background;add-two-numbers", + "keyword": "Scenario", + "name": "Add two numbers", + "description": "", + "line": 7, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "I have entered 50 into the calculator", + "line": 8, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "And ", + "name": "I have entered 70 into the calculator", + "line": 9, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:6" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "When ", + "name": "I press add", + "line": 10, + "match": { + "location": "features/step_definitions/AdditionSteps.rb:14" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "the result should be 120 on the screen", + "line": 11, + "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": 500000 + } + } + ] + } + ] + }, + { + "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": 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": 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 } + } ] - } + } + ] + } ] \ No newline at end of file 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..60d7433b3 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 @@ -28,7 +28,7 @@ This is a scenario outline where all scenarios pass - + FeatureTitle @@ -47,7 +47,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -66,7 +66,7 @@ Not automated scenario 3 - + FeatureTitle @@ -75,9 +75,20 @@ + + Add two numbers + + + + FeatureTitle + Failing Background + + + + Failing Feature Inconclusive Scenario - + FeatureTitle @@ -88,7 +99,7 @@ Inconclusive Feature Inconclusive Scenario - + FeatureTitle @@ -99,7 +110,7 @@ Failing Feature Passing Scenario - + FeatureTitle @@ -110,7 +121,7 @@ Deal correctly with backslashes in the examples - + FeatureTitle @@ -129,7 +140,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -148,7 +159,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -170,7 +181,7 @@ - + Parameter:first number @@ -201,7 +212,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -220,7 +231,7 @@ Failing Feature Failing Scenario - + FeatureTitle @@ -231,7 +242,7 @@ This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -250,7 +261,7 @@ Inconclusive Feature Passing Scenario - + FeatureTitle @@ -264,7 +275,7 @@ - + Parameter:first number @@ -295,7 +306,7 @@ This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -313,7 +324,7 @@ - + FeatureTitle @@ -327,7 +338,7 @@ - + FeatureTitle @@ -338,7 +349,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -357,7 +368,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -376,7 +387,7 @@ This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -395,7 +406,7 @@ Not automated scenario 2 - + FeatureTitle @@ -406,7 +417,7 @@ This is a scenario outline where all scenarios pass - + FeatureTitle @@ -425,7 +436,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -444,7 +455,7 @@ Passing Feature Passing Scenario - + FeatureTitle @@ -453,13 +464,9 @@ - - - - This is a scenario outline where all scenarios pass - + FeatureTitle @@ -478,7 +485,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -500,7 +507,7 @@ - + FeatureTitle @@ -511,7 +518,7 @@ Not automated adding two numbers - + FeatureTitle @@ -522,7 +529,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -545,41 +552,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -595,7 +602,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 +618,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 +632,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 +669,7 @@ System.FormatException: Input string was not in a correct format. - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -731,7 +738,47 @@ namespace MyNamespace - + + + Given the background step fails +-> error: + 1 + should be + 2 + but was + 1 +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 11 + + + + + Then failing step -> error: @@ -763,7 +810,7 @@ Shouldly.ChuckedAWobbly: - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -782,13 +829,13 @@ Shouldly.ChuckedAWobbly: - + Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -807,19 +854,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 +941,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -969,7 +1016,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -1044,23 +1091,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 +1125,7 @@ namespace MyNamespace - + Then the scenario will 'inconclusive_2' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") @@ -1100,7 +1145,7 @@ namespace MyNamespace - + Then the scenario will 'fail_1' -> error: @@ -1133,7 +1178,7 @@ Shouldly.ChuckedAWobbly: - + Then the scenario will 'fail_2' -> error: @@ -1166,31 +1211,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 +1268,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 +1300,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/NUnit/NUnit2/results-example-nunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml index 6ebfb89e1..12dc3e4cf 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml @@ -1,25 +1,25 @@ - + - + - + - + - + - + - + - - + + @@ -27,7 +27,7 @@ - + @@ -53,7 +53,7 @@ at Pickles.TestHarness.nunit.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Cod - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + - + - - - + + + - + @@ -307,23 +326,23 @@ at Pickles.TestHarness.nunit.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWit - + - + - + - + - + - + - + - + diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/results-example-nunit3.xml index 1409da7fa..2b8a1d4fc 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/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,64 @@ Then unimplemented step ]]> - + + + + - + + + + + + + + + error: + 1 + should be + 2 + but was + 1 +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 +278,7 @@ Then unimplemented step True ]]> - + @@ -244,7 +290,7 @@ Then unimplemented step -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -253,11 +299,11 @@ Then unimplemented step ]]> - + - + @@ -269,7 +315,7 @@ Then unimplemented step -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -278,11 +324,11 @@ Then unimplemented step ]]> - + - + @@ -292,21 +338,21 @@ Then unimplemented step - + - + - - - - - + - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + @@ -362,7 +405,7 @@ Then the result should be 120 on the screen -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") ]]> - + @@ -371,7 +414,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/SpecRun/results-example-specrun.html b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html index bd75430c2..b5c3651db 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,15 @@ </scenario> </scenarios> </feature> + <feature> + <title>Failing Background</title> + <scenarios> + <scenario> + <title>Add two numbers</title> + <result>Failed</result> + </scenario> + </scenarios> + </feature> <feature> <title>Inconclusive</title> <scenarios> @@ -166,4 +175,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/XUnit/XUnit1/results-example-xunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml index 7c7d0c3be..6bf40a147 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml @@ -1,4 +1,28 @@ -IgnoredGiven the calculator has clean memory +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 unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -54,7 +78,7 @@ 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 46IgnoredGiven the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) Given I have entered 1 into the calculator -> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(1) (0,0s) @@ -64,7 +88,7 @@ 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 +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,35 @@ 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) -Given I have entered 60 into the calculator --> done: AdditionSteps.GivenIHaveEnteredIntoTheCalculator(60) (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 +Given I have entered 50 into the calculator +-> skipped because of previous errors 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) +-> skipped because of previous errors 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 unimplemented step +-> 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 11Given 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 +199,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.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() @@ -233,7 +261,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.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 14Given 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 +323,28 @@ 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' --> 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\' + at Pickles.TestHarness.xunit.NotAutomatedAtAllFeature.NotAutomatedScenario1() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 9When 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) 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' + 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' +-> 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 'fail_1' +Then the scenario will 'fail_1' -> error: true should be @@ -350,7 +378,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,9 +418,9 @@ 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 + 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 +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) @@ -417,13 +445,13 @@ 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.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 + 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) \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml index f280db022..d92ae6184 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml @@ -1,53 +1,35 @@  - + - - + + - - - - - - - - - - - - - - - - - - - - - - + + - - - + + + - - + + - + @@ -60,98 +42,76 @@ - - + + - - + + - + - - + + + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - 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 Pickles.TestHarness.xunit2.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature.cs:line 0 - at Pickles.TestHarness.xunit2.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 34]]> + 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]]> - - + + - + - + - + - + - + @@ -169,19 +129,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 +153,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 +177,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 +189,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 +207,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 +225,118 @@ at Pickles.TestHarness.xunit2.ScenarioOutlinesFeature.AndWeCanGoTotallyBonkersWithMultipleExampleSections_(String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\ScenarioOutlines.feature:line 45]]> - + - - + + - - + + + + + + - - - - - - + - - + + + + + + - + - - + + - - - + + + - + + + - - + + + + + + + + + + + + + + - + + at Pickles.TestHarness.xunit2.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature.cs:line 0 + at Pickles.TestHarness.xunit2.AdditionFeature.NotAutomatedAddingTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 46]]> + + + + + + + + + + + + + + + + + + + + + + + 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 Pickles.TestHarness.xunit2.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature.cs:line 0 + at Pickles.TestHarness.xunit2.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 34]]> + + + + + + + + \ No newline at end of file From 2d730533db782fa1f17d4a35a93618fbdd964855 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sat, 20 Feb 2016 17:36:41 +0100 Subject: [PATCH 110/132] Add new test case ThenCanReadResultOfScenarioWithFailingBackground --- .../WhenParsingCucumberJsonResultsFile.cs | 6 ++++++ .../MsTest/WhenParsingMsTestResultsFile.cs | 6 ++++++ .../NUnit/NUnit2/WhenParsingNUnitResultsFile.cs | 6 ++++++ .../NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs | 6 ++++++ .../SpecRun/WhenParsingSpecRunTestResultsFile.cs | 6 ++++++ .../StandardTestSuite.cs | 13 +++++++++++++ .../XUnit/XUnit1/WhenParsingxUnitResultsFile.cs | 6 ++++++ .../XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs | 6 ++++++ 8 files changed, 55 insertions(+) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs index a5e6f99b0..edd5574e8 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs @@ -105,5 +105,11 @@ public WhenParsingCucumberJsonResultsFile() { base.ThenCanReadResultsWithBackslashes(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs index b0776fecf..6a1126c38 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs @@ -111,5 +111,11 @@ public WhenParsingMsTestResultsFile() { base.ThenCanReadResultsWithBackslashes(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs index 4764c4811..67abcfdf8 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs @@ -105,5 +105,11 @@ public WhenParsingNUnitResultsFile() { base.ThenCanReadResultsWithBackslashes(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs index 61d14f7d1..db6f92142 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -75,5 +75,11 @@ public WhenParsingNunit3ResultsFile() { base.ThenCanReadResultsWithBackslashes(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs index 5734b1c80..e13506858 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs @@ -87,5 +87,11 @@ public WhenParsingSpecRunTestResultsFile() { base.ThenCanReadInconclusiveScenarioResultSuccessfully(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs index 39e577d94..ab0c6d523 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -180,6 +180,19 @@ public void ThenCanReadResultsWithBackslashes() 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); + } + private Feature AdditionFeature() { return new Feature { Name = "Addition" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs index 56341dac7..127922dbf 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs @@ -81,5 +81,11 @@ public WhenParsingxUnitResultsFile() { base.ThenCanReadNotFoundFeatureCorrectly(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs index 4a8e33c78..f0f02133b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -81,5 +81,11 @@ public WhenParsingxUnit2ResultsFile() { base.ThenCanReadNotFoundFeatureCorrectly(); } + + [Test] + public new void ThenCanReadResultOfScenarioWithFailingBackground() + { + base.ThenCanReadResultOfScenarioWithFailingBackground(); + } } } From d35bbc37986a2376b7d41c5c70ed609f4b55d159 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 21 Feb 2016 10:24:28 +0100 Subject: [PATCH 111/132] Extend result files with a scenario outline --- .../CucumberJson/results-example-json.json | 227 ++++++++- .../MsTest/results-example-mstest.trx | 442 ++++++++++++------ .../NUnit/NUnit2/results-example-nunit.xml | 126 +++-- .../NUnit/NUnit3/results-example-nunit3.xml | 190 ++++++-- .../SpecRun/results-example-specrun.html | 8 + .../XUnit/XUnit1/results-example-xunit.xml | 178 ++++--- .../XUnit/XUnit2/results-example-xunit2.xml | 326 +++++++------ 7 files changed, 1051 insertions(+), 446 deletions(-) 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 e9756f354..cce1e6d56 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-json.json @@ -51,7 +51,7 @@ }, "result": { "status": "passed", - "duration": 500000 + "duration": 0 } }, { @@ -99,7 +99,7 @@ }, "result": { "status": "passed", - "duration": 1000000 + "duration": 999000 } } ] @@ -343,7 +343,7 @@ "result": { "status": "failed", "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": 15501000 + "duration": 11999000 } }, { @@ -463,6 +463,17 @@ "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" + } } ] }, @@ -471,13 +482,13 @@ "keyword": "Scenario", "name": "Add two numbers", "description": "", - "line": 7, + "line": 8, "type": "scenario", "steps": [ { "keyword": "Given ", "name": "I have entered 50 into the calculator", - "line": 8, + "line": 9, "match": { "location": "features/step_definitions/AdditionSteps.rb:6" }, @@ -488,7 +499,7 @@ { "keyword": "And ", "name": "I have entered 70 into the calculator", - "line": 9, + "line": 10, "match": { "location": "features/step_definitions/AdditionSteps.rb:6" }, @@ -499,7 +510,7 @@ { "keyword": "When ", "name": "I press add", - "line": 10, + "line": 11, "match": { "location": "features/step_definitions/AdditionSteps.rb:14" }, @@ -510,7 +521,203 @@ { "keyword": "Then ", "name": "the result should be 120 on the screen", - "line": 11, + "line": 12, + "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;;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" }, @@ -648,7 +855,7 @@ "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": 500000 + "duration": 0 } } ] @@ -1202,7 +1409,7 @@ "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": 0 + "duration": 500000 } } ] 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 60d7433b3..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 @@ -77,7 +92,7 @@ Add two numbers - + FeatureTitle @@ -88,7 +103,7 @@ Failing Feature Inconclusive Scenario - + FeatureTitle @@ -99,7 +114,7 @@ Inconclusive Feature Inconclusive Scenario - + FeatureTitle @@ -110,7 +125,7 @@ Failing Feature Passing Scenario - + FeatureTitle @@ -121,7 +136,7 @@ Deal correctly with backslashes in the examples - + FeatureTitle @@ -140,7 +155,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -159,7 +174,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -181,7 +196,7 @@ - + Parameter:first number @@ -212,7 +227,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -231,7 +246,7 @@ Failing Feature Failing Scenario - + FeatureTitle @@ -242,7 +257,7 @@ This is a scenario outline where one scenario is inconclusive - + FeatureTitle @@ -259,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 @@ -324,7 +324,7 @@ - + FeatureTitle @@ -338,7 +338,7 @@ - + FeatureTitle @@ -347,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 @@ -368,7 +387,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -385,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 @@ -417,7 +448,7 @@ This is a scenario outline where all scenarios pass - + FeatureTitle @@ -436,7 +467,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -455,7 +486,7 @@ Passing Feature Passing Scenario - + FeatureTitle @@ -466,7 +497,7 @@ This is a scenario outline where all scenarios pass - + FeatureTitle @@ -485,7 +516,7 @@ This is a scenario outline where one scenario fails - + FeatureTitle @@ -502,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 @@ -518,7 +580,7 @@ Not automated adding two numbers - + FeatureTitle @@ -529,7 +591,7 @@ And we can go totally bonkers with multiple example sections. - + FeatureTitle @@ -552,41 +614,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -602,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) @@ -618,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) @@ -632,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) @@ -669,7 +733,7 @@ System.FormatException: Input string was not in a correct format. - + Given the calculator has clean memory -> done: AdditionSteps.GivenTheCalculatorHasCleanMemory() (0,0s) @@ -738,7 +802,52 @@ 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: @@ -747,6 +856,53 @@ namespace MyNamespace 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 @@ -773,12 +929,12 @@ Shouldly.ChuckedAWobbly: 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 11 + at Pickles.TestHarness.MsTest.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\MsTest\FailingBackground.feature:line 12 - + Then failing step -> error: @@ -810,7 +966,7 @@ Shouldly.ChuckedAWobbly: - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -829,13 +985,13 @@ Shouldly.ChuckedAWobbly: - + Then passing step -> done: MinimalSteps.ThenPassingStep() (0,0s) - + Then inconclusive step -> pending: MinimalSteps.ThenInconclusiveStep() @@ -854,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: @@ -941,7 +1097,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -1016,7 +1172,7 @@ namespace MyNamespace - + Given unimplemented step -> No matching step definition found for the step. Use the following code to create one: @@ -1091,21 +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") @@ -1125,7 +1281,7 @@ namespace MyNamespace - + Then the scenario will 'inconclusive_2' -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_2") @@ -1145,7 +1301,7 @@ namespace MyNamespace - + Then the scenario will 'fail_1' -> error: @@ -1178,7 +1334,7 @@ Shouldly.ChuckedAWobbly: - + Then the scenario will 'fail_2' -> error: @@ -1211,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: @@ -1268,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") @@ -1300,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/NUnit/NUnit2/results-example-nunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml index 12dc3e4cf..fdcc5ecca 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/results-example-nunit.xml @@ -1,25 +1,25 @@ - + - + - + - + - + - + - + - - + + @@ -27,7 +27,7 @@ - + @@ -90,7 +90,51 @@ namespace MyNamespace - + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 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,14 +191,100 @@ 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 +]]> + + + @@ -217,7 +303,7 @@ Then unimplemented step at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.nunit3.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\nunit3\FailingBackground.feature.cs:line 0 - at Pickles.TestHarness.nunit3.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\nunit3\FailingBackground.feature:line 11]]> + at Pickles.TestHarness.nunit3.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\nunit3\FailingBackground.feature:line 12]]> error: @@ -226,6 +312,8 @@ Then unimplemented step 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 @@ -237,18 +325,18 @@ Then the result should be 120 on the screen ]]> - + - + - + @@ -278,7 +366,7 @@ Then the result should be 120 on the screen True ]]> - + @@ -290,7 +378,7 @@ Then the result should be 120 on the screen -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -299,11 +387,11 @@ Then the result should be 120 on the screen ]]> - + - + @@ -315,7 +403,7 @@ Then the result should be 120 on the screen -> pending: MinimalSteps.ThenInconclusiveStep() ]]> - + @@ -324,11 +412,11 @@ Then the result should be 120 on the screen ]]> - + - + @@ -338,14 +426,14 @@ Then the result should be 120 on the screen - + - + @@ -372,31 +460,31 @@ Then the result should be 120 on the screen ]]> - + - + - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_1") (0,0s) ]]> - + done: ScenarioOutlineSteps.ThenTheScenarioWill("pass_2") (0,0s) ]]> - + @@ -405,7 +493,7 @@ Then the result should be 120 on the screen -> pending: ScenarioOutlineSteps.ThenTheScenarioWill("inconclusive_1") ]]> - + @@ -414,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/SpecRun/results-example-specrun.html b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html index b5c3651db..72bffb7eb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/results-example-specrun.html @@ -62,6 +62,14 @@ <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> diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml index 6bf40a147..6750283a6 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/results-example-xunit.xml @@ -1,28 +1,4 @@ -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 +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: @@ -78,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 46IgnoredGiven 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) @@ -88,7 +88,7 @@ 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 +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) @@ -109,13 +109,79 @@ 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 background step fails + 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 +-> 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 +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 +-> 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 +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 @@ -137,7 +203,7 @@ Then the result should be 120 on the screen 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 11Given unimplemented step + 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() @@ -199,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() @@ -261,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.NotAutomatedScenario2() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit\NotAutomatedAtAll.feature:line 14Given 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() @@ -323,18 +389,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 9When 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' + 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) @@ -344,7 +399,7 @@ namespace MyNamespace -> 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 @@ -364,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) @@ -418,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 @@ -445,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 passing 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 +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 + 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 -> done: MinimalSteps.ThenPassingStep() (0,0s) \ No newline at end of file diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml index d92ae6184..46d10e16f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/results-example-xunit2.xml @@ -1,12 +1,50 @@  - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -18,38 +56,54 @@ at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at Pickles.TestHarness.xunit2.FailingBackgroundFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\FailingBackground.feature.cs:line 0 - at Pickles.TestHarness.xunit2.FailingBackgroundFeature.AddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\FailingBackground.feature:line 11]]> + at Pickles.TestHarness.xunit2.FailingBackgroundFeature.AddingSeveralNumbers(String firstNumber, String secondNumber, String thirdNumber, String result, String[] exampleTags) in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\FailingBackground.feature:line 19]]> - - - + - - + + + + + + - + - - + + - - - + + + - - + + - + @@ -67,7 +121,7 @@ at Pickles.TestHarness.xunit2.MinimalFeatures.FailingFeature.FailingFeatureFailingScenario() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Minimal Features\Failing.feature:line 10]]> - + @@ -80,38 +134,126 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 Pickles.TestHarness.xunit2.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature.cs:line 0 + at Pickles.TestHarness.xunit2.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 34]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -129,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]]> - + - + - + @@ -153,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]]> - + - + - + @@ -177,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]]> - + @@ -189,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]]> - + @@ -207,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]]> - + @@ -225,118 +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]]> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 Pickles.TestHarness.xunit2.AdditionFeature.ScenarioCleanup() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature.cs:line 0 - at Pickles.TestHarness.xunit2.AdditionFeature.FailToAddTwoNumbers() in C:\Dev\Code\GitHub\DirkRombauts\pickles-testresults\TestHarness\xunit2\Addition.feature:line 34]]> - - - - - - - - - - - \ No newline at end of file From 42e9da05998c19f5f81fe615cf1085d309be868c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 21 Feb 2016 10:33:56 +0100 Subject: [PATCH 112/132] Add scenarios for failing background things --- .../WhenParsingCucumberJsonResultsFile.cs | 18 +++++++++ .../MsTest/WhenParsingMsTestResultsFile.cs | 18 +++++++++ .../NUnit2/WhenParsingNUnitResultsFile.cs | 18 +++++++++ .../NUnit3/WhenParsingNunit3ResultsFile.cs | 18 +++++++++ .../WhenParsingSpecRunTestResultsFile.cs | 18 +++++++++ .../StandardTestSuite.cs | 37 +++++++++++++++++++ .../XUnit1/WhenParsingxUnitResultsFile.cs | 18 +++++++++ .../XUnit2/WhenParsingxUnit2ResultsFile.cs | 18 +++++++++ 8 files changed, 163 insertions(+) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs index edd5574e8..4e036e5eb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs @@ -111,5 +111,23 @@ public WhenParsingCucumberJsonResultsFile() { 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/MsTest/WhenParsingMsTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs index 6a1126c38..11cba7ef5 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/MsTest/WhenParsingMsTestResultsFile.cs @@ -117,5 +117,23 @@ public WhenParsingMsTestResultsFile() { 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/WhenParsingNUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs index 67abcfdf8..5c88985b0 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit2/WhenParsingNUnitResultsFile.cs @@ -111,5 +111,23 @@ public WhenParsingNUnitResultsFile() { 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/NUnit3/WhenParsingNunit3ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs index db6f92142..c671fd244 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/NUnit/NUnit3/WhenParsingNunit3ResultsFile.cs @@ -81,5 +81,23 @@ public WhenParsingNunit3ResultsFile() { 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/SpecRun/WhenParsingSpecRunTestResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs index e13506858..177ae2cfa 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/SpecRun/WhenParsingSpecRunTestResultsFile.cs @@ -93,5 +93,23 @@ public WhenParsingSpecRunTestResultsFile() { 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/StandardTestSuite.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs index ab0c6d523..714869712 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/StandardTestSuite.cs @@ -193,6 +193,43 @@ public void ThenCanReadResultOfScenarioWithFailingBackground() 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" }; diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs index 127922dbf..acdcec41c 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit1/WhenParsingxUnitResultsFile.cs @@ -87,5 +87,23 @@ public WhenParsingxUnitResultsFile() { 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/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs index f0f02133b..13a8ead43 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -87,5 +87,23 @@ public WhenParsingxUnit2ResultsFile() { base.ThenCanReadResultOfScenarioWithFailingBackground(); } + + [Test] + public new void ThenCanReadResultOfFeatureWithFailingBackground() + { + base.ThenCanReadResultOfFeatureWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineWithFailingBackground(); + } + + [Test] + public new void ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground() + { + base.ThenCanReadResultOfScenarioOutlineExampleWithFailingBackground(); + } } } From 25cf3d7a57dd3de1b57d98545edeb2f039f8a0ea Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 21 Feb 2016 10:34:01 +0100 Subject: [PATCH 113/132] Fix typo --- .../XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs index 13a8ead43..dde407b59 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/XUnit/XUnit2/WhenParsingxUnit2ResultsFile.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // From d91e3a9da8ee2407194dd98c666a70a2814a6aa4 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 21 Feb 2016 10:44:53 +0100 Subject: [PATCH 114/132] The tests pass --- .../CucumberJson/CucumberJsonSingleResults.cs | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 994185a02..329a702a2 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -39,8 +39,8 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { var cucumberScenarios = this.GetCucumberScenarios(scenario); - var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs, exampleValues)) - .Select(ToTestResult); + var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs.Item1, exampleValues)) + .Select(cs => ToTestResult(cs.Item1, cs.Item2)); return query.FirstOrDefault(); } @@ -59,32 +59,36 @@ public override TestResult GetFeatureResult(ObjectModel.Feature feature) { var cucumberFeature = this.GetCucumberFeature(feature); - return this.GetResultFromFeature(cucumberFeature); + return this.GetResultFromFeature(cucumberFeature.Item1, cucumberFeature.Item2); } - private Feature GetCucumberFeature(ObjectModel.Feature feature) + private Tuple GetCucumberFeature(ObjectModel.Feature feature) { - return this.resultsDocument.FirstOrDefault(f => f.name == feature.Name); + var cucumberFeature = this.resultsDocument.FirstOrDefault(f => f.name == feature.Name); + var background = cucumberFeature?.elements.FirstOrDefault(e => e.type == "background"); + return new Tuple(cucumberFeature, background); } - private TestResult GetResultFromFeature(Feature cucumberFeature) + private TestResult GetResultFromFeature(Feature cucumberFeature, Element background) { if (cucumberFeature?.elements == null) { return TestResult.Inconclusive; } - return ToTestResult(cucumberFeature); + return ToTestResult(cucumberFeature, background); } - private TestResult ToTestResult(Feature feature) + private TestResult ToTestResult(Feature feature, Element background) { - return feature.elements.Select(ToTestResult).Merge(); + return feature.elements.Select(e => ToTestResult(e, background)).Merge(); } - private TestResult ToTestResult(Element scenario) + private TestResult ToTestResult(Element scenario, Element background) { - return scenario.steps.Select(ToTestResult).Merge(); + var steps = (background?.steps ?? new List()).Concat(scenario.steps); + + return steps.Select(ToTestResult).Merge(); } private TestResult ToTestResult(Step step) @@ -120,7 +124,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl { var cucumberScenarios = this.GetCucumberScenarios(scenarioOutline); - return cucumberScenarios.Select(ToTestResult).Merge(); + return cucumberScenarios.Select(cs => ToTestResult(cs.Item1, cs.Item2)).Merge(); } @@ -128,34 +132,34 @@ public override TestResult GetScenarioResult(Scenario scenario) { var cucumberScenario = this.GetCucumberScenario(scenario); - return this.GetResultFromScenario(cucumberScenario); + return this.GetResultFromScenario(cucumberScenario.Item1, cucumberScenario.Item2); } - private Element GetCucumberScenario(Scenario scenario) + private Tuple GetCucumberScenario(Scenario scenario) { Element cucumberScenario = null; var cucumberFeature = this.GetCucumberFeature(scenario.Feature); - if (cucumberFeature != null) + if (cucumberFeature?.Item1 != null) { - cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name); + cucumberScenario = cucumberFeature.Item1.elements.FirstOrDefault(x => x.name == scenario.Name); } - return cucumberScenario; + return new Tuple(cucumberScenario, cucumberFeature?.Item2); } - private IEnumerable GetCucumberScenarios(ScenarioOutline scenarioOutline) + private IEnumerable> GetCucumberScenarios(ScenarioOutline scenarioOutline) { IEnumerable cucumberScenarios = null; var cucumberFeature = this.GetCucumberFeature(scenarioOutline.Feature); - if (cucumberFeature != null) + if (cucumberFeature?.Item1 != null) { - cucumberScenarios = cucumberFeature.elements.Where(x => x.name == scenarioOutline.Name); + cucumberScenarios = cucumberFeature.Item1.elements.Where(x => x.name == scenarioOutline.Name); } - return cucumberScenarios; + return (cucumberScenarios ?? new Element[0]).Select(cs => new Tuple(cs, cucumberFeature?.Item2)); } - private TestResult GetResultFromScenario(Element cucumberScenario) + private TestResult GetResultFromScenario(Element cucumberScenario, Element background) { if (cucumberScenario == null) { @@ -163,7 +167,7 @@ private TestResult GetResultFromScenario(Element cucumberScenario) } - return ToTestResult(cucumberScenario); + return ToTestResult(cucumberScenario, background); } } } From c2bc76981cc554ba133e8a7e7b5f0992dc350c95 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Sun, 21 Feb 2016 10:49:11 +0100 Subject: [PATCH 115/132] Refactor to use strongly typed tuples --- .../CucumberJson/CucumberJsonSingleResults.cs | 56 ++++++++++++++----- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 329a702a2..4240a5f8e 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -39,8 +39,8 @@ public override TestResult GetExampleResult(ScenarioOutline scenario, string[] e { var cucumberScenarios = this.GetCucumberScenarios(scenario); - var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs.Item1, exampleValues)) - .Select(cs => ToTestResult(cs.Item1, cs.Item2)); + var query = cucumberScenarios.Where(cs => this.ScenarioHasStepsForAllExampleValues(cs.ScenarioBase, exampleValues)) + .Select(cs => ToTestResult(cs.ScenarioBase, cs.Background)); return query.FirstOrDefault(); } @@ -59,14 +59,14 @@ public override TestResult GetFeatureResult(ObjectModel.Feature feature) { var cucumberFeature = this.GetCucumberFeature(feature); - return this.GetResultFromFeature(cucumberFeature.Item1, cucumberFeature.Item2); + return this.GetResultFromFeature(cucumberFeature.Feature, cucumberFeature.Background); } - private Tuple GetCucumberFeature(ObjectModel.Feature feature) + private FeatureAndBackground GetCucumberFeature(ObjectModel.Feature feature) { var cucumberFeature = this.resultsDocument.FirstOrDefault(f => f.name == feature.Name); var background = cucumberFeature?.elements.FirstOrDefault(e => e.type == "background"); - return new Tuple(cucumberFeature, background); + return new FeatureAndBackground(cucumberFeature, background); } private TestResult GetResultFromFeature(Feature cucumberFeature, Element background) @@ -124,7 +124,7 @@ public override TestResult GetScenarioOutlineResult(ScenarioOutline scenarioOutl { var cucumberScenarios = this.GetCucumberScenarios(scenarioOutline); - return cucumberScenarios.Select(cs => ToTestResult(cs.Item1, cs.Item2)).Merge(); + return cucumberScenarios.Select(cs => ToTestResult(cs.ScenarioBase, cs.Background)).Merge(); } @@ -132,31 +132,31 @@ public override TestResult GetScenarioResult(Scenario scenario) { var cucumberScenario = this.GetCucumberScenario(scenario); - return this.GetResultFromScenario(cucumberScenario.Item1, cucumberScenario.Item2); + return this.GetResultFromScenario(cucumberScenario.ScenarioBase, cucumberScenario.Background); } - private Tuple GetCucumberScenario(Scenario scenario) + private ScenarioBaseAndBackground GetCucumberScenario(Scenario scenario) { Element cucumberScenario = null; var cucumberFeature = this.GetCucumberFeature(scenario.Feature); - if (cucumberFeature?.Item1 != null) + if (cucumberFeature?.Feature != null) { - cucumberScenario = cucumberFeature.Item1.elements.FirstOrDefault(x => x.name == scenario.Name); + cucumberScenario = cucumberFeature.Feature.elements.FirstOrDefault(x => x.name == scenario.Name); } - return new Tuple(cucumberScenario, cucumberFeature?.Item2); + return new ScenarioBaseAndBackground(cucumberScenario, cucumberFeature?.Background); } - private IEnumerable> GetCucumberScenarios(ScenarioOutline scenarioOutline) + private IEnumerable GetCucumberScenarios(ScenarioOutline scenarioOutline) { IEnumerable cucumberScenarios = null; var cucumberFeature = this.GetCucumberFeature(scenarioOutline.Feature); - if (cucumberFeature?.Item1 != null) + if (cucumberFeature?.Feature != null) { - cucumberScenarios = cucumberFeature.Item1.elements.Where(x => x.name == scenarioOutline.Name); + cucumberScenarios = cucumberFeature.Feature.elements.Where(x => x.name == scenarioOutline.Name); } - return (cucumberScenarios ?? new Element[0]).Select(cs => new Tuple(cs, cucumberFeature?.Item2)); + return (cucumberScenarios ?? new Element[0]).Select(cs => new ScenarioBaseAndBackground(cs, cucumberFeature?.Background)); } private TestResult GetResultFromScenario(Element cucumberScenario, Element background) @@ -169,5 +169,31 @@ private TestResult GetResultFromScenario(Element cucumberScenario, Element backg return ToTestResult(cucumberScenario, background); } + + private class FeatureAndBackground + { + public FeatureAndBackground(Feature feature, Element background) + { + this.Feature = feature; + this.Background = background; + } + + public Feature Feature { get; } + + public Element Background { get; } + } + + private class ScenarioBaseAndBackground + { + public ScenarioBaseAndBackground(Element scenarioBase, Element background) + { + this.ScenarioBase = scenarioBase; + this.Background = background; + } + + public Element ScenarioBase { get; } + + public Element Background { get; } + } } } From 058706ca5749142fbbdef6cf0d17432089608bca Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Mon, 22 Feb 2016 14:41:05 +0100 Subject: [PATCH 116/132] Rename files to make clear they're using the ruby result --- ...ile.cs => WhenParsingCucumberJsonFromRubyResultsFile.cs} | 6 +++--- ...CucumberJsonFromRubyResultsFileWithIndividualResults.cs} | 6 +++--- .../Pickles.TestFrameworks.UnitTests.csproj | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/{WhenParsingCucumberJsonResultsFile.cs => WhenParsingCucumberJsonFromRubyResultsFile.cs} (94%) rename src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/{WhenParsingCucumberJsonResultsFileWithIndividualResults.cs => WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs} (87%) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs similarity index 94% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs index 4e036e5eb..b607c06d3 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFile.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -27,9 +27,9 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] - public class WhenParsingCucumberJsonResultsFile : StandardTestSuite + public class WhenParsingCucumberJsonFromRubyResultsFile : StandardTestSuite { - public WhenParsingCucumberJsonResultsFile() + public WhenParsingCucumberJsonFromRubyResultsFile() : base("CucumberJson." + "results-example-json.json") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs similarity index 87% rename from src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs rename to src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs index bcea76966..9d9eae77f 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFileWithIndividualResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // @@ -27,9 +27,9 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] - public class WhenParsingCucumberJsonResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines + public class WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults : StandardTestSuiteForScenarioOutlines { - public WhenParsingCucumberJsonResultsFileWithIndividualResults() + public WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults() : base("CucumberJson." + "results-example-json.json") { } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 5bc2a2abb..6a99f902b 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -59,7 +59,7 @@
- + @@ -74,7 +74,7 @@ - + From 5966601a4883123e51f59faead8bb1693c6046f7 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Mon, 22 Feb 2016 15:19:08 +0100 Subject: [PATCH 117/132] Add results and tests for a JS version of cucumber --- ...henParsingCucumberJsonFromJSResultsFile.cs | 133 ++ ...nFromJSResultsFileWithIndividualResults.cs | 61 + .../results-example-cucumberjs-json.json | 1240 +++++++++++++++++ .../Pickles.TestFrameworks.UnitTests.csproj | 3 + 4 files changed, 1437 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFile.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/results-example-cucumberjs-json.json 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/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/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 6a99f902b..95a4e4576 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -59,6 +59,8 @@ + + @@ -140,6 +142,7 @@ Designer + From 8113cdbeb0c8a201d7b4a267ac5702ce66751a16 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Mon, 22 Feb 2016 15:19:18 +0100 Subject: [PATCH 118/132] Make the tests green --- .../CucumberJson/CucumberJsonSingleResults.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs index 4240a5f8e..1eff36182 100644 --- a/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/CucumberJson/CucumberJsonSingleResults.cs @@ -88,7 +88,7 @@ private TestResult ToTestResult(Element scenario, Element background) { var steps = (background?.steps ?? new List()).Concat(scenario.steps); - return steps.Select(ToTestResult).Merge(); + return steps.Where(s => s.result != null).Select(ToTestResult).Merge(); } private TestResult ToTestResult(Step step) @@ -108,6 +108,7 @@ private TestResult ToTestResult(string cucumberResult) return TestResult.Inconclusive; } + case "ambiguous": case "failed": { return TestResult.Failed; From dc8ac0671818322fce2597c4280e2fd23b4eafd2 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Mon, 22 Feb 2016 15:26:51 +0100 Subject: [PATCH 119/132] adapt change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99cc94230..982eaeaf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### 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 From 671bb6d35326b4c3d81c2b8a948a0f84f54de038 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Wed, 24 Feb 2016 10:38:01 +0100 Subject: [PATCH 120/132] Remove unused using --- src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs index 06cab4a8f..6dd57865c 100644 --- a/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs +++ b/src/Pickles/Pickles.TestFrameworks/MsTest/MsTestSingleResults.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using System.Xml.Linq; using PicklesDoc.Pickles.ObjectModel; From 898feb8703de39dfbe92a149c5783756f161d42c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:00:30 +0100 Subject: [PATCH 121/132] Add VsTest result files --- .../Pickles.TestFrameworks.UnitTests.csproj | 12 + ...sults-example-vstest - Run 1 (failing).trx | 69 ++ ...sults-example-vstest - Run 2 (passing).trx | 40 + .../results-example-vstest-missingTraits.trx | 33 + .../VsTest/results-example-vstest.trx | 1020 +++++++++++++++++ 5 files changed, 1174 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 1 (failing).trx create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest - Run 2 (passing).trx create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest-missingTraits.trx create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/results-example-vstest.trx diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 95a4e4576..4571a92cd 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -143,6 +143,18 @@ Designer
+ + Designer + + + Designer + + + Designer + + + Designer + 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 From 502d30b29cb79b3cd394659e80ed2c24fcad564b Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:00:59 +0100 Subject: [PATCH 122/132] Add test cases for VsTest --- .../Pickles.TestFrameworks.UnitTests.csproj | 4 + ...enParsingMultipleVsTestTestResultsFiles.cs | 82 +++++++++++ .../VsTest/WhenParsingVsTestResultsFile.cs | 139 ++++++++++++++++++ ...gVsTestResultsFileWithIndividualResults.cs | 61 ++++++++ ...rsingVsTestResultsFileWithMissingTraits.cs | 51 +++++++ 5 files changed, 337 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingMultipleVsTestTestResultsFiles.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFile.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithIndividualResults.cs create mode 100644 src/Pickles/Pickles.TestFrameworks.UnitTests/VsTest/WhenParsingVsTestResultsFileWithMissingTraits.cs diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj index 4571a92cd..47c6514c3 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj @@ -62,6 +62,10 @@ + + + + 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(); + } + } +} From dd19d70656390416e4cdfb2e6ed966c7f5ab942b Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:01:42 +0100 Subject: [PATCH 123/132] Add code for VsTest --- .../Pickles.TestFrameworks.csproj | 6 + .../VsTest/VsTestElementExtensions.cs | 149 ++++++++++++++++ .../VsTest/VsTestExampleSignatureBuilder.cs | 37 ++++ .../VsTest/VsTestResults.cs | 32 ++++ .../VsTestScenarioOutlineExampleMatcher.cs | 38 ++++ .../VsTest/VsTestSingleResultLoader.cs | 35 ++++ .../VsTest/VsTestSingleResults.cs | 166 ++++++++++++++++++ 7 files changed, 463 insertions(+) create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestElementExtensions.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestExampleSignatureBuilder.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestResults.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestScenarioOutlineExampleMatcher.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResultLoader.cs create mode 100644 src/Pickles/Pickles.TestFrameworks/VsTest/VsTestSingleResults.cs diff --git a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj index d5e03eca6..5fa51d9b4 100644 --- a/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj +++ b/src/Pickles/Pickles.TestFrameworks/Pickles.TestFrameworks.csproj @@ -56,6 +56,12 @@ + + + + + + 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; + } + } +} From f64bd054ce52105b6eaf7775f53e7f3a185fa32c Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:01:56 +0100 Subject: [PATCH 124/132] Register VsTest classes --- src/Pickles/Pickles/PicklesModule.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index e6cdd9190..679d56d87 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -35,6 +35,7 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; +using PicklesDoc.Pickles.TestFrameworks.VsTest; using PicklesDoc.Pickles.TestFrameworks.XUnit; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; @@ -96,6 +97,9 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType(); builder.RegisterType(); builder.RegisterType(); + builder.RegisterType(); + builder.RegisterType(); + builder.RegisterType(); builder.Register(c => { From 807074c5117558508edffed14c0f9d3ebd451404 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:13:50 +0100 Subject: [PATCH 125/132] Add test cases for xUnit2 and nUnit3 --- .../WhenResolvingTestResults.cs | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index aab0f7ed0..ffc5873bd 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -31,8 +31,10 @@ using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using PicklesDoc.Pickles.TestFrameworks.MsTest; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; +using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; +using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests { @@ -92,6 +94,25 @@ public void ThenCanResolveAsSingletonWhenTestResultsAreNUnit() 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() { @@ -111,6 +132,25 @@ public void ThenCanResolveAsSingletonWhenTestResultsArexUnit() 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); + } + [Test] public void ThenCanResolveAsSingletonWhenTestResultsAreCucumberJson() { @@ -188,6 +228,21 @@ public void ThenCanResolveWhenTestResultsAreNUnit() 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() { @@ -203,6 +258,21 @@ public void ThenCanResolveWhenTestResultsArexUnit() Check.That(item).IsInstanceOf(); } + [Test] + public void ThenCanResolveWhenTestResultsArexUnit2() + { + FileSystem.AddFile("results-example-xunit2.xml", RetrieveContentOfFileFromResources(TestResultsResourcePrefix + "XUnit.XUnit2.results-example-xunit2.xml")); + + var configuration = Container.Resolve(); + configuration.TestResultsFormat = TestResultsFormat.xUnit2; + configuration.AddTestResultFile(FileSystem.FileInfo.FromFileName("results-example-xunit2.xml")); + + var item1 = Container.Resolve(); + + Check.That(item1).IsNotNull(); + Check.That(item1).IsInstanceOf(); + } + [Test] public void ThenCanResolveWhenTestResultsAreCucumberJson() { From 0df68a24dc15945d3dd59e38c72348c1a2e31320 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:14:20 +0100 Subject: [PATCH 126/132] Add tests for VsTest --- .../Pickles.ObjectModel/TestResultsFormat.cs | 7 +++- .../WhenResolvingTestResults.cs | 35 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs b/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs index d8b4374f0..02909d394 100644 --- a/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs +++ b/src/Pickles/Pickles.ObjectModel/TestResultsFormat.cs @@ -65,6 +65,11 @@ public enum TestResultsFormat /// /// NUnit 3 format. /// - NUnit3 + NUnit3, + + /// + /// The format produced by VsTest console. + /// + VsTest } } diff --git a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs index ffc5873bd..64b9451bb 100644 --- a/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs +++ b/src/Pickles/Pickles.TestFrameworks.UnitTests/WhenResolvingTestResults.cs @@ -33,6 +33,7 @@ using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit2; using PicklesDoc.Pickles.TestFrameworks.NUnit.NUnit3; using PicklesDoc.Pickles.TestFrameworks.SpecRun; +using PicklesDoc.Pickles.TestFrameworks.VsTest; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit1; using PicklesDoc.Pickles.TestFrameworks.XUnit.XUnit2; @@ -189,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() { @@ -302,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(); + } } } From aeec1588684df8bc87e6150fc448ddbaf60a20e2 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:14:30 +0100 Subject: [PATCH 127/132] Use VsTest format --- src/Pickles/Pickles/PicklesModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Pickles/Pickles/PicklesModule.cs b/src/Pickles/Pickles/PicklesModule.cs index 679d56d87..1c3001bb6 100644 --- a/src/Pickles/Pickles/PicklesModule.cs +++ b/src/Pickles/Pickles/PicklesModule.cs @@ -126,6 +126,8 @@ protected override void Load(ContainerBuilder builder) return c.Resolve(); case TestResultsFormat.SpecRun: return c.Resolve(); + case TestResultsFormat.VsTest: + return c.Resolve(); default: return c.Resolve(); } From 23a880bd18043a1825def9f4fcc868501ff4ae99 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:22:26 +0100 Subject: [PATCH 128/132] Update change log --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982eaeaf0..45b558f54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Added +- Enable support for VsTest ([#296](https://github.com/picklesdoc/pickles/issues/296)) (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)). From 666fd85c165350102671bbadb01c3ef0934ab6a0 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:23:26 +0100 Subject: [PATCH 129/132] The vstest isssue is actually #280 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b558f54..cc7679392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ### Added -- Enable support for VsTest ([#296](https://github.com/picklesdoc/pickles/issues/296)) (by [@dirkrombauts](https://github.com/dirkrombauts)). +- 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 From c31f50c74b4e9e171603700bd46ac1f51a238583 Mon Sep 17 00:00:00 2001 From: Dirk Rombauts Date: Thu, 25 Feb 2016 14:58:59 +0100 Subject: [PATCH 130/132] Change radiobutton list to combobox --- .../Pickles.UserInterface/MainWindow.xaml | 13 +---- .../ViewModel/MainViewModel.cs | 47 +++++++++---------- 2 files changed, 23 insertions(+), 37 deletions(-) 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 @@