mardi 18 avril 2017

A test method fails when debugging and succeeds when running without debugging

In Visual Studio 2015, I wrote a C# test method for some C# method created by others.

My test method always succeed, while it always fail when I debug my test method into the method being tested by pausing at the many breakpoints set up throughout the method being tested.

  • The method being tested is very complicated and calls other methods into several levels.

  • The breakpoints are too many set within the method being tested, it is hard to find out which breakpoints' existence can cause the difference in running my test methods and debugging into it.

  • the method being tested is multithreaded.

    I wonder what might be the possible reasons that fail my test method when debugging and make it succeed when running it without debugging?

The code is very complicated, and I am not sure how to simplify it and which part to post here.

Thanks.

Aucun commentaire:

Enregistrer un commentaire