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 test.services.correction.status; | 5 library test.services.correction.status; |
6 | 6 |
7 import 'package:analysis_server/src/protocol_server.dart' hide Element; | 7 import 'package:analysis_server/src/protocol_server.dart' hide Element; |
8 import 'package:analysis_server/src/services/correction/source_range.dart'; | 8 import 'package:analysis_server/src/services/correction/source_range.dart'; |
9 import 'package:analysis_server/src/services/correction/status.dart'; | 9 import 'package:analysis_server/src/services/correction/status.dart'; |
10 import 'package:analysis_server/src/services/search/search_engine.dart'; | 10 import 'package:analysis_server/src/services/search/search_engine.dart'; |
11 import 'package:analyzer/src/generated/ast.dart'; | 11 import 'package:analyzer/src/generated/ast.dart'; |
12 import 'package:analyzer/src/generated/element.dart'; | 12 import 'package:analyzer/src/generated/element.dart'; |
13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
15 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
16 | 16 |
17 import '../../abstract_single_unit.dart'; | 17 import '../../abstract_single_unit.dart'; |
| 18 import '../../utils.dart'; |
18 | 19 |
19 main() { | 20 main() { |
20 groupSep = ' | '; | 21 initializeTestEnvironment(); |
21 defineReflectiveTests(RefactoringLocationTest); | 22 defineReflectiveTests(RefactoringLocationTest); |
22 defineReflectiveTests(RefactoringStatusTest); | 23 defineReflectiveTests(RefactoringStatusTest); |
23 } | 24 } |
24 | 25 |
25 @reflectiveTest | 26 @reflectiveTest |
26 class RefactoringLocationTest extends AbstractSingleUnitTest { | 27 class RefactoringLocationTest extends AbstractSingleUnitTest { |
27 void test_createLocation_forElement() { | 28 void test_createLocation_forElement() { |
28 resolveTestUnit('class MyClass {}'); | 29 resolveTestUnit('class MyClass {}'); |
29 Element element = findElement('MyClass'); | 30 Element element = findElement('MyClass'); |
30 // check | 31 // check |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); | 218 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); |
218 expect(refactoringStatus.message, 'msg'); | 219 expect(refactoringStatus.message, 'msg'); |
219 } | 220 } |
220 | 221 |
221 void test_newWarning() { | 222 void test_newWarning() { |
222 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); | 223 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); |
223 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); | 224 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); |
224 expect(refactoringStatus.message, 'msg'); | 225 expect(refactoringStatus.message, 'msg'); |
225 } | 226 } |
226 } | 227 } |
OLD | NEW |