Re: Stopping Tests in Code
Hey,
Rather than do that, use an Initialize method either at the start of all the unit tests, or have it run on a per test basis:
http://msdn.microsoft.com/en-us/libr...attribute.aspx
or
http://msdn.microsoft.com/en-us/libr...attribute.aspx
Hope that helps!!
Gary
Re: Stopping Tests in Code
Quote:
Originally Posted by
gep13
Hope that helps!!
Yes it does, thanks.
In fact, it has given me an idea. I can check that the tables that have to be empty are, and if they are not, I can empty them there and then.
Then re-run the delete stuff again in the Cleanup method, just to make sure.
Or, I could just trust the testers to follow instructions ... maybe not.
Re: Stopping Tests in Code
Quote:
Originally Posted by
GlenW
Or, I could just trust the testers to follow instructions ... maybe not.
Now that would just be silly :)
Sounds like you have got the idea though. I would tend to have one method that blanks the entire database back to a known state, and then call that regardless before each test.
Gary