| 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.refactoring.rename_unit_member; | 5 library test.services.refactoring.rename_unit_member; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import '../../reflective_tests.dart'; | 10 import '../../reflective_tests.dart'; |
| 11 import 'abstract_rename.dart'; | 11 import 'abstract_rename.dart'; |
| 12 | 12 |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 groupSep = ' | '; | 15 groupSep = ' | '; |
| 16 runReflectiveTests(RenameUnitMemberTest); | 16 runReflectiveTests(RenameUnitMemberTest); |
| 17 } | 17 } |
| 18 | 18 |
| 19 | 19 |
| 20 @ReflectiveTestCase() | 20 @reflectiveTest |
| 21 class RenameUnitMemberTest extends RenameRefactoringTest { | 21 class RenameUnitMemberTest extends RenameRefactoringTest { |
| 22 test_checkFinalConditions_hasTopLevel_ClassElement() { | 22 test_checkFinalConditions_hasTopLevel_ClassElement() { |
| 23 indexTestUnit(''' | 23 indexTestUnit(''' |
| 24 class Test {} | 24 class Test {} |
| 25 class NewName {} // existing | 25 class NewName {} // existing |
| 26 '''); | 26 '''); |
| 27 createRenameRefactoringAtString('Test {}'); | 27 createRenameRefactoringAtString('Test {}'); |
| 28 // check status | 28 // check status |
| 29 refactoring.newName = 'NewName'; | 29 refactoring.newName = 'NewName'; |
| 30 return refactoring.checkFinalConditions().then((status) { | 30 return refactoring.checkFinalConditions().then((status) { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 return assertSuccessfulRefactoring(''' | 494 return assertSuccessfulRefactoring(''' |
| 495 int newName = 0; | 495 int newName = 0; |
| 496 main() { | 496 main() { |
| 497 print(newName); | 497 print(newName); |
| 498 newName = 1; | 498 newName = 1; |
| 499 newName += 2; | 499 newName += 2; |
| 500 } | 500 } |
| 501 '''); | 501 '''); |
| 502 } | 502 } |
| 503 } | 503 } |
| OLD | NEW |