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

Side by Side Diff: tests/isolate/mint_maker_test.dart

Issue 10441104: New expectation functions plus convert old tests to use these. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Things that should be "auto-generated" are between AUTO START and 5 // Things that should be "auto-generated" are between AUTO START and
6 // AUTO END (or just AUTO if it's a single line). 6 // AUTO END (or just AUTO if it's a single line).
7 7
8 #library("MintMakerTest"); 8 #library("MintMakerTest");
9 #import("dart:isolate"); 9 #import("dart:isolate");
10 #import('../../lib/unittest/unittest.dart'); 10 #import('../../lib/unittest/unittest.dart');
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 handleMint(new MintWrapper(mint)); 184 handleMint(new MintWrapper(mint));
185 }); 185 });
186 }); 186 });
187 } 187 }
188 188
189 Future<SendPort> port_; 189 Future<SendPort> port_;
190 } 190 }
191 191
192 _checkBalance(PurseWrapper wrapper, expected) { 192 _checkBalance(PurseWrapper wrapper, expected) {
193 wrapper.queryBalance(expectAsync1((int balance) { 193 wrapper.queryBalance(expectAsync1((int balance) {
194 expect(balance).equals(expected); 194 expect(balance, equals(expected));
195 })); 195 }));
196 } 196 }
197 197
198 main() { 198 main() {
199 test("creating purse, deposit, and query balance", () { 199 test("creating purse, deposit, and query balance", () {
200 MintMakerWrapper mintMaker = new MintMakerWrapper(); 200 MintMakerWrapper mintMaker = new MintMakerWrapper();
201 mintMaker.makeMint(expectAsync1((MintWrapper mint) { 201 mintMaker.makeMint(expectAsync1((MintWrapper mint) {
202 mint.createPurse(100, expectAsync1((PurseWrapper purse) { 202 mint.createPurse(100, expectAsync1((PurseWrapper purse) {
203 _checkBalance(purse, 100); 203 _checkBalance(purse, 100);
204 purse.sproutPurse(expectAsync1((PurseWrapper sprouted) { 204 purse.sproutPurse(expectAsync1((PurseWrapper sprouted) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 sprouted...deposit(purse, 5); 257 sprouted...deposit(purse, 5);
258 Expect.equals(0 + 5, sprouted.queryBalance()); 258 Expect.equals(0 + 5, sprouted.queryBalance());
259 Expect.equals(100 - 5, purse.queryBalance()); 259 Expect.equals(100 - 5, purse.queryBalance());
260 260
261 sprouted...deposit(purse, 42); 261 sprouted...deposit(purse, 42);
262 Expect.equals(0 + 5 + 42, sprouted.queryBalance()); 262 Expect.equals(0 + 5 + 42, sprouted.queryBalance());
263 Expect.equals(100 - 5 - 42, purse.queryBalance()); 263 Expect.equals(100 - 5 - 42, purse.queryBalance());
264 } 264 }
265 */ 265 */
266 } 266 }
OLDNEW
« no previous file with comments | « tests/isolate/mandel_isolate_test.dart ('k') | tests/isolate/v2_compute_this_script_browser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698