@@ -683,6 +683,84 @@ End Sub"
683
683
PerformExpectedVersusActualRenameTests ( tdo , inputOutput ) ;
684
684
}
685
685
686
+ [ Test ]
687
+ [ Category ( "Refactorings" ) ]
688
+ [ Category ( "Rename" ) ]
689
+ public void RenameRefactoring_RenameFunction_DoesNotChangeIndexedDefaultMemberCalls ( )
690
+ {
691
+ var tdo = new RenameTestsDataObject ( selectedIdentifier : "Foo" , newName : "Goo" ) ;
692
+ var defaultMemberInputOutput = new RenameTestModuleDefinition ( "ClassFoo" )
693
+ {
694
+ Input =
695
+ @"Public Function Fo|o(arg As String) As Boolean
696
+ Attribute Foo.VB_UserMemId = 0
697
+ Foo = True
698
+ End Function" ,
699
+ //TODO: Make it possible that the attribute survives this appropriately adjusted.
700
+ //The VBE will remove the now invalid attribute, which does not happen in tests.
701
+ Expected =
702
+ @"Public Function Goo(arg As String) As Boolean
703
+ Attribute Foo.VB_UserMemId = 0
704
+ Goo = True
705
+ End Function"
706
+ } ;
707
+ var callingModuleInputOutput = new RenameTestModuleDefinition ( "TestModule" , ComponentType . StandardModule )
708
+ {
709
+ Input =
710
+ @"Private Function Baz(arg As String) As Boolean
711
+ Dim bar As ClassFoo
712
+ Set bar = New ClassFoo
713
+ Baz = bar(arg)
714
+ End Function" ,
715
+ Expected =
716
+ @"Private Function Baz(arg As String) As Boolean
717
+ Dim bar As ClassFoo
718
+ Set bar = New ClassFoo
719
+ Baz = bar(arg)
720
+ End Function"
721
+ } ;
722
+ PerformExpectedVersusActualRenameTests ( tdo , defaultMemberInputOutput , callingModuleInputOutput ) ;
723
+ }
724
+
725
+ [ Test ]
726
+ [ Category ( "Refactorings" ) ]
727
+ [ Category ( "Rename" ) ]
728
+ public void RenameRefactoring_RenameFunction_DoesNotChangeNonIndexedDefaultMemberCalls ( )
729
+ {
730
+ var tdo = new RenameTestsDataObject ( selectedIdentifier : "Foo" , newName : "Goo" ) ;
731
+ var defaultMemberInputOutput = new RenameTestModuleDefinition ( "ClassFoo" )
732
+ {
733
+ Input =
734
+ @"Public Function Fo|o() As Boolean
735
+ Attribute Foo.VB_UserMemId = 0
736
+ Foo = True
737
+ End Function" ,
738
+ //TODO: Make it possible that the attribute survives this appropriately adjusted.
739
+ //The VBE will remove the now invalid attribute, which does not happen in tests.
740
+ Expected =
741
+ @"Public Function Goo() As Boolean
742
+ Attribute Foo.VB_UserMemId = 0
743
+ Goo = True
744
+ End Function"
745
+ } ;
746
+ var callingModuleInputOutput = new RenameTestModuleDefinition ( "TestModule" , ComponentType . StandardModule )
747
+ {
748
+ Input =
749
+ @"Private Function Baz(arg As String) As Boolean
750
+ Dim bar As ClassFoo
751
+ Set bar = New ClassFoo
752
+ Baz = bar
753
+ End Function" ,
754
+ Expected =
755
+ @"Private Function Baz(arg As String) As Boolean
756
+ Dim bar As ClassFoo
757
+ Set bar = New ClassFoo
758
+ Baz = bar
759
+ End Function"
760
+ } ;
761
+ PerformExpectedVersusActualRenameTests ( tdo , defaultMemberInputOutput , callingModuleInputOutput ) ;
762
+ }
763
+
686
764
[ Test ]
687
765
[ Category ( "Refactorings" ) ]
688
766
[ Category ( "Rename" ) ]
0 commit comments