First, let's put aside the wisdom of avoiding writing unit tests which do anything with winforms. Sometimes you just have to suck it up :(
My test(s) looks like this:
[Test, RequiresSTA]
public void SomeTest()
{
using (var form = new SomeForm())
{
// Arrange
// Act
// Assert
}
}
My issue is that since moving to Windows 10, the forms don't close. If I kill the nCrunch.TestHost45.x86.exe process which is hosting them, they obviously do close.
On windows 8.1, this wasn't a problem - I just had to live with the annoyance of having the forms momentarily flash up if I happened to modify any code which impacted those tests.
I'm on the latest version of NCrunch, VS2013 (fully updated) and Windows 10.
I find it a little disturbing that disposing of a form isn't closing it in the Windows 10 UI. I hope that we haven't discovered yet another Windows 10 UI bug ...
NCrunch has no real awareness of UI, it just relies on your own code to do its thing. I have a feeling that this bug is bigger than NCrunch itself, so I'm afraid that I can't provide a direct fix for the problem (you might need to take it up with MS), but I might be able to provide you with a workaround.
If you're performing UI testing with dialogs appearing, I highly recommend you look into distributed processing. This will let you offload all the irritating UI testing to a different machine, keeping your development experience clean and clear. If you don't have any spare hardware to offload to, a simple VM hosted on your dev machine should still be enough to remove the interference.