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

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

Issue 807193003: Re-apply "Remove unittest and matcher from the repo." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years 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
(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 library matcher.mirror_test;
6
7 import 'package:matcher/mirror_matchers.dart';
8 import 'package:unittest/unittest.dart' show test;
9
10 import 'test_utils.dart';
11
12 class C {
13 var instanceField = 1;
14 get instanceGetter => 2;
15 static var staticField = 3;
16 static get staticGetter => 4;
17 }
18
19 void main() {
20
21 initUtils();
22
23 test('hasProperty', () {
24 var foo = [3];
25 shouldPass(foo, hasProperty('length', 1));
26 shouldFail(foo, hasProperty('foo'), 'Expected: has property "foo" '
27 'Actual: [3] '
28 'Which: has no property named "foo"');
29 shouldFail(foo, hasProperty('length', 2),
30 'Expected: has property "length" which matches <2> '
31 'Actual: [3] '
32 'Which: has property "length" with value <1>');
33 var c = new C();
34 shouldPass(c, hasProperty('instanceField', 1));
35 shouldPass(c, hasProperty('instanceGetter', 2));
36 shouldFail(c, hasProperty('staticField'),
37 'Expected: has property "staticField" '
38 'Actual: <Instance of \'C\'> '
39 'Which: has a member named "staticField",'
40 ' but it is not an instance property');
41 shouldFail(c, hasProperty('staticGetter'),
42 'Expected: has property "staticGetter" '
43 'Actual: <Instance of \'C\'> '
44 'Which: has a member named "staticGetter",'
45 ' but it is not an instance property');
46 });
47 }
OLDNEW
« no previous file with comments | « pkg/matcher/test/matchers_unminified_test.dart ('k') | pkg/matcher/test/numeric_matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698