Build/Test Issues

Test-Names (and so the tests) of xBehave not displayed in NCrunch Tests Windows

Started by Der-Albert.com on 6,845 views

Hi Remco,

When you use https://github.com/xbehave/xbehave.net (and xUnit Extension with supports BDD Style Testing with xUnit) then only the name of the methods (Scenario) are shown in NCrunch. But not the Name of the Steps ... even Visual Studio shows the Steps ;) (in the Output of the Test Explorer), ReSharper and the xunit console also displays the step names with the correct state (failed or not)

https://github.com/xbehave/xbehave.net/wiki/Quickstart

Displaying the Step Names as single Tests is even more important with Examples

https://github.com/xbehave/xbehave.net/wiki/Scenarios-with-examples

Best Regards

Albert

Hi Albert,

Unfortunately, for NCrunch to meaningfully discover and report these steps is currently impossible.

NCrunch separates its test discovery and execution into two distinct steps. A test can only be created during test discovery, and can only be executed during its execution step. This is quite different to a number of other runners where the discovery of tests and their execution can often be mashed together. NCrunch relies on this different to support many of its features, particularly the dynamically controlled pipeline of tests.

Under xbehave, the steps inside the tests are non-deterministic. They cannot be identified during the discovery of the test and are only reported by the framework when the test is actually executed. This is a big problem for NCrunch, which cannot create new tests during their execution.

There is also the problem of the steps requiring a new dimension in the Project-Fixture-Test structure, which is not so simple to extend in NCrunch.

To deal with this, NCrunch groups the steps into their parent tests and provides an aggregate report.
So, what about displaying the test cases and Outcome in a visually appealing way afterwards in den results pane? Just like Visual Studio.
Der-Albert.com wrote:So, what about displaying the test cases and Outcome in a visually appealing way afterwards in den results pane? Just like Visual Studio.


As in .. breaking up the Tests Window output pane to section the results for each step?

I think at the moment the Tests Window output does introduce text markers separating the output between each step, though this certainly isn't very fancy.
No it shows nothing in the Test Output Windows

[img=(- BROKEN LINK -)]NCrunch[/img]

[img=(- BROKEN LINK -)]Visual Studio[/img]

The Test

[Scenario(DisplayName = "Weltfrieden_possible")]
[Example(2500, WeltfriedenState.Yes)]
[Example(2350, WeltfriedenState.Maybe)]
[Example(2200, WeltfriedenState.No)]
public void Weltfrieden_possible(int year, WeltfriedenState expected, WeltfriedenState result)
{
$"Given the Year {year}"
.x(() => With(new WeltContextYear(year)));

"When checking for possiblity"
.x(() => result = Subject.IsPossible());

"Then is should be {1}"
.x(() => result.Should().Be(expected));
}

Edited

Sorry, it looks like this isn't working the way it's expected to.

I'll see what I can do about adding some separation between the steps in the trace output.
I have build available now with a fix for this, if you're interested in giving it a try:

http://downloads.ncrunch.net/NCrunch_Console_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_Console_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_VS2008_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_VS2010_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_VS2010_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_VS2012_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_VS2012_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_VS2013_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_VS2013_2.17.0.4.zip
http://downloads.ncrunch.net/NCrunch_VS2015_2.17.0.4.msi
http://downloads.ncrunch.net/NCrunch_VS2015_2.17.0.4.zip

Post a reply

Log in to reply.