Skip to content

Commit e3f6513

Browse files
authored
Merge pull request #1 from JakeGinnivan/netcore
First pass at making coreclr compatible
2 parents bebe639 + c7b77cd commit e3f6513

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+367
-735
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ _NCrunch_TestStack.BDDfy/
2020
TestStack.BDDfy.sln.ide/
2121
src/packages/
2222
src/.vs/
23+
project.lock.json

src/NuGet.config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<configuration>
44
<packageSources>
5-
<!-- add key="CoreCLR Xunit" value="https://www.myget.org/F/coreclr-xunit/api/v3/index.json" / -->
6-
<!-- add key="AspNet CI Feed" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> -->
75
<add key="myget.org xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
6+
<add key="myget.org dotnet" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
87
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
98
</packageSources>
109
</configuration>
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Linq;
1+
using System.Linq;
32
using System.Threading.Tasks;
43
using TestStack.BDDfy.Tests.Stories;
54
using Xunit;
@@ -11,16 +10,9 @@ public class ParallelRunnerScenario
1110
[Fact]
1211
public async Task CanHandleMultipleThreadsExecutingBddfyConcurrently()
1312
{
14-
try
15-
{
16-
await Task.WhenAll(
17-
Enumerable.Range(0, 100)
18-
.Select(_ => Task.Run(() => new DummyScenario().BDDfy<ParallelRunnerScenario>())));
19-
}
20-
catch (Exception e)
21-
{
22-
Assert.False(true, "Threw exception " + e);
23-
}
13+
await Task.WhenAll(
14+
Enumerable.Range(0, 100)
15+
.Select(_ => Task.Run(() => new DummyScenario().BDDfy<ParallelRunnerScenario>())));
2416
}
2517
}
2618
}

src/TestStack.BDDfy.Tests/FodyWeavers.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
using System;
2+
using System.Linq.Expressions;
23
using System.Reflection;
34

45
namespace TestStack.BDDfy.Tests
56
{
67
public class Helpers
78
{
8-
public static MethodInfo GetMethodInfo(Action methodOn)
9+
public static MethodInfo GetMethodInfo(Expression<Action> methodOn)
910
{
10-
return methodOn.Method;
11+
var methodCallExp = (MethodCallExpression)methodOn.Body;
12+
return methodCallExp.Method;
1113
}
1214
}
1315
}

src/TestStack.BDDfy.Tests/ModuleInitializer.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/TestStack.BDDfy.Tests/NetToStringTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Shouldly;
33
using TestStack.BDDfy.Configuration;
44
using Xunit;
5-
using Xunit.Extensions;
65

76
namespace TestStack.BDDfy.Tests
87
{
@@ -78,8 +77,8 @@ public void ReportsIllegalExampleStepNames(string stepName, string expectedStepT
7877
NetToString.Convert(stepName).ShouldBe(expectedStepTitle, Case.Sensitive);
7978
});
8079

81-
Assert.NotNull(exception);
82-
Assert.IsType<ArgumentException>(exception);
80+
exception.ShouldNotBeNull();
81+
exception.ShouldBeOfType<ArgumentException>();
8382
}
8483
}
8584
}
Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,22 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3+
using Xunit;
34

4-
// General Information about an assembly is controlled through the following
5+
// General Information about an assembly is controlled through the following
56
// set of attributes. Change these attribute values to modify the information
67
// associated with an assembly.
7-
using ApprovalTests.Reporters;
8-
9-
[assembly: AssemblyTitle("BDDfy.Tests")]
10-
[assembly: AssemblyDescription("")]
118
[assembly: AssemblyConfiguration("")]
12-
[assembly: AssemblyCompany("Microsoft")]
13-
[assembly: AssemblyProduct("BDDfy.Tests")]
14-
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
9+
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyProduct("TestStack.BDDfy.Tests")]
1511
[assembly: AssemblyTrademark("")]
16-
[assembly: AssemblyCulture("")]
1712

18-
// Setting ComVisible to false makes the types in this assembly not visible
19-
// to COM components. If you need to access a type in this assembly from
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
2015
// COM, set the ComVisible attribute to true on that type.
2116
[assembly: ComVisible(false)]
2217

2318
// The following GUID is for the ID of the typelib if this project is exposed to COM
24-
[assembly: Guid("f9519669-4620-4abd-977a-c3cb2b54126a")]
25-
26-
// Version information for an assembly consists of the following four values:
27-
//
28-
// Major Version
29-
// Minor Version
30-
// Build Number
31-
// Revision
32-
//
33-
// You can specify all the values or you can default the Build and Revision Numbers
34-
// by using the '*' as shown below:
35-
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.0.0.0")]
37-
[assembly: AssemblyFileVersion("1.0.0.0")]
19+
[assembly: Guid("1ceb33e8-3aac-4d02-a15b-5b75b5f662ad")]
3820

39-
[assembly: UseReporter(typeof(DiffReporter))]
21+
// BDDfy tests overwrite static configuration for test, cannot use parallel testing
22+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

src/TestStack.BDDfy.Tests/Reporters/Diagnostics/DiagnosticsReportBuilderTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NSubstitute;
1+
#if NSubstitute
2+
using NSubstitute;
23
using TestStack.BDDfy.Reporters;
34
using TestStack.BDDfy.Reporters.Diagnostics;
45
using TestStack.BDDfy.Reporters.Serializers;
@@ -21,4 +22,5 @@ public void ShouldSerializeDiagnosticDataToSpecifiedFormat()
2122
serializer.Received().Serialize(Arg.Any<object>());
2223
}
2324
}
24-
}
25+
}
26+
#endif

src/TestStack.BDDfy.Tests/Reporters/Diagnostics/DiagnosticsReporterTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if NSubstitute
2+
using System;
23
using System.Collections.Generic;
34
using NSubstitute;
45
using TestStack.BDDfy.Reporters;
@@ -46,3 +47,4 @@ private DiagnosticsReporter CreateSut()
4647
}
4748
}
4849
}
50+
#endif

0 commit comments

Comments
 (0)