cucumber / cucumber/vscode

All steps undefined when using .NET Reqnroll

Open
#308 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
33
PR merge metrics
No merged PRs in 30d

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`:
```


net8.0








```
`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("first") + context.Get("second"));
}

[Then("The result should be {int}")]
public void AssertResultEquals(int result)
{
Assert.AreEqual(context.Get("result"), result);
}
}
```

### 📚 Any additional context?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.