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
|
@ -73,22 +73,26 @@ namespace Nuclex.Support.Plugins {
|
|||
/// Tests whether the factory employer throws an exception when it is asked to
|
||||
/// employ an abstract class
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(MissingMethodException))]
|
||||
[Test]
|
||||
public void TestThrowOnEmployAbstractClass() {
|
||||
FactoryEmployer<Base> testEmployer = new FactoryEmployer<Base>();
|
||||
|
||||
testEmployer.Employ(typeof(Base));
|
||||
Assert.Throws<MissingMethodException>(
|
||||
delegate() { testEmployer.Employ(typeof(Base)); }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether the factory employer throws an exception when it is asked to
|
||||
/// employ a class that is not the product type or a derivative thereof
|
||||
/// </summary>
|
||||
[Test, ExpectedException(typeof(InvalidCastException))]
|
||||
[Test]
|
||||
public void TestThrowOnEmployUnrelatedClass() {
|
||||
FactoryEmployer<Base> testEmployer = new FactoryEmployer<Base>();
|
||||
|
||||
testEmployer.Employ(typeof(Unrelated));
|
||||
Assert.Throws<InvalidCastException>(
|
||||
delegate() { testEmployer.Employ(typeof(Unrelated)); }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue