Last active
August 29, 2015 14:02
-
-
Save renestein/864ad719fbd30d38767b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class IAutonomousSchedulerTests : ITaskSchedulerTests | |
{ | |
private TaskFactory m_testTaskFactory; | |
protected abstract IProxyScheduler ProxyScheduler | |
{ | |
get; | |
} | |
public TaskFactory TestTaskFactory | |
{ | |
get | |
{ | |
return m_testTaskFactory; | |
} | |
} | |
public override void InitializeTest() | |
{ | |
m_testTaskFactory = new TaskFactory(ProxyScheduler.AsTplScheduler()); | |
base.InitializeTest(); | |
} | |
.... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IoServiceThreadPoolSchedulerTests : IAutonomousSchedulerTests | |
{ | |
private ProxyScheduler m_proxyScheduler; | |
private IoServiceScheduler m_ioService; | |
private ITaskScheduler m_threadPool; | |
protected override IProxyScheduler ProxyScheduler | |
{ | |
get | |
{ | |
return m_proxyScheduler; | |
} | |
} | |
protected override ITaskScheduler Scheduler | |
{ | |
get | |
{ | |
return m_threadPool; | |
} | |
} | |
public override void InitializeTest() | |
{ | |
m_ioService = new IoServiceScheduler(); | |
m_threadPool = new IoServiceThreadPoolScheduler(m_ioService); | |
m_proxyScheduler = new ProxyScheduler(m_threadPool); | |
base.InitializeTest(); | |
} | |
public override void CleanupTest() | |
{ | |
m_threadPool.Dispose(); | |
base.CleanupTest(); | |
} | |
.... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment