Replaced all ExpectedExceptionAttributes with the new Assert.Throws<>() method to work around a compatibility issue between TeamCity 4.5 and NUnit 2.5 Final
git-svn-id: file:///srv/devel/repo-conversion/nusu@137 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
06749b9cbb
commit
d0fe47239e
20 changed files with 399 additions and 215 deletions
|
|
@ -468,12 +468,14 @@ namespace Nuclex.Support.Tracking {
|
|||
/// Verifies that the progress tracker throws an exception if it is instructed
|
||||
/// to untrack a transaction it doesn't know about
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(ArgumentException))]
|
||||
[Test]
|
||||
public void TestThrowOnUntrackNonTrackedTransaction() {
|
||||
using(ProgressTracker tracker = new ProgressTracker()) {
|
||||
TestTransaction test1 = new TestTransaction();
|
||||
|
||||
tracker.Untrack(test1);
|
||||
Assert.Throws<ArgumentException>(
|
||||
delegate() { tracker.Untrack(test1); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,14 +71,16 @@ namespace Nuclex.Support.Tracking {
|
|||
/// Verifies that the FailedDummy request is in the ended state and throws
|
||||
/// an exception when Join()ing
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(AbortedException))]
|
||||
[Test]
|
||||
public void TestFailedDummy() {
|
||||
Request failedDummy = Request.CreateFailedDummy(
|
||||
new AbortedException("Hello World")
|
||||
);
|
||||
|
||||
Assert.IsTrue(failedDummy.Ended);
|
||||
failedDummy.Join();
|
||||
Assert.Throws<AbortedException>(
|
||||
delegate() { failedDummy.Join(); }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -114,14 +116,16 @@ namespace Nuclex.Support.Tracking {
|
|||
/// Verifies that the FailedDummy request is in the ended state and throws
|
||||
/// an exception when Join()ing
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(AbortedException))]
|
||||
[Test]
|
||||
public void TestFailedDummy() {
|
||||
Request<int> failedDummy = Request<int>.CreateFailedDummy(
|
||||
new AbortedException("Hello World")
|
||||
);
|
||||
|
||||
Assert.IsTrue(failedDummy.Ended);
|
||||
failedDummy.Join();
|
||||
Assert.Throws<AbortedException>(
|
||||
delegate() { failedDummy.Join(); }
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,11 +111,13 @@ namespace Nuclex.Support.Tracking {
|
|||
/// <summary>
|
||||
/// Verifies that the transaction throws an exception when it is ended multiple times
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(InvalidOperationException))]
|
||||
[Test]
|
||||
public void TestThrowOnRepeatedlyEndedTransaction() {
|
||||
TestTransaction test = new TestTransaction();
|
||||
test.End();
|
||||
test.End();
|
||||
Assert.Throws<InvalidOperationException>(
|
||||
delegate() { test.End(); }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue