Unit testing blocks


  • Hi,

    I need to introduce some synchronous behavior in my asynchronous code that uses blocks. I want to move away from using wait handles with timeouts etc. I thought I'd be able to just specify a TaskScheduler so that messages are pushed through the blocks synchronously, but apparently that isn't right (or I've implemented it incorrectly!). I've tried implementing my own TaskScheduler that calls RunSynchronously on the task, but it complained that the task had already started.

    Can anyone point me in the right direction here please?


    Monday, November 05, 2012 6:11 PM


  • Ok just to answer my own question..turns out there is a TryExecuteTask method on TaskScheduler I didn't know about, so all I had to do was implement my own TaskScheduler that just calls this method.
    • Marked as answer by MachinaTP Tuesday, November 06, 2012 8:51 AM
    Tuesday, November 06, 2012 8:50 AM