fsprojects / TickSpec

Lean .NET BDD framework with powerful F# integration
Apache License 2.0
133 stars 23 forks source link

Documentation missing step for setup #41

Closed rallentan closed 3 years ago

rallentan commented 3 years ago

After installing the Nuget package, pressing 'F5' video doesn't run the tests as suggested in the documentation video (you can't run a class library). There must be some step not mentioned in the documentation needed to complete setup of TickSpec.

Steps to Replicate:

  1. Create an F# xUnit test project in Visual Studio 2019
  2. Add Feature.txt and StepDefinitions.fs files
  3. Install TickSpec.xUnit
  4. Press F5

Result: Error message box saying "A project with an Output Type of Class Library cannot be started directly [...]"

TickSpec seems to work a bit different from SpecFlow. What is the best way to run a TickSpec test from Visual Studio?

bartelink commented 3 years ago

The TickSpec.xUnit package is designed to expose the tests to the xUnit runner (well, the xUnit discoverer)

The general process whereby this works (and/or can go wrong) is covered in this article from the xunit project

The F5 process would require the project to be an EXE and have a main to run it. I suspect there's probably an example for doing that buried somewhere on Phil's blog. (as it happens xUnit V3 will end up with test projects becoming exes once again!)

A PR to guide someone not familiar with xUnit.net via a set of steps in README.md would be a useful PR if you have the time and inclination ;)

rallentan commented 3 years ago

Thank you. The example projects were also helpful in getting it setup (https://github.com/fsprojects/TickSpec/tree/master/Examples/ByFramework). It might be useful in the main documentation to reference these resources to get TickSpec setup with as little effort as possible.

bartelink commented 3 years ago

@rallentan That's a good suggestion... if you can find a nice place to put it in a PR, exactly where you would have benefited from it, it'd be really appreciated

bartelink commented 3 years ago

@rallentan Anything else you'd add to @cbouderau's PR ?