For starters: I am new to Visual Studio and SpecFlow in general.
Following the getting started documentation on SpecFlow I get 2 different outcomes depending on what type of project I start.
Unit Test Project: in this type of projects, the test's aren't recognized by the runner at all. Only the "SpecRun Evaluation" test runs.
MSTest Test Project (.NET Core): in this type of projects, the tests are always passing but I do get an error in the Tests output: "Value cannot be null. Parameter name: message" and that's caused by a "generator"
I'm doing all this on a typical Windows 10 Pro. I have tried both on VS 2017 and 2019. I have tried re-doing the whole process in case I've missed something. Also tried updating packages. Something that maybe should be noted, Unit Test Projects do not generate an App.config file.
using System;
using TechTalk.SpecFlow;
namespace Tests.Steps
{
[Binding]
public class CalculatorSteps
{
[Given(@"I have entered (.*) into the calculator")]
public void GivenIHaveEnteredIntoTheCalculator(int p0)
{
Console.WriteLine(p0);
}
[Given(@"I have also entered (.*) into the calculator")]
public void GivenIHaveAlsoEnteredIntoTheCalculator(int p0)
{
Console.WriteLine(p0);
}
[When(@"I press add")]
public void WhenIPressAdd()
{
Console.WriteLine("add pressed");
}
[Then(@"the result should be (.*) on the screen")]
public void ThenTheResultShouldBeOnTheScreen(int p0)
{
Console.WriteLine(p0);
}
}
}
I would pretty much expect for the tests to run and to get some kind of a feedback when I intentionally throw an exception in a test.
All of this is just a task for a job application, but what I've provided is the default feature file that gets generated, as both situations have that outcome. I already have an idea how to complete the task and here I am stuck on the Set Up for hours... I really hope it's just my stupidity/inexperience.
.csproj: https://codeshare.io/5zxk0W