Build/Test Issues

xunit v4 (mtp) and ordered tests

Started by Argamon on 5 views

I know it is a bad design, but it is what it is.

I have some test code in a legacy project where multiple tests have to run in a defined order, e.g. T1 writes some data into a in memory database while T2 expects this data to exist.

This was achieved with a custom implementation of ITestCaseOrderer.

When I try to debug T2 NCrunch understands this wiring and calls T1 first. Thats perfect.

Now I upgradet the project to the new version. Due to the changes I had to replace the ITestCaseOrderer with a new ITestMethodorderer.

Thats basically the whole change in code. (Of course I had also to replace TestCaseOrdererAttribute with TestMethodOrdererAttribute).

Now the tests fail in NCrunch (they work on the cmdline with dotnet test)

The reason is clear. When I do the same as before, debug T2 the code of T1 is no longer executed.

It seems NCrunch no longer understands the relation between these tests.

Post a reply

Log in to reply.