Skip to content

Commit 6a773a2

Browse files
upgrade .net framework
move to github actions fix parallel tests failing
1 parent 33fdc8c commit 6a773a2

File tree

14 files changed

+66
-99
lines changed

14 files changed

+66
-99
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build and Test
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Build project
15+
run: dotnet build --configuration Release
16+
17+
- name: Run tests
18+
run: dotnet test --configuration Release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tools/Cake/
2828
tools/GitReleaseNotes/
2929
tools/gitversion.commandline/
3030
artifacts/
31+
*.code-workspace

src/NuGet.config

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
55
<AssemblyName>TestStack.BDDfy.Samples</AssemblyName>
66
<PackageId>TestStack.BDDfy.Samples</PackageId>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
8-
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
98
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
109
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1110
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@@ -16,24 +15,13 @@
1615
</ItemGroup>
1716

1817
<ItemGroup>
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
20-
<PackageReference Include="Microsoft.NETCore.Platforms" Version="2.0.0" />
21-
<PackageReference Include="shouldly" Version="3.0.0-beta0003" />
22-
<PackageReference Include="xunit" Version="2.3.1" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
19+
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
20+
<PackageReference Include="shouldly" Version="4.3.0" />
21+
<PackageReference Include="xunit" Version="2.9.3" />
22+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
23+
<PrivateAssets>all</PrivateAssets>
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
</PackageReference>
2426
</ItemGroup>
25-
26-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
27-
<PackageReference Include="System.Linq" Version="4.3.0" />
28-
</ItemGroup>
29-
30-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
31-
<DefineConstants>$(DefineConstants);Approvals;Culture;NSubstitute</DefineConstants>
32-
</PropertyGroup>
33-
34-
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
35-
<Reference Include="System" />
36-
<Reference Include="Microsoft.CSharp" />
37-
</ItemGroup>
38-
3927
</Project>

src/TestStack.BDDfy.Tests/Configuration/ProcessorPipelineTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace TestStack.BDDfy.Tests.Configuration
99
{
10+
[Collection("ExclusiveAccessToConfigurator")]
1011
public class ProcessorPipelineTests
1112
{
1213
[Fact]

src/TestStack.BDDfy.Tests/Configuration/StepExecutorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace TestStack.BDDfy.Tests.Configuration
77
{
8+
[Collection("ExclusiveAccessToConfigurator")]
89
public class StepExecutorTests
910
{
1011
private class TestStepExecutor : StepExecutor

src/TestStack.BDDfy.Tests/Configuration/TestRunnerTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System;
22
using System.Linq;
3-
using NUnit.Framework;
43
using Shouldly;
54
using TestStack.BDDfy.Configuration;
65
using Xunit;
76

87
namespace TestStack.BDDfy.Tests.Configuration
98
{
9+
[Collection("ExclusiveAccessToConfigurator")]
1010
public class TestRunnerTests
1111
{
1212
public class ScenarioWithFailingThen
@@ -104,6 +104,8 @@ public void FailingThenDoesNotStopThePipelineWithReflectiveAPI()
104104
[Fact]
105105
public void FailingThenDoesNotStopThePipelineWithFluentAPI()
106106
{
107+
Configurator.Processors.TestRunner.StopExecutionOnFailingThen = false;
108+
107109
var testRun = new ScenarioWithFailingThen()
108110
.Given(x => x.PassingGiven())
109111
.When(x => x.PassingWhen())

src/TestStack.BDDfy.Tests/Exceptions/ExceptionThrowingTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace TestStack.BDDfy.Tests.Exceptions
66
{
77
public class ExceptionThrowingTest<T> where T : Exception, new()
88
{
9-
private static bool _givenShouldThrow;
10-
private static bool _whenShouldThrow;
11-
private static bool _thenShouldThrow;
9+
private bool _givenShouldThrow;
10+
private bool _whenShouldThrow;
11+
private bool _thenShouldThrow;
1212
Scenario _scenario;
1313

1414
void Given()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Xunit;
2+
3+
namespace TestStack.BDDfy.Tests
4+
{
5+
[CollectionDefinition("ExclusiveAccessToConfigurator", DisableParallelization = true)]
6+
public class ExclusiveAccessToConfiguratorFixture
7+
{
8+
}
9+
}

src/TestStack.BDDfy.Tests/Scanner/FluentScanner/ComplexStepsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ComplexStepsTests
1313
[Fact]
1414
public void ShouldBeAbleToChainComplexTestWithFluentApi()
1515
{
16-
this.Given(_ => count.ShouldBe(0))
16+
this.Given(_ => count.ShouldBe(0, "count should start with 0"))
1717
.When(() => count++.ShouldBe(0), "When I do something")
1818
.Given(() => count++.ShouldBe(1), "Given I am doing things in different order")
1919
.Then(() => count++.ShouldBe(2), "Then they should run in defined order")

0 commit comments

Comments
 (0)