[unit testing newbie] [c#]
Consider the following scenario:
I\'m using Silverlight and calling a WCF service. Silverlight can only call WCF services
You could use an AutoResetEvent to handle async calls.
Just initialize it as unset and configure your mock service to set it in the callback. (IE: var mockService = new Mock(); mockService.SetUp(x => x.MyMethod()).Returns(someStuff).Callback(() => handle.Set()); )
After that I use hadle.WaitOne(1000) to check if it was called. (IMHO 1000 miliseconds are more than enough to run the async code).
Sorry: This was supposed to go as a reply to the post above... I can't for the life of me figure out how to reply :)