Ive just been looking over a couple of BizUnit steps and have decided to create a couple of custom versions. The main reason that I have modified them is that I can reduce the length of time taken on my build process if the tests are quicker. The changes I have made are as follows:
In the standard step the executing thread is put to sleep for the timeout duration before looking for the file. In practice you often have to modify this setting as you learn how long your tests take to execute. What I also find in practice is that developers often set this value quite high to stop their tests failing, but this just makes the tests all run longer.
I have added a DelayBeforeCheck parameter which will let you put the thread to sleep for a period before checking for the files. I will then keep checking for the number of seconds defined in the timeout value. There is also an IntervalBetweenChecks parameter which will allow you to pause the thread for a given time between checks. the rest of the parameters are the same as the standard step.
An example of how you might use this step is that you would run your BizTalk process in your test, and then use the FilesExistStep. You might configure it to wait for 5 seconds before looking for the file. It would then check for upto 60 seconds with a 5 second pause between each check. When the step detects the file it has executed successfully.
I have also created a custom version of the EventLogCheckStep which does exactly the same process of checking as the FilesExist step above, but checks the event log instead.
If you would like to check out these steps the sample is available below:
Update: Just spotted the wait on file step in BizUnit. Dont know where this little bitch has been hiding but very useful