locked
Individual, successful unit tests fail when run with others RRS feed

  • Question

  • (Bear with me as I'm having a hard time describing my problem... Also, since I'm not sure how to phrase the question with a lot of detail, I'm just hoping for some general ideas and people who may have encountered similar scenarios..)

    I have a few unit tests for a solution that, when run individually in Visual Studio, run fine, but when I selected multiple tests to run, only the first test executed succeeds, while others all subsequent tests fail. The problem seems to arise while running Workflows, and since the system I am working in is rather large and complex, I'm finding it hard to wrap my head around it all and debug at the same time.

    Any ideas?
    Wednesday, December 30, 2009 12:55 AM

Answers

  • Are your tests acting on a common object whose state is changed in one or more tests? For eg: if test1 opens your website and logs in as user1 and ends test without logging out, while the remaining tests assume no user is logged in, then ur individual tests will pass but the tests will fail when run after test1 executes
    http://blogs.msdn.com/anutthara
    Wednesday, December 30, 2009 12:35 PM

All replies

  • Are your tests acting on a common object whose state is changed in one or more tests? For eg: if test1 opens your website and logs in as user1 and ends test without logging out, while the remaining tests assume no user is logged in, then ur individual tests will pass but the tests will fail when run after test1 executes
    http://blogs.msdn.com/anutthara
    Wednesday, December 30, 2009 12:35 PM
  • Thanks for the tip, you've definitely pointed me in the right direction :]
    Wednesday, December 30, 2009 6:13 PM