OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 import 'dart:async'; | |
6 import 'dart:collection'; | |
7 | |
8 import 'package:unittest/unittest.dart'; | 5 import 'package:unittest/unittest.dart'; |
9 import 'package:unittest/mirror_matchers.dart'; | 6 import 'package:unittest/mirror_matchers.dart'; |
10 | 7 |
11 import 'test_common.dart'; | |
12 import 'test_utils.dart'; | 8 import 'test_utils.dart'; |
13 | 9 |
14 void main() { | 10 void main() { |
15 | 11 |
16 initUtils(); | 12 initUtils(); |
17 | 13 |
18 test('hasProperty', () { | 14 test('hasProperty', () { |
19 var foo = [3]; | 15 var foo = [3]; |
20 shouldPass(foo, hasProperty('length', 1)); | 16 shouldPass(foo, hasProperty('length', 1)); |
21 shouldFail(foo, hasProperty('foo'), 'Expected: has property "foo" ' | 17 shouldFail(foo, hasProperty('foo'), 'Expected: has property "foo" ' |
22 'Actual: [3] ' | 18 'Actual: [3] ' |
23 'Which: has no property named "foo"'); | 19 'Which: has no property named "foo"'); |
24 shouldFail(foo, hasProperty('length', 2), | 20 shouldFail(foo, hasProperty('length', 2), |
25 'Expected: has property "length" which matches <2> ' | 21 'Expected: has property "length" which matches <2> ' |
26 'Actual: [3] ' | 22 'Actual: [3] ' |
27 'Which: has property "length" with value <1>'); | 23 'Which: has property "length" with value <1>'); |
28 }); | 24 }); |
29 } | 25 } |
OLD | NEW |