Skip to content

Commit c7b77cd

Browse files
committed
Most of the tests are passing for net46 again. Some approval tests failing for reports.
Also removed the resx as I was having issues loading it. Possibly related to aspnet/Tooling#532
1 parent 0c647e0 commit c7b77cd

File tree

10 files changed

+64
-291
lines changed

10 files changed

+64
-291
lines changed

src/TestStack.BDDfy.Tests/NetToStringTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void ReportsIllegalExampleStepNames(string stepName, string expectedStepT
7777
NetToString.Convert(stepName).ShouldBe(expectedStepTitle, Case.Sensitive);
7878
});
7979

80-
exception.ShouldBeNull();
80+
exception.ShouldNotBeNull();
8181
exception.ShouldBeOfType<ArgumentException>();
8282
}
8383
}

src/TestStack.BDDfy.Tests/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
3+
using Xunit;
44

55
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
@@ -17,3 +17,6 @@
1717

1818
// The following GUID is for the ID of the typelib if this project is exposed to COM
1919
[assembly: Guid("1ceb33e8-3aac-4d02-a15b-5b75b5f662ad")]
20+
21+
// BDDfy tests overwrite static configuration for test, cannot use parallel testing
22+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

src/TestStack.BDDfy.Tests/Reporters/ReportApprover.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public static void Approve(FileReportModel model, IReportBuilder reportBuilder)
1616
using (new TemporaryCulture("en-GB"))
1717
{
1818
var result = reportBuilder.CreateReport(model);
19-
result.ShouldMatchApproved(c => c.WithScrubber(s => StackTraceScrubber.ScrubLineNumbers(StackTraceScrubber.ScrubPaths(s))));
19+
result.ShouldMatchApproved(c => c
20+
.WithScrubber(s => StackTraceScrubber.ScrubLineNumbers(StackTraceScrubber.ScrubPaths(s)))
21+
.UseCallerLocation());
2022
}
2123
}
2224

src/TestStack.BDDfy.Tests/TestStack.BDDfy.Tests.xproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
55
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
66
</PropertyGroup>
7-
87
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
98
<PropertyGroup Label="Globals">
109
<ProjectGuid>1ceb33e8-3aac-4d02-a15b-5b75b5f662ad</ProjectGuid>
@@ -13,9 +12,11 @@
1312
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1413
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1514
</PropertyGroup>
16-
1715
<PropertyGroup>
1816
<SchemaVersion>2.0</SchemaVersion>
1917
</PropertyGroup>
18+
<ItemGroup>
19+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
20+
</ItemGroup>
2021
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21-
</Project>
22+
</Project>

src/TestStack.BDDfy.Tests/project.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,29 @@
44

55
"dependencies": {
66
"Shouldly": "2.8.0",
7-
"dotnet-test-xunit": "1.0.0-rc2-build10025",
7+
"dotnet-test-xunit": "1.0.0-rc3-build10019",
88
"xunit.core": "2.1.0",
99
"TestStack.BDDfy": {
1010
"target": "project"
1111
}
1212
},
1313

1414
"frameworks": {
15-
"net451": {
15+
//"netcoreapp1.0": {
16+
// "dependencies": {
17+
// "Microsoft.NETCore.App": {
18+
// "type": "platform",
19+
// "version": "1.0.0-rc2-3002702"
20+
// }
21+
// },
22+
// "imports": [
23+
// "dnxcore50",
24+
// "portable-net45+win8"
25+
// ]
26+
//},
27+
"net46": {
1628
"dependencies": {
29+
"Microsoft.NETCore.Platforms": "1.0.1-rc2-24027",
1730
"NSubstitute": "1.10.0"
1831
},
1932
"buildOptions": {
@@ -23,18 +36,6 @@
2336
"NSubstitute"
2437
]
2538
}
26-
},
27-
"netcoreapp1.0": {
28-
"dependencies": {
29-
"Microsoft.NETCore.App": {
30-
"type": "platform",
31-
"version": "1.0.0-rc2-3002702"
32-
}
33-
},
34-
"imports": [
35-
"dnxcore50",
36-
"portable-net45+win8"
37-
]
3839
}
3940
}
4041
}

src/TestStack.BDDfy/Reporters/Html/ClassicReportBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Globalization;
43
using System.Linq;
54
using System.Net;
65
using System.Text;

src/TestStack.BDDfy/Reporters/Html/HtmlReportResources.Designer.cs

Lines changed: 0 additions & 128 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.IO;
2+
3+
namespace TestStack.BDDfy.Reporters.Html
4+
{
5+
internal class HtmlReportResources
6+
{
7+
public static string metro_js_min => Read("TestStack.BDDfy.Reporters.Html.Scripts.metro.min.js");
8+
public static string metro_css_min => Read("TestStack.BDDfy.Reporters.Html.Scripts.metro.min.css");
9+
public static string classic_js_min => Read("TestStack.BDDfy.Reporters.Html.Scripts.classic.min.js");
10+
public static string jquery_2_1_0_min => Read("TestStack.BDDfy.Reporters.Html.Scripts.jquery-2.1.0.min.js");
11+
public static string classic_css_min => Read("TestStack.BDDfy.Reporters.Html.Scripts.classic.min.css");
12+
13+
public static string CustomStylesheetComment =>
14+
"If you drop a custom stylesheet named BDDfyCustom.css in your output folder" +
15+
" it gets embedded here. This way you can apply some custom styles over your" +
16+
" html report.";
17+
18+
public static string CustomJavascriptComment =>
19+
"If you drop a custom Javascript named BDDfyCustom.js in your output folder" +
20+
" it gets embedded here. This way you can apply some custom Javascript logic" +
21+
" to your html report.";
22+
23+
static string Read(string resourceName)
24+
{
25+
var assembly = typeof(HtmlReportResources).Assembly();
26+
27+
using (var stream = assembly.GetManifestResourceStream(resourceName))
28+
using (var reader = new StreamReader(stream))
29+
{
30+
return reader.ReadToEnd();
31+
}
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)