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

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

Issue 10913135: Fix issue 4191. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | 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 * The error formatter for mocking is a bit different from the default one 6 * The error formatter for mocking is a bit different from the default one
7 * for unit testing; instead of the third argument being a 'reason' 7 * for unit testing; instead of the third argument being a 'reason'
8 * it is instead a [signature] describing the method signature filter 8 * it is instead a [signature] describing the method signature filter
9 * that was used to select the logs that were verified. 9 * that was used to select the logs that were verified.
10 */ 10 */
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 arg6 = _noArg, 103 arg6 = _noArg,
104 arg7 = _noArg, 104 arg7 = _noArg,
105 arg8 = _noArg, 105 arg8 = _noArg,
106 arg9 = _noArg]) { 106 arg9 = _noArg]) {
107 if (name == null) { 107 if (name == null) {
108 nameFilter = anything; 108 nameFilter = anything;
109 } else { 109 } else {
110 nameFilter = wrapMatcher(name); 110 nameFilter = wrapMatcher(name);
111 } 111 }
112 argMatchers = new List<Matcher>(); 112 argMatchers = new List<Matcher>();
113 if (arg0 == _noArg) return; 113 if (arg0 === _noArg) return;
114 argMatchers.add(wrapMatcher(arg0)); 114 argMatchers.add(wrapMatcher(arg0));
115 if (arg1 == _noArg) return; 115 if (arg1 === _noArg) return;
116 argMatchers.add(wrapMatcher(arg1)); 116 argMatchers.add(wrapMatcher(arg1));
117 if (arg2 == _noArg) return; 117 if (arg2 === _noArg) return;
118 argMatchers.add(wrapMatcher(arg2)); 118 argMatchers.add(wrapMatcher(arg2));
119 if (arg3 == _noArg) return; 119 if (arg3 === _noArg) return;
120 argMatchers.add(wrapMatcher(arg3)); 120 argMatchers.add(wrapMatcher(arg3));
121 if (arg4 == _noArg) return; 121 if (arg4 === _noArg) return;
122 argMatchers.add(wrapMatcher(arg4)); 122 argMatchers.add(wrapMatcher(arg4));
123 if (arg5 == _noArg) return; 123 if (arg5 === _noArg) return;
124 argMatchers.add(wrapMatcher(arg5)); 124 argMatchers.add(wrapMatcher(arg5));
125 if (arg6 == _noArg) return; 125 if (arg6 === _noArg) return;
126 argMatchers.add(wrapMatcher(arg6)); 126 argMatchers.add(wrapMatcher(arg6));
127 if (arg7 == _noArg) return; 127 if (arg7 === _noArg) return;
128 argMatchers.add(wrapMatcher(arg7)); 128 argMatchers.add(wrapMatcher(arg7));
129 if (arg8 == _noArg) return; 129 if (arg8 === _noArg) return;
130 argMatchers.add(wrapMatcher(arg8)); 130 argMatchers.add(wrapMatcher(arg8));
131 if (arg9 == _noArg) return; 131 if (arg9 === _noArg) return;
132 argMatchers.add(wrapMatcher(arg9)); 132 argMatchers.add(wrapMatcher(arg9));
133 } 133 }
134 134
135 /** 135 /**
136 * We keep our behavior specifications in a Map, which is keyed 136 * We keep our behavior specifications in a Map, which is keyed
137 * by the [CallMatcher]. To make the keys unique and to get a 137 * by the [CallMatcher]. To make the keys unique and to get a
138 * descriptive value for the [CallMatcher] we have this override 138 * descriptive value for the [CallMatcher] we have this override
139 * of [toString()]. 139 * of [toString()].
140 */ 140 */
141 String toString() { 141 String toString() {
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 } 1450 }
1451 } 1451 }
1452 } 1452 }
1453 1453
1454 /** Clear both logs and behavior. */ 1454 /** Clear both logs and behavior. */
1455 void reset() { 1455 void reset() {
1456 resetBehavior(); 1456 resetBehavior();
1457 clearLogs(); 1457 clearLogs();
1458 } 1458 }
1459 } 1459 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698