sqltddvisual-studio-dbpro

How do you make the unit test sleep for a period of time within the database pro version of visual studio?


using visual studio (database pro) 2008, i have created a unit test (using the SQL unit test) that tests several stored procedures in order.

The solution is designed to call each SP after a period of time, not within the same second.

Thus the unit test fail and requires a short pause between each call.

Any ideas? is there a standard Thread.Sleep style function i can use?


Solution

  • Having unit tests that are slow is always bad. Having unit tests depending on each other (don't know if that is the case) is also bad.

    So I strongly suggest you try designing your code so you can test without the delays. But if you really want delays WaitFor might be the solution (assuming SQL server).