@@ -28,7 +28,7 @@ public void GetBranchPoints_OneBranch()
2828 {
2929 // arrange
3030 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
31- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSingleDecision" ) ) ;
31+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSingleDecision ) } ") ) ;
3232
3333 // act
3434 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -50,7 +50,7 @@ public void GetBranchPoints_Using_Where_GeneratedBranchesIgnored()
5050 {
5151 // arrange
5252 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
53- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSimpleUsingStatement" ) ) ;
53+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSimpleUsingStatement ) } ") ) ;
5454
5555 // act
5656 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -63,7 +63,7 @@ public void GetBranchPoints_GeneratedBranches_DueToCachedAnonymousMethodDelegate
6363 {
6464 // arrange
6565 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
66- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSimpleTaskWithLambda" ) ) ;
66+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSimpleTaskWithLambda ) } ") ) ;
6767
6868 // act
6969 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -76,7 +76,7 @@ public void GetBranchPoints_TwoBranch()
7676 {
7777 // arrange
7878 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
79- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasTwoDecisions" ) ) ;
79+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasTwoDecisions ) } ") ) ;
8080
8181 // act
8282 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -95,7 +95,7 @@ public void GetBranchPoints_CompleteIf()
9595 {
9696 // arrange
9797 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
98- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasCompleteIf" ) ) ;
98+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasCompleteIf ) } ") ) ;
9999
100100 // act
101101 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -113,7 +113,7 @@ public void GetBranchPoints_Switch()
113113 {
114114 // arrange
115115 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
116- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSwitch" ) ) ;
116+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSwitch ) } ") ) ;
117117
118118 // act
119119 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -136,7 +136,7 @@ public void GetBranchPoints_SwitchWithDefault()
136136 {
137137 // arrange
138138 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
139- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSwitchWithDefault" ) ) ;
139+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSwitchWithDefault ) } ") ) ;
140140
141141 // act
142142 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -159,7 +159,7 @@ public void GetBranchPoints_SwitchWithBreaks()
159159 {
160160 // arrange
161161 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
162- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSwitchWithBreaks" ) ) ;
162+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSwitchWithBreaks ) } ") ) ;
163163
164164 // act
165165 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -182,7 +182,7 @@ public void GetBranchPoints_SwitchWithMultipleCases()
182182 {
183183 // arrange
184184 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
185- var method = type . Methods . First ( x => x . FullName . Contains ( "::HasSwitchWithMultipleCases" ) ) ;
185+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . HasSwitchWithMultipleCases ) } ") ) ;
186186
187187 // act
188188 var points = CecilSymbolHelper . GetBranchPoints ( method ) ;
@@ -226,7 +226,7 @@ public void GetBranchPoints_UsingWithException_Issue243_IgnoresBranchInFinallyBl
226226 {
227227 // arrange
228228 var type = _module . Types . First ( x => x . FullName == typeof ( DeclaredConstructorClass ) . FullName ) ;
229- var method = type . Methods . First ( x => x . FullName . Contains ( "::UsingWithException_Issue243" ) ) ;
229+ var method = type . Methods . First ( x => x . FullName . Contains ( $ "::{ nameof ( DeclaredConstructorClass . UsingWithException_Issue243 ) } ") ) ;
230230
231231 // check that the method is laid out the way we discovered it to be during the defect
232232 // @see https://github.com/OpenCover/opencover/issues/243
0 commit comments