mardi 23 février 2016

Unit Test deleting files without reason

When I run a specific unit test it deletes all the files in specific folder and it's subfolders. This is not intended and I have no idea why it is happening. It only affects one specific folder which is used by another test.

There are no calls to delete anywhere in the test or the classes under test. When using a breakpoint and debug the first thing that happens is a static string is made, before the breakpoint is even reached the files have been deleted.

My suspicion is that it's something to do with the test runner rebuilding the test when run and deleting unneeded files from the output location or something like that.

When rebuilding the solution all projects including tests are built into a folder Output\Debug or Output\Release. The specific folder is inside these as well as all the test dlls.

I'm using Nunit 2.64 and the Visual Studio Nunit test adapter.

Aucun commentaire:

Enregistrer un commentaire