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

Side by Side Diff: pkg/unittest/lib/mock.dart

Issue 134963002: pkg/unittest: add @proxy to Mock (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/pkg.status ('k') | pkg/unittest/test/mock_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * A simple mocking/spy library. 6 * A simple mocking/spy library.
7 * 7 *
8 * ## Installing ## 8 * ## Installing ##
9 * 9 *
10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` 10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 *[neverThrew] asserts that no matching call to a method threw 1237 *[neverThrew] asserts that no matching call to a method threw
1238 * a value that matched [value]. 1238 * a value that matched [value].
1239 */ 1239 */
1240 Matcher neverThrew(value) => 1240 Matcher neverThrew(value) =>
1241 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.NONE); 1241 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.NONE);
1242 1242
1243 /** The shared log used for named mocks. */ 1243 /** The shared log used for named mocks. */
1244 LogEntryList sharedLog = null; 1244 LogEntryList sharedLog = null;
1245 1245
1246 /** The base class for all mocked objects. */ 1246 /** The base class for all mocked objects. */
1247 @proxy
1247 class Mock { 1248 class Mock {
1248 /** The mock name. Needed if the log is shared; optional otherwise. */ 1249 /** The mock name. Needed if the log is shared; optional otherwise. */
1249 final String name; 1250 final String name;
1250 1251
1251 /** The set of [Behavior]s supported. */ 1252 /** The set of [Behavior]s supported. */
1252 LinkedHashMap<String,Behavior> _behaviors; 1253 LinkedHashMap<String,Behavior> _behaviors;
1253 1254
1254 /** The [log] of calls made. Only used if [name] is null. */ 1255 /** The [log] of calls made. Only used if [name] is null. */
1255 LogEntryList log; 1256 LogEntryList log;
1256 1257
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 } 1539 }
1539 } 1540 }
1540 } 1541 }
1541 1542
1542 /** Clear both logs and behavior. */ 1543 /** Clear both logs and behavior. */
1543 void reset() { 1544 void reset() {
1544 resetBehavior(); 1545 resetBehavior();
1545 clearLogs(); 1546 clearLogs();
1546 } 1547 }
1547 } 1548 }
OLDNEW
« no previous file with comments | « pkg/pkg.status ('k') | pkg/unittest/test/mock_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698