ttutisani / Xunit.Gherkin.Quick

BDD in .NET Core - using Xunit and Gherkin (compatible with both .NET Core and .NET)
MIT License
202 stars 27 forks source link

Tests aren't visible in test explorer in visual studio code #153

Open MPSwift opened 5 months ago

MPSwift commented 5 months ago

Hi, I'm using Visual Studio Code, .NET v8 and the latest version of this framework (v.4.5) but I can't make it to show the tests in the test explorer. I can see all the other xUnit test cases (see below structur "MyOtherUnitTestCases") but not the cucumber tests ("MyApiTestCases").

I write the cs file with the step definition where given, when, then contains simply a log "not yet implemented" and I have the feature file. My expectation is to see the tests in the test explorere and if I run them to get the log prints "not yet implemented".

The structur is like: MyProject --MyApiTestCases ----MyTest.feature ----MySteps.cs --MyOtherUnitTestCases ----MyUnitTestA ----MyUnitTestB

What am I missing? Should feature file and cs file have the same name?

ttutisani commented 5 months ago

Yes, the feature file and cs file are linked using the [FeatureFile] attribute.

If this does not resolve the issue, since there are multiple steps to properly configuring the tests, I suggest that you follow the Getting Started tutorial (on the home page). Once that works, modify to tailor to your needs.

MPSwift commented 5 months ago

Hm, the [FeatureFile] attribute exist and I followed the getting started but the tests are still not visible in the test explorer in VS Code. I tried with coping the Calculator.cs, the AddTwoNumbers.cs and AddTwoNumbers.feature but they are also not visible in the test explorer.

ttutisani commented 5 months ago

So the ProjectConsumer tests are not showing out of the box? Okay, that must be something else, then.