You will need to add some synchronization code to the test. For  
example if the data layer returns an IAsyncResult then call WaitOne on  
its WaitHandle.

If all it does is call your delegate then you can create a  
ManualResetEvent before the call and to wait after the call. In the  
callback call Set on the event to put it in the signalled state.

Since the test involves synchronization I recommend using the Timeout  
attribute the set a timeout on the test in case the test gets stuck.  
For example if the callback never gets invoked then the test will  
sleep forever.

Jeff



On May 6, 2009, at 10:53 AM, "Jeff.Bruskin" <[email protected]> wrote:

>
> I am sure there is a simple answer but looking over the documentation
> I cannot find an attribute to resolve my issue.
>
> I have a data access layer with Asynchronous methods that accept a
> callback signature.  These methods return data the database within a
> data thread.  The test calls this method that should return a dataset
> via a delegate. This delegate is defined within the testing assembly.
> The issue is that the MBUnit thread and the gallio host thread unload
> while in the data thread before the delegate can return to the test
> assembly.  Is there anyway I can connect the waiting callback code to
> the original test attribute or any attribute so the running testing
> threads do not unload before my test is completed.
>
> Thanks in advance for any help
>
>
> Jeff B.
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to