Skip to content

Commit 46c7e69

Browse files
committed
Add ParallelExecution test
1 parent c6ac650 commit 46c7e69

21 files changed

+743
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34316.72
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReqnrollCalculator.Specs.MsTestFw", "ReqnrollCalculator.Specs.MsTestFw\ReqnrollCalculator.Specs.MsTestFw.csproj", "{99D7B29C-75DD-4908-8FA1-530FD7C2275D}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReqnrollCalculator", "ReqnrollCalculator\ReqnrollCalculator.csproj", "{BECCF222-AB31-413A-A7E3-9C25DAE7E0BF}"
9+
EndProject
10+
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ReqnrollCalculator.Specs.StepDefinitions", "ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.shproj", "{4B0E8DA1-CB6E-4975-80EE-E74EF762D80A}"
11+
EndProject
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReqnrollCalculator.Specs.NUnitFw", "ReqnrollCalculator.Specs.NUnitFw\ReqnrollCalculator.Specs.NUnitFw.csproj", "{F69D095D-5C43-448F-AE2A-09AD322BC32C}"
13+
EndProject
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReqnrollCalculator.Specs.XUnitFw", "ReqnrollCalculator.Specs.XUnitFw\ReqnrollCalculator.Specs.XUnitFw.csproj", "{EF9AFB73-A0F2-47F4-B973-531800E8D862}"
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Release|Any CPU = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22+
{99D7B29C-75DD-4908-8FA1-530FD7C2275D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{99D7B29C-75DD-4908-8FA1-530FD7C2275D}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{99D7B29C-75DD-4908-8FA1-530FD7C2275D}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{99D7B29C-75DD-4908-8FA1-530FD7C2275D}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{BECCF222-AB31-413A-A7E3-9C25DAE7E0BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{BECCF222-AB31-413A-A7E3-9C25DAE7E0BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{BECCF222-AB31-413A-A7E3-9C25DAE7E0BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{BECCF222-AB31-413A-A7E3-9C25DAE7E0BF}.Release|Any CPU.Build.0 = Release|Any CPU
30+
{F69D095D-5C43-448F-AE2A-09AD322BC32C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31+
{F69D095D-5C43-448F-AE2A-09AD322BC32C}.Debug|Any CPU.Build.0 = Debug|Any CPU
32+
{F69D095D-5C43-448F-AE2A-09AD322BC32C}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{F69D095D-5C43-448F-AE2A-09AD322BC32C}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{EF9AFB73-A0F2-47F4-B973-531800E8D862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{EF9AFB73-A0F2-47F4-B973-531800E8D862}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{EF9AFB73-A0F2-47F4-B973-531800E8D862}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{EF9AFB73-A0F2-47F4-B973-531800E8D862}.Release|Any CPU.Build.0 = Release|Any CPU
38+
EndGlobalSection
39+
GlobalSection(SolutionProperties) = preSolution
40+
HideSolutionNode = FALSE
41+
EndGlobalSection
42+
GlobalSection(ExtensibilityGlobals) = postSolution
43+
SolutionGuid = {204F3869-2413-4BDC-A534-6F5782D593EF}
44+
EndGlobalSection
45+
GlobalSection(SharedMSBuildProjectFiles) = preSolution
46+
ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.projitems*{4b0e8da1-cb6e-4975-80ee-e74ef762d80a}*SharedItemsImports = 13
47+
ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.projitems*{99d7b29c-75dd-4908-8fa1-530fd7c2275d}*SharedItemsImports = 5
48+
ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.projitems*{ef9afb73-a0f2-47f4-b973-531800e8d862}*SharedItemsImports = 5
49+
ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.projitems*{f69d095d-5c43-448f-ae2a-09ad322bc32c}*SharedItemsImports = 5
50+
EndGlobalSection
51+
EndGlobal
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition1
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition2
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition3
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
// class-level parallel
4+
[assembly: Parallelize(Workers = 4, Scope = ExecutionScope.ClassLevel)]
5+
6+
// method-level parallel
7+
//[assembly: Parallelize(Workers = 4, Scope = ExecutionScope.MethodLevel)]
8+
9+
// no parallel
10+
//[assembly: DoNotParallelize]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
11+
<PackageReference Include="Reqnroll.MsTest" Version="2.1.2-local" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
13+
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\ReqnrollCalculator\ReqnrollCalculator.csproj" />
18+
</ItemGroup>
19+
20+
<Import Project="..\ReqnrollCalculator.Specs.StepDefinitions\ReqnrollCalculator.Specs.StepDefinitions.projitems" Label="Shared" />
21+
22+
</Project>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition1
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition2
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Feature: Addition3
2+
3+
The calculator functions related to addition,
4+
that is denoted with the '+' operator.
5+
6+
@core
7+
Rule: Positive numbers can be added
8+
9+
Scenario: Add two numbers
10+
This is the most common use-case:
11+
people often sum two numbers.
12+
13+
Given the first number is 50
14+
And the second number is 70
15+
When the two numbers are added
16+
Then the result should be 120
17+
18+
@commutativity
19+
Scenario: Addition is commutative
20+
Given the first number is 70
21+
And the second number is 50
22+
When the two numbers are added
23+
Then the result should be 120
24+
25+
Rule: Non-positive numbers can be added
26+
27+
@edgeCase
28+
Scenario Outline: Add zeros
29+
Given the first number is <first>
30+
And the second number is <second>
31+
When the two numbers are added
32+
Then the result should be <result>
33+
Examples:
34+
| description | first | second | result |
35+
| #1 | 0 | 0 | 0 |
36+
| #2 | 0 | 42 | 42 |
37+
| #3 | 42 | 0 | 42 |
38+
39+
Scenario: Add negatives
40+
Given the entered numbers are
41+
| number |
42+
| -5 |
43+
| -7 |
44+
When the two numbers are added
45+
Then the result should be -12
46+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// class-level parallel
2+
[assembly: NUnit.Framework.Parallelizable(NUnit.Framework.ParallelScope.Fixtures)]
3+
4+
// method-level parallel
5+
//[assembly: NUnit.Framework.Parallelizable(NUnit.Framework.ParallelScope.Children)]
6+
//[assembly: NUnit.Framework.FixtureLifeCycle(NUnit.Framework.LifeCycle.InstancePerTestCase)]

0 commit comments

Comments
 (0)