Pro-Coded-Public / Pro.NBench.xUnit

Integration of NBench, xUnit and ReSharper / Visual Studio Test Explorer
MIT License
16 stars 4 forks source link

Exception(s) within fact method do not fail the test #6

Closed Farishta closed 5 years ago

Farishta commented 5 years ago

G'day

I would like to report the issue with the [NBenchFact] test method. In case of any uncaught/unexpected exception occurs within the code, it does not fail and marks it passed. See below example:

[NBenchFact] [PerfBenchmark(RunMode = RunMode.Iterations, TestMode = TestMode.Test, NumberOfIterations = 1, SkipWarmups = true)] [ElapsedTimeAssertion(MaxTimeMilliseconds = 100)] public void TestExceptionFailure() { throw new Exception("this exception should fail the test. BUT it does not."); }

The test should be failed if the normal flow is not completed.

mcquiggd commented 5 years ago

@Farishta Thanks for reporting this, I will investigate and inform of a fix.

Farishta commented 5 years ago

@mcquiggd

Please have a look at the PR https://github.com/Pro-Coded/Pro.NBench.xUnit/pull/7, where the possible fix was provided.

Cheers.

wsaeed commented 5 years ago

Can you please release the above commit?

mcquiggd commented 5 years ago

Hello @Farishta , @wsaeed - version 1.05 has been released and published to Nuget; if you still have problems, let me know and I will re-open this...