Progress Telerik JustMock

Mock Threadpool

Nasa, Visa, Microsoft Fox, Samsung, IBM World Bank Group, Volvo
  • Mocking Threadpool Overview

    Threadpool is a class that provides a pool of threads that can be used to execute tasks, post work items, process asynchronous I/O, wait on behalf of other threads and process timers.

    With JustMock, you could mock every required member with ease and test your code in isolation from its dependencies.

    public void ShouldInvokeMockInsideAChildThreadFromThreadPool()
        var mockable = Mock.Create<Mockable>();
        Mock.Arrange(() => mockable.IsMocked).Returns(true);
        bool mocked = false;
        var latch = new WaitLatch();
        ThreadPool.QueueUserWorkItem((cookie) =>
                mocked = mockable.IsMocked;

    Mock Threadpool documentation

Next Steps

See Plans & Pricing

Purchase individual products or any of the bundles

Download Free Trial

With dedicated technical support.