| Index: pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
|
| diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
|
| index ef91205f45c594f4d46750108105f9e4446e40f7..43a0a351b947f763636e4034b07c2598a3f4a198 100644
|
| --- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
|
| +++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
|
| @@ -19,6 +19,60 @@ main() {
|
|
|
| @reflectiveTest
|
| class RenameClassMemberTest extends RenameRefactoringTest {
|
| + test_checkFinalConditions_classNameConflict_sameClass() async {
|
| + indexTestUnit('''
|
| +class NewName {
|
| + void test() {}
|
| +}
|
| +''');
|
| + createRenameRefactoringAtString('test() {}');
|
| + // check status
|
| + refactoring.newName = 'NewName';
|
| + RefactoringStatus status = await refactoring.checkFinalConditions();
|
| + assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
| + expectedMessage:
|
| + "Renamed method has the same name as the declaring class 'NewName'.",
|
| + expectedContextSearch: 'test() {}');
|
| + }
|
| +
|
| + test_checkFinalConditions_classNameConflict_subClass() async {
|
| + indexTestUnit('''
|
| +class A {
|
| + void test() {} // 1
|
| +}
|
| +class NewName extends A {
|
| + void test() {} // 2
|
| +}
|
| +''');
|
| + createRenameRefactoringAtString('test() {} // 1');
|
| + // check status
|
| + refactoring.newName = 'NewName';
|
| + RefactoringStatus status = await refactoring.checkFinalConditions();
|
| + assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
| + expectedMessage:
|
| + "Renamed method has the same name as the declaring class 'NewName'.",
|
| + expectedContextSearch: 'test() {} // 2');
|
| + }
|
| +
|
| + test_checkFinalConditions_classNameConflict_superClass() async {
|
| + indexTestUnit('''
|
| +class NewName {
|
| + void test() {} // 1
|
| +}
|
| +class B extends NewName {
|
| + void test() {} // 2
|
| +}
|
| +''');
|
| + createRenameRefactoringAtString('test() {} // 2');
|
| + // check status
|
| + refactoring.newName = 'NewName';
|
| + RefactoringStatus status = await refactoring.checkFinalConditions();
|
| + assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
| + expectedMessage:
|
| + "Renamed method has the same name as the declaring class 'NewName'.",
|
| + expectedContextSearch: 'test() {} // 1');
|
| + }
|
| +
|
| test_checkFinalConditions_hasMember_MethodElement() async {
|
| indexTestUnit('''
|
| class A {
|
|
|