| Index: client/testing/unittest/unittestsuite.dart
|
| diff --git a/client/testing/unittest/unittestsuite.dart b/client/testing/unittest/unittestsuite.dart
|
| index dbd578f4c10ce32b3a7524fc5fac3ee3986d04de..90d60ba75fdee4d6f82b0163ff271f5eed5e3224 100644
|
| --- a/client/testing/unittest/unittestsuite.dart
|
| +++ b/client/testing/unittest/unittestsuite.dart
|
| @@ -260,6 +260,17 @@ class UnitTestSuite {
|
| /** Creates an expectation for the given value. */
|
| Expectation expect(value) => new Expectation(value);
|
|
|
| +/** Evaluates the given function and validates that it throws an exception. */
|
| +void expectThrow(function) {
|
| + bool threw = false;
|
| + try {
|
| + function();
|
| + } catch (var e) {
|
| + threw = true;
|
| + }
|
| + Expect.equals(true, threw, 'Expected exception but none was thrown.');
|
| +}
|
| +
|
| /**
|
| * Creates a new test case with the given description and body. The
|
| * description will include the descriptions of any surrounding group()
|
|
|