tag:blogger.com,1999:blog-269779592278926433.post5481856733203889368..comments2023-04-10T11:19:07.381+02:00Comments on Parsimony: Mocking out WCF Services in Silverlight 2.0 for Unit TestingMalcolm Jackhttp://www.blogger.com/profile/15007175879502154384noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-269779592278926433.post-83674283057044369882011-10-18T10:47:50.400+02:002011-10-18T10:47:50.400+02:00Thanks Jax. This post was very helpful to me.Thanks Jax. This post was very helpful to me.Anonymoushttps://www.blogger.com/profile/14188983447072583815noreply@blogger.comtag:blogger.com,1999:blog-269779592278926433.post-88736006437903859262011-09-21T16:59:51.339+02:002011-09-21T16:59:51.339+02:00Jeremy - we haven't needed to mock out the asy...Jeremy - we haven't needed to mock out the async behaviour of the service, but I would imagine it fairly simple to accomplish - in our scenario - we use Moq - so we would set up the method call with a Callback, and in the callback use a BackgroundWorker to spin off some logic, and on the completed event of the background worker, raise the completed event of the service call. Because the BackgroundWorker spins it's logic on a seperate thread, the service completed event will effectively be async.<br />In theory anyway ;)Malcolm Jackhttps://www.blogger.com/profile/15007175879502154384noreply@blogger.comtag:blogger.com,1999:blog-269779592278926433.post-25629909426719257562011-09-19T17:45:21.301+02:002011-09-19T17:45:21.301+02:00How do you get the asynchronous behavior from the ...How do you get the asynchronous behavior from the mock? The *Completed event should be raised after the *Async() call but not from with in the Async() call.Jeremyhttps://www.blogger.com/profile/11551461619678404184noreply@blogger.com