Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit f2cb629

Browse files
richardjhardingstajs
authored andcommitted
Updated readme and package version for migration to csproj tooling (#44)
* updated package version and README to reflect support for csproj tooling * correct typo
1 parent 01b67c0 commit f2cb629

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

README.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,67 @@
44

55
As at the time of writing (September 2016), the `SpecFlow for Visual Studio 2015` extension does not play well with .NET Core projects (`.xproj`).
66

7+
**Updated Feb 2017 to work with the 1.0.0-rc4 tooling and .csproj**
8+
79
## The solution
810

911
Wait for the VS extension to support .NET Core projects. In the meantime, I present...
1012

1113
## The (hopefully temporary) solution
1214

1315
Update your `project.json`:
16+
Update your test projects .csproj or add a reference to the project in Visual Studio 2017
1417

1518
0. Include your testrunner of choice
1619

1720
* [xUnit](https://github.com/xunit/dotnet-test-xunit):
18-
19-
```json
20-
"dependencies": {
21-
"xunit": "2.1.0",
22-
"dotnet-test-xunit": "1.0.0-*"
23-
},
24-
"testRunner": "xunit"
21+
Reference to the xunit package is used to identify xunit as the testrunner
22+
23+
```xml
24+
<ItemGroup>
25+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
26+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
27+
<PackageReference Include="SpecFlow" Version="2.1.0" />
28+
<PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
29+
</ItemGroup>
2530
```
2631

2732
* [NUnit 3](https://github.com/nunit/dotnet-test-nunit) _(Experimental)_:
28-
```json
29-
"dependencies": {
30-
"NUnit": "3.4.1",
31-
"dotnet-test-nunit": "3.4.0-beta-2"
32-
},
33-
"testRunner": "nunit"
33+
eference to the NUnit package is used to identify nunit as the testrunner
34+
```xml
35+
<ItemGroup>
36+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
37+
<PackageReference Include="SpecFlow" Version="2.1.0" />
38+
<PackageReference Include="NUnit" Version="3.4.1" />
39+
<PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-2" />
40+
</ItemGroup>
3441
```
3542

3643
* [MsTest](https://www.nuget.org/packages/dotnet-test-mstest/1.1.1-preview) _(Experimental)_:
37-
```json
38-
"dependencies": {
39-
"dotnet-test-mstest": "1.1.1-preview",
40-
"MSTest.TestFramework": "1.0.4-preview"
41-
},
42-
"testRunner": "mstest"
44+
Reference to the MSTest.TestFramework package is used to identify mstest as the testrunner
45+
```xml
46+
<ItemGroup>
47+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
48+
<PackageReference Include="MSTest.TestAdapter" Version="1.1.8-rc" />
49+
<PackageReference Include="SpecFlow" Version="2.1.0" />
50+
<PackageReference Include="MSTest.TestFramework" Version="1.0.8-rc" />
51+
</ItemGroup>
4352
```
4453

4554
0. Include [`SpecFlow.NetCore`](https://www.nuget.org/packages/SpecFlow.NetCore):
4655

47-
```json
48-
"tools": {
49-
"SpecFlow.NetCore": "1.0.0-*"
50-
}
56+
```xml
57+
<ItemGroup>
58+
<DotNetCliToolReference Include="SpecFlow.NetCore" Version="1.0.0-rc8" />
59+
</ItemGroup>
5160
```
5261

5362
0. Add a `precompile` script:
5463

55-
```json
56-
"scripts": {
57-
"precompile": [ "dotnet SpecFlow.NetCore" ]
58-
}
64+
```xml
65+
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
66+
<Exec Command="dotnet SpecFlow.NetCore" />
67+
</Target>
5968
```
6069

6170
0. Build for your tests to be discovered. **Note:** there is [a bug with the .NET Core CLI requiring a second build for newly added files to be discovered](https://github.com/stajs/SpecFlow.NetCore/issues/22).

src/SpecFlow.NetCore/SpecFlow.NetCore.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Description>Generate tests from SpecFlow feature files inside ASP.NET Core projects (.xproj's).</Description>
5-
<VersionPrefix>1.0.0-rc7</VersionPrefix>
5+
<VersionPrefix>1.0.0-rc8</VersionPrefix>
66
<Authors>stajs</Authors>
77
<TargetFrameworks>netcoreapp1.0;net46;net461</TargetFrameworks>
88
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers>
@@ -20,6 +20,7 @@
2020
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
2121
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
2222
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
23+
<PackageReleaseNotes>Updated to support 1.0.0-rc4 tooling and .csproj</PackageReleaseNotes>
2324
</PropertyGroup>
2425

2526
<ItemGroup>

0 commit comments

Comments
 (0)