OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library mocks; | 5 library mocks; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 @MirrorsUsed(targets: 'mocks', override: '*') | 9 @MirrorsUsed(targets: 'mocks', override: '*') |
10 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 final ElementKind kind = ElementKind.FUNCTION; | 112 final ElementKind kind = ElementKind.FUNCTION; |
113 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 113 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
114 } | 114 } |
115 | 115 |
116 class MockFunctionTypeAliasElement extends TypedMock | 116 class MockFunctionTypeAliasElement extends TypedMock |
117 implements FunctionTypeAliasElement { | 117 implements FunctionTypeAliasElement { |
118 final ElementKind kind = ElementKind.FUNCTION_TYPE_ALIAS; | 118 final ElementKind kind = ElementKind.FUNCTION_TYPE_ALIAS; |
119 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 119 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
120 } | 120 } |
121 | 121 |
122 class MockHtmlElement extends TypedMock implements HtmlElement { | |
123 final ElementKind kind = ElementKind.HTML; | |
124 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | |
125 } | |
126 | |
127 class MockImportElement extends TypedMock implements ImportElement { | 122 class MockImportElement extends TypedMock implements ImportElement { |
128 final ElementKind kind = ElementKind.IMPORT; | 123 final ElementKind kind = ElementKind.IMPORT; |
129 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 124 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
130 } | 125 } |
131 | 126 |
132 class MockLibraryElement extends TypedMock implements LibraryElement { | 127 class MockLibraryElement extends TypedMock implements LibraryElement { |
133 final ElementKind kind = ElementKind.LIBRARY; | 128 final ElementKind kind = ElementKind.LIBRARY; |
134 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 129 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
135 } | 130 } |
136 | 131 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 457 } |
463 return mismatchDescription; | 458 return mismatchDescription; |
464 } | 459 } |
465 | 460 |
466 @override | 461 @override |
467 bool matches(item, Map matchState) { | 462 bool matches(item, Map matchState) { |
468 Response response = item; | 463 Response response = item; |
469 return response != null && response.id == _id && response.error == null; | 464 return response != null && response.id == _id && response.error == null; |
470 } | 465 } |
471 } | 466 } |
OLD | NEW |