1

I have a codebase with NUnit test suites, which I run with both Resharper Unit Test Sessions and NCrunch.

One of my test requires FakeItEasy.OutAndRefParametersConfigurationExtensions. Most of the time it works, but occasionally NCrunch fails that test with error:

System.TypeLoadException : Could not load type 'FakeItEasy.OutAndRefParametersConfigurationExtensions' from assembly 'FakeItEasy, Version=1.21.0.0, Culture=neutral, PublicKeyToken=eff28e2146d5fd2c'.

  • Re-running the test in NCrunch invariably fixes it immediately.
  • I don't get that sort of error on any other test
  • The Resharper Unit Test runner doesn't have any issues with it at all.
  • I feel like the failures generally seem to happen in association with a git jump, or a Solution Clean, or an NCrunch "Resync"

Any ideas what's wrong and/or what I could do to make these false positives go away?

Nkosi
  • 235,767
  • 35
  • 427
  • 472
Brondahl
  • 7,402
  • 5
  • 45
  • 74
  • Can you show the InnerException? It might give more details. – Thomas Levesque Dec 14 '17 at 00:25
  • Annoyingly NCrunch doesn't report the whole Exception object when just running tests, and since I haven't yet figured out a way to reliably trigger it, I can't catch it in a debug run. Any suggestions? @ThomasLevesque – Brondahl Jan 05 '18 at 23:27
  • You could just catch the exception and dump the details to a file – Thomas Levesque Jan 06 '18 at 23:36
  • I can't see how to catch the exception. It isn't being thrown on a line of my code - it seems to be thrown by the NCrunch Runner? – Brondahl Jan 26 '18 at 09:01
  • There isn't a line of my test that is marked as throwing an error - that test doesn't get enterred – Brondahl Jan 26 '18 at 09:02
  • Maybe it fails during the setup phase? Can you run the test in debug with "break when exception is thrown" enabled? (I don't know if NCrunch allows you to debug tests) – Thomas Levesque Jan 26 '18 at 10:00

0 Answers0