Now that I’m back from NDC London I have a chance to plan my upcoming speaking engagements – and it’s going to be a few busy months.I’ve already blogged about my plans for the next few months but since then I found out that I’ll be coming back to London (always a pleasure) in March … Continue reading New Speaking engagement – DevWeek 2015
Tag: Concurrent
Unit testing concurrent code using custom TaskScheduler
Today I had a need to test an action that runs inside a Task: [code lang="csharp"] public class ClassToTest { private readonly IMessageBus _messageBus; private CancellationTokenSource _cancellationTokenSource; public event EventHandler OnNewMessage;</pre> public ClassToTest(IMessageBus messageBus) { _messageBus = messageBus; } public void Start() { _cancellationTokenSource = new CancellationTokenSource(); Task.Run(() => { var message = _messageBus.GetNextMessage(); // … Continue reading Unit testing concurrent code using custom TaskScheduler