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

Unified Diff: pkg/unittest/test/mock_test.dart

Issue 12207123: Improve matcher descriptions that match against objects, and thus fix a bug (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « pkg/unittest/lib/src/description.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/mock_test.dart
===================================================================
--- pkg/unittest/test/mock_test.dart (revision 18358)
+++ pkg/unittest/test/mock_test.dart (working copy)
@@ -649,4 +649,16 @@
m3.clearLogs();
expect(log.logs, hasLength(0));
});
+
+ test("Mocking: instances", () {
+ var alice = new Object();
+ var bob = new Object();
+ var m = new Mock();
+ m.when(callsTo("foo", alice)).alwaysReturn(true);
+ m.when(callsTo("foo", bob)).alwaysReturn(false);
+ expect(m.foo(alice), true);
+ expect(m.foo(bob), false);
+ expect(m.foo(alice), true);
+ expect(m.foo(bob), false);
+ });
}
« no previous file with comments | « pkg/unittest/lib/src/description.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698