-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
π What did you see?
All steps in feature files report as undefined.
β What did you expect to see?
Feature files should have defined steps.
π¦ Which tool/library version are you using?
dotnet --version: 10.0.201
Reqnroll.MsTest: 3.3.3
π¬ How could we reproduce it?
.vscode/settings.json:
{
"cucumber.features": ["./features/**/*.feature"],
"cucumber.glue": ["./Steps/**/*.cs"]
}
[PROJECT NAME].csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest" Version="4.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
<PackageReference Include="Reqnroll.MsTest" Version="3.3.3" />
</ItemGroup>
</Project>
features/Calculator.feature:
Feature: Calculator
Scenario: Add two numbers
Given The first number is 50
And The second number is 70
When The two numbers are added
Then The result should be 120
Steps/Calculator.cs:
namespace [PROJECT NAME].Steps;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Reqnroll;
[Binding]
public sealed class Calculator(FeatureContext _context)
{
private FeatureContext context = _context;
[Given("The first number is {int}")]
public void SetFirst(int number)
{
context.Add("first", number);
}
[Given("The second number is {int}")]
public void SetSecond(int number)
{
context.Add("second", number);
}
[When("The two numbers are added")]
public void AddForResult()
{
context.Add("result", context.Get<int>("first") + context.Get<int>("second"));
}
[Then("The result should be {int}")]
public void AssertResultEquals(int result)
{
Assert.AreEqual(context.Get<int>("result"), result);
}
}
π Any additional context?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels