Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable results for individual example results in a scenario outline (in the Html version) #105

Merged
merged 37 commits into from
May 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0afeb35
Getting rid of autofac in tests
Apr 14, 2014
8512c2c
Getting rid of autofac in tests
Apr 14, 2014
c74182a
Setting default values in the configuration doesn't have any effects
Apr 14, 2014
240ee37
Remove unused using
Apr 14, 2014
046a2bd
Fixing tabs
Apr 14, 2014
925e464
Getting rid of autofac in tests
Apr 14, 2014
832c09e
Getting rid of autofac in tests
Apr 14, 2014
c00b9f7
Remove unused usings
Apr 14, 2014
e15b90e
Made tests more maintainable
Apr 14, 2014
3dc677a
Removed code duplication
Apr 14, 2014
f35881d
Simplify MsTestSingleResult
Apr 14, 2014
7bb6ae1
Simplify NUnitSingleResult
Apr 14, 2014
0b3a7a9
Simplify XUnitResult
Apr 14, 2014
d963b97
Make interface of the test results more uniform
Apr 14, 2014
df03a76
Move object model files to
Apr 14, 2014
fe63f5b
Ad
Apr 14, 2014
2dff718
Move builders to their own directory
Apr 24, 2014
e69e2c2
Adjust namespaces
Apr 24, 2014
439a523
Simplify boolean condiation
Apr 24, 2014
e673be4
Add TestResult to example
Apr 24, 2014
3bc6fce
Tease handling of Scenario and Scenario Outline apart
Apr 24, 2014
b8e8c16
Remove Result from Example again
Apr 24, 2014
ac9fef5
Add Result to TableRow
Apr 24, 2014
c8933ef
actually assign Result of the scenarioOutline
Apr 24, 2014
577e0cc
Assign Results of individual results
Apr 24, 2014
66ecd22
Assign combined result to scenarioOutline
Apr 24, 2014
09286ab
HtmlImageResultFormatter can now deal with a scenario outline example…
Apr 24, 2014
21bd98f
Static Html now supports results for individual example rows
Apr 24, 2014
8ce310d
It compiles again, tests pass
May 2, 2014
c902db8
New version of the result files
May 2, 2014
6a5d58a
Remove unused code
May 2, 2014
d4a48b4
Even newer versions of the test result files
May 2, 2014
17e0ed9
Parse the results of the
May 2, 2014
0372e2c
Parse scenario outline where one example is inconclusive
May 2, 2014
da7574e
Parse a scenario outline where one example fails
May 2, 2014
04a24d9
Parsing the scenario outline with multiple example sections
May 2, 2014
ee827cb
Style change for example result
May 2, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using ClosedXML.Excel;
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using Should;

Expand All @@ -13,7 +12,7 @@ public class WhenAddingADocumentStringToAWorksheet : BaseFixture
[Test]
public void ThenDocumentStringAddedSuccessfully()
{
var excelDocumentStringFormatter = Container.Resolve<ExcelDocumentStringFormatter>();
var excelDocumentStringFormatter = new ExcelDocumentStringFormatter();
string documentString = @"This is an example
document string for use
in testing";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using ClosedXML.Excel;
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;

namespace PicklesDoc.Pickles.Test.DocumentationBuilders.Excel
Expand All @@ -15,7 +14,7 @@ public class WhenAddingATableOfContentsToAWorksheet : BaseFixture
)]
public void ThenCanAddTableOfContentsWorksheetSuccessfully()
{
var excelTableOfContentsFormatter = Container.Resolve<ExcelTableOfContentsFormatter>();
var excelTableOfContentsFormatter = new ExcelTableOfContentsFormatter();
using (var workbook = new XLWorkbook())
{
IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.Excel;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Xml.Linq;
using Autofac;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using TechTalk.SpecFlow;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Xml;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;
using TechTalk.SpecFlow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test.DocumentationBuilders.HTML
Expand All @@ -14,9 +15,6 @@ public class WhenFormattingFeatures : BaseFixture
[Test]
public void ThenCanFormatDescriptionAsMarkdown()
{
var configuration = Container.Resolve<Configuration>();
configuration.TestResultsFiles = null;

var feature = new Feature
{
Name = "A feature",
Expand Down Expand Up @@ -71,9 +69,6 @@ 2. This is the second reason"
[Test]
public void ThenCanFormatMarkdownTableExtensions()
{
var configuration = Container.Resolve<Configuration>();
configuration.TestResultsFiles = null;

var feature = new Feature
{
Name = "A feature",
Expand Down Expand Up @@ -108,9 +103,6 @@ I want to see the descriptions written in markdown rendered with tables
[Test]
public void ThenCanFormatMarkdownTableExtensionsEvenIfTheyAreSomewhatMalstructured()
{
var configuration = Container.Resolve<Configuration>();
configuration.TestResultsFiles = null;

var feature = new Feature
{
Name = "A feature",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test.DocumentationBuilders.HTML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Autofac;
using NUnit.Framework;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.Test.Extensions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test.DocumentationBuilders.HTML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Autofac;
using NUnit.Framework;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Xml.Linq;
using Autofac;
//using Autofac;
using Moq;
using NUnit.Framework;
using PicklesDoc.Pickles.DirectoryCrawler;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test.Formatters
Expand All @@ -29,8 +29,7 @@ public void Constructor_NullHtmlIndexFormatter_ThrowsArgumentNullException()
var exception =
Assert.Throws<ArgumentNullException>(
() =>
new HtmlContentFormatter(
Container.Resolve<HtmlFeatureFormatter>(),
new HtmlContentFormatter(new Mock<IHtmlFeatureFormatter>().Object,
null));

Assert.AreEqual("htmlIndexFormatter", exception.ParamName);
Expand All @@ -40,7 +39,7 @@ public void Constructor_NullHtmlIndexFormatter_ThrowsArgumentNullException()
public void Format_ContentIsFeatureNode_UsesHtmlFeatureFormatterWithCorrectArgument()
{
var fakeHtmlFeatureFormatter = new Mock<IHtmlFeatureFormatter>();
var formatter = new HtmlContentFormatter(fakeHtmlFeatureFormatter.Object, Container.Resolve<HtmlIndexFormatter>());
var formatter = new HtmlContentFormatter(fakeHtmlFeatureFormatter.Object, new HtmlIndexFormatter());

var featureNode = new FeatureNode(
FileSystem.FileInfo.FromFileName(@"c:\temp\test.feature"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test.Formatters
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.Xml.Linq;

using Moq;

using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.TestFrameworks;

namespace PicklesDoc.Pickles.Test.Formatters
{
Expand All @@ -16,10 +20,16 @@ public class HtmlScenarioOutlineFormatterTests : BaseFixture
[SetUp]
public void Setup()
{
this.formatter = new HtmlScenarioOutlineFormatter(Container.Resolve<HtmlStepFormatter>(),
Container.Resolve<HtmlDescriptionFormatter>(),
Container.Resolve<HtmlTableFormatter>(),
Container.Resolve<HtmlImageResultFormatter>());
var fakeTestResults = new Mock<ITestResults>();
fakeTestResults.Setup(ftr => ftr.SupportsExampleResults).Returns(false);


this.formatter = new HtmlScenarioOutlineFormatter(
Container.Resolve<HtmlStepFormatter>(),
Container.Resolve<HtmlDescriptionFormatter>(),
Container.Resolve<HtmlTableFormatter>(),
Container.Resolve<HtmlImageResultFormatter>(),
fakeTestResults.Object);
}

#endregion
Expand All @@ -28,8 +38,8 @@ public void Setup()

private static ScenarioOutline BuildMinimalScenarioOutline()
{
var examples = new List<Example>();
examples.Add(new Example
var examples = new List<Example>();
examples.Add(new Example
{
Description = "My Example Description",
TableArgument = new Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using PicklesDoc.Pickles.DirectoryCrawler;
using PicklesDoc.Pickles.DocumentationBuilders.JSON;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should.Fluent;

Expand Down
1 change: 1 addition & 0 deletions src/Pickles/Pickles.Test/ParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Text.RegularExpressions;
using NUnit.Framework;
using Autofac;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;
using Should;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Text.RegularExpressions;
using NUnit.Framework;
using Autofac;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;
using Should;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using PicklesDoc.Pickles.DirectoryCrawler;
using PicklesDoc.Pickles.DocumentationBuilders.DITA;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;
using Should;
Expand Down
2 changes: 2 additions & 0 deletions src/Pickles/Pickles.Test/WhenParsingFeatureFiles.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Linq;
using NUnit.Framework;
using Autofac;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using System;

Expand Down
2 changes: 2 additions & 0 deletions src/Pickles/Pickles.Test/WhenParsingLocalizedFeatureFiles.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Linq;
using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using Should;

Expand Down
2 changes: 2 additions & 0 deletions src/Pickles/Pickles.Test/WhenParsingMsTestResultsFile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;
using Should;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;
using Should;
Expand Down
11 changes: 9 additions & 2 deletions src/Pickles/Pickles.Test/WhenParsingMultipleTestResultsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.IO.Abstractions;

using Moq;

using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;
using PicklesDoc.Pickles.TestFrameworks;

Expand Down Expand Up @@ -58,14 +60,19 @@ private static MultipleTestResults CreateMultipleTestResults(ITestResults testRe
private class TestableMultipleTestResults : MultipleTestResults
{
public TestableMultipleTestResults(IEnumerable<ITestResults> testResults)
: base(testResults)
: base(false, testResults)
{
}

public override TestResult GetExampleResult(ScenarioOutline scenario, string[] exampleValues)
{
throw new NotSupportedException();
}

protected override ITestResults ConstructSingleTestResult(FileInfoBase fileInfo)
{
// not needed since we use the other constructor
throw new System.NotSupportedException();
throw new NotSupportedException();
}
}

Expand Down
Loading