public void Post() { // Arrange Mock <SynchronizationContext> mockSyncContext = new Mock <SynchronizationContext>(); mockSyncContext .Expect(c => c.Send(It.IsAny <SendOrPostCallback>(), null)) .Callback( delegate(SendOrPostCallback d, object state) { d(state); }); AsyncManager helper = new AsyncManager(mockSyncContext.Object); bool wasCalled = false; // Act helper.Post(() => { wasCalled = true; }); // Assert Assert.IsTrue(wasCalled); }