Build/Test Issues

xUnit tests classes with the same name cause NCrunch not to execute the test

Started by juanmanuelmedina on 4,412 views

We are using xUnit to run our Solution tests.

Recently we added multiple types of tests that test the same classes but with different intentions, that is we have Unit, Integration and Acceptance tests.
All tests classes are in different namespaces.

When running the tests using the ReSharper runner, there are no issues.

However, NCrunch seems unable to differentiate the tests if the test class names are exactly the same.

For example,


namespace Tests.Unit.Repository
{
public class RepositorySpecs
{
...

namespace Tests.Integration.Repository
{
public class RepositorySpecs
{
...

Will cause a message like:

"This test was not executed during a planned execution run. Ensure your test project is stable and does not contain issues in initialisation/teardown fixtures."


Of course, renaming the test addresses the issue, but I have a hard time asking our large development team to change convention for naming since this is only an issue with using NCrunch.

I checked around on the forums and found out this type of message is due to a number of issues, but did not see anything particular about duplicate class names causing confusion.

Note that the namespaces are different, but both Unit and Integration are in the same project.


Is there a setting or a known issue I am missing? Note that excluding one of the namespaces does not seem to address the issue.



Best Regards,


Juan M. Medina

Edited

Hi Juan,

NCrunch has no deliberate constraints like this ... as far as I know, the code you've described should work correctly.

I am aware that having tests with the same namespace, class and method name can cause issues, as NCrunch uses these three pieces of information to uniquely identify them. However, in your case, the namespaces are different, so the tests should be shown and tracked separately from each other.

I've just tried a few tests myself, and I can't seem to reproduce this issue with a code sample. Is there any chance you could throw together a project that produces this problem and submit it through the contact form? I wonder if there is something deeper here that is amiss.

Post a reply

Log in to reply.