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

Side by Side Diff: pkg/unittest/test/mirror_matchers_test.dart

Issue 21085010: Added hasProperty matcher. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « pkg/unittest/test/matchers_test.dart ('k') | 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6 import 'dart:collection';
7
8 import 'package:unittest/unittest.dart';
9 import 'package:unittest/mirror_matchers.dart';
10
11 import 'test_common.dart';
12 import 'test_utils.dart';
13
14 void main() {
15
16 initUtils();
17
18 test('hasProperty', () {
19 var foo = [3];
20 shouldPass(foo, hasProperty('length', 1));
21 shouldFail(foo, hasProperty('foo'), 'Expected: has property "foo" '
22 'Actual: [3] '
23 'Which: has no property named "foo"');
24 shouldFail(foo, hasProperty('length', 2),
25 'Expected: has property "length" which matches <2> '
26 'Actual: [3] '
27 'Which: has property "length" with value <1>');
28 });
29 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/matchers_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698