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); |
+ }); |
} |