Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: client/testing/unittest/unittestsuite.dart

Issue 8392022: Move JSON unit tests to new test API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/tests/client/json/cmd_json_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | client/tests/client/json/cmd_json_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698