| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library mock.result_set_matcher; | 5 library mock.result_set_matcher; |
| 6 | 6 |
| 7 import 'package:matcher/matcher.dart'; | 7 import 'package:matcher/matcher.dart'; |
| 8 | 8 |
| 9 import 'action.dart'; | 9 import 'action.dart'; |
| 10 import 'log_entry.dart'; | 10 import 'log_entry.dart'; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 Map matchState, bool verbose) { | 85 Map matchState, bool verbose) { |
| 86 if (frequency != _Frequency.SOME) { | 86 if (frequency != _Frequency.SOME) { |
| 87 LogEntry entry = matchState['entry']; | 87 LogEntry entry = matchState['entry']; |
| 88 if (entry.action == Action.RETURN || entry.action == Action.PROXY) { | 88 if (entry.action == Action.RETURN || entry.action == Action.PROXY) { |
| 89 mismatchDescription.add('returned'); | 89 mismatchDescription.add('returned'); |
| 90 } else { | 90 } else { |
| 91 mismatchDescription.add('threw'); | 91 mismatchDescription.add('threw'); |
| 92 } | 92 } |
| 93 mismatchDescription.add(' value that '); | 93 mismatchDescription.add(' value that '); |
| 94 value.describeMismatch(entry.value, mismatchDescription, | 94 value.describeMismatch(entry.value, mismatchDescription, |
| 95 matchState['state'], verbose); | 95 matchState['state'], verbose); |
| 96 mismatchDescription.add(' at least once'); | 96 mismatchDescription.add(' at least once'); |
| 97 } else { | 97 } else { |
| 98 mismatchDescription.add('never did'); | 98 mismatchDescription.add('never did'); |
| 99 } | 99 } |
| 100 return mismatchDescription; | 100 return mismatchDescription; |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 *[alwaysReturned] asserts that all matching calls to a method returned | 105 *[alwaysReturned] asserts that all matching calls to a method returned |
| (...skipping 29 matching lines...) Expand all Loading... |
| 135 */ | 135 */ |
| 136 Matcher sometimeThrew(value) => | 136 Matcher sometimeThrew(value) => |
| 137 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.SOME); | 137 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.SOME); |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 *[neverThrew] asserts that no matching call to a method threw | 140 *[neverThrew] asserts that no matching call to a method threw |
| 141 * a value that matched [value]. | 141 * a value that matched [value]. |
| 142 */ | 142 */ |
| 143 Matcher neverThrew(value) => | 143 Matcher neverThrew(value) => |
| 144 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.NONE); | 144 new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.NONE); |
| OLD | NEW |