| 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/dart/ast/ast.dart'; | 11 import 'package:analyzer/dart/ast/ast.dart'; |
| 12 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:test/test.dart'; |
| 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 15 import 'package:test_reflective_loader/test_reflective_loader.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 import '../../utils.dart'; |
| 19 | 19 |
| 20 main() { | 20 main() { |
| 21 initializeTestEnvironment(); | 21 initializeTestEnvironment(); |
| 22 defineReflectiveTests(RefactoringLocationTest); | 22 defineReflectiveSuite(() { |
| 23 defineReflectiveTests(RefactoringStatusTest); | 23 defineReflectiveTests(RefactoringLocationTest); |
| 24 defineReflectiveTests(RefactoringStatusTest); |
| 25 }); |
| 24 } | 26 } |
| 25 | 27 |
| 26 @reflectiveTest | 28 @reflectiveTest |
| 27 class RefactoringLocationTest extends AbstractSingleUnitTest { | 29 class RefactoringLocationTest extends AbstractSingleUnitTest { |
| 28 void test_createLocation_forElement() { | 30 void test_createLocation_forElement() { |
| 29 resolveTestUnit('class MyClass {}'); | 31 resolveTestUnit('class MyClass {}'); |
| 30 Element element = findElement('MyClass'); | 32 Element element = findElement('MyClass'); |
| 31 // check | 33 // check |
| 32 Location location = newLocation_fromElement(element); | 34 Location location = newLocation_fromElement(element); |
| 33 expect(location.file, '/test.dart'); | 35 expect(location.file, '/test.dart'); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); | 227 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); |
| 226 expect(refactoringStatus.message, 'msg'); | 228 expect(refactoringStatus.message, 'msg'); |
| 227 } | 229 } |
| 228 | 230 |
| 229 void test_newWarning() { | 231 void test_newWarning() { |
| 230 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); | 232 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); |
| 231 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); | 233 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); |
| 232 expect(refactoringStatus.message, 'msg'); | 234 expect(refactoringStatus.message, 'msg'); |
| 233 } | 235 } |
| 234 } | 236 } |
| OLD | NEW |