Last active
August 29, 2015 14:01
-
-
Save renestein/ef9e8cb3f0664ede4550 to your computer and use it in GitHub Desktop.
This file contains 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
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
public void QueueTask_When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
var dummyTask = new Task(() => {}); | |
Scheduler.Dispose(); | |
Scheduler.QueueTask(dummyTask); | |
} | |
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
public void TryExecuteTaskInline_When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
var dummyTask = new Task(() => {}); | |
Scheduler.Dispose(); | |
Scheduler.TryExecuteTaskInline(dummyTask, false); | |
} | |
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
public void GetScheduledTasks_When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
Scheduler.Dispose(); | |
Scheduler.GetScheduledTasks(); | |
} | |
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
public void MaximumConcurrencyLevel_When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
Scheduler.Dispose(); | |
var maximumConcurrencyLevel = Scheduler.MaximumConcurrencyLevel; | |
} | |
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
private void SetProxyScheduler__When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
Scheduler.Dispose(); | |
Scheduler.ProxyScheduler = null; | |
} | |
[TestMethod] | |
[ExpectedException(typeof (ObjectDisposedException))] | |
private void GetProxyScheduler__When_TaskScheduler_Disposed_Then_Throws_ObjectDisposedException() | |
{ | |
Scheduler.Dispose(); | |
var proxyScheduler = Scheduler.ProxyScheduler; | |
} | |
[TestMethod] | |
public void Dispose_Repeated_Call_Does_Not_Throw() | |
{ | |
Scheduler.Dispose(); | |
Scheduler.Dispose(); | |
} | |
[TestMethod] | |
public void Dispose_Does_Not_Throw() | |
{ | |
Scheduler.Dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment