ttutisani / Xunit.Gherkin.Quick

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

Prolems with Xunit.DependencyInjection #100

Closed fredericbirke closed 4 years ago

fredericbirke commented 4 years ago

After creating a vanilla project that includes both Xunit.Gherkin.Quick and Xunit.DependencyInjection, Xunit.Gherkin.Quick throws an ArgumentNullException.

System.ArgumentNullException : Value cannot be null. (Parameter 'testOutputHelper')
  Exception doesn't have a stacktrace

This seems to be caused in Xunit.Gherkin.Quick.ScenarioOutput line 20. image

In any c# class of the project I can inject the testOutputhelper just fine, any idea whats wrong here?

Minimal reproduction example can be found here: https://github.com/fredericbirke/gherkin-bug

ttutisani commented 4 years ago

Hi @fredericbirke,

Sorry for the delayed response!

I looked into your sample solution. The problem is that you are trying to define a custom test framework in Startup.cs file, on line 8:

image

If you comment out that line, the test starts working just fine.

I hope this helps! If not, let me know if you have further questions or comments.

ttutisani commented 4 years ago

I am assuming that the issue did not persist since I have not heard back. Closing the issue.