@@ -217,7 +217,21 @@ public void PreArgProc_Region_Invalid()
217217 @"The arguments 'sonar.host.url' and 'sonar.scanner.sonarcloudUrl' are both set. Please set only 'sonar.scanner.sonarcloudUrl'." ) ]
218218 [ DataRow ( null , "https://host" , null , "https://api" , typeof ( ServerHostInfo ) , "https://host" , "https://api" ) ]
219219 [ DataRow ( null , "https://host" , null , null , typeof ( ServerHostInfo ) , "https://host" , "https://host/api/v2" ) ]
220- public void PreArgProc_Region_Overrides ( string region , string hostOverride , string sonarClourUrlOverride , string apiOverride , Type expectedHostInforType , string expectedHostUri , string expectedApiUri , params string [ ] expectedWarnings )
220+ [ DataRow ( null , "https://SONARQUBE.us/" , null , null , typeof ( CloudHostInfo ) , "https://SONARQUBE.us/" , "https://api.sonarqube.us" ) ]
221+ [ DataRow ( null , null , "https://SONARQUBE.us/" , null , typeof ( CloudHostInfo ) , "https://SONARQUBE.us/" , "https://api.sonarqube.us" ) ]
222+ [ DataRow ( null , "https://sonarqube.us" , null , "https://api" , typeof ( CloudHostInfo ) , "https://sonarqube.us" , "https://api" ) ]
223+ [ DataRow ( null , null , "https://sonarqube.us" , "https://api" , typeof ( CloudHostInfo ) , "https://sonarqube.us" , "https://api" ) ]
224+ [ DataRow ( "US" , "https://SONARQUBE.us/" , null , null , typeof ( CloudHostInfo ) , "https://SONARQUBE.us/" , "https://api.sonarqube.us" ,
225+ @"The sonar.region parameter is set to ""US"". The setting will be overriden by one or more of the properties sonar.host.url, sonar.scanner.sonarcloudUrl, or sonar.scanner.apiBaseUrl." ) ]
226+ [ DataRow ( null , "https://SONARCLOUD.io/" , null , null , typeof ( CloudHostInfo ) , "https://SONARCLOUD.io/" , "https://api.sonarcloud.io" ) ]
227+ [ DataRow ( null , null , "https://SONARCLOUD.io/" , null , typeof ( CloudHostInfo ) , "https://SONARCLOUD.io/" , "https://api.sonarcloud.io" ) ]
228+ [ DataRow ( null , "https://sonarcloud.io" , null , "https://api" , typeof ( CloudHostInfo ) , "https://sonarcloud.io" , "https://api" ) ]
229+ [ DataRow ( null , null , "https://sonarcloud.io" , "https://api" , typeof ( CloudHostInfo ) , "https://sonarcloud.io" , "https://api" ) ]
230+ [ DataRow ( "us" , "https://sonarcloud.io" , null , null , typeof ( CloudHostInfo ) , "https://sonarcloud.io" , "https://api.sonarcloud.io" ,
231+ @"The sonar.region parameter is set to ""us"". The setting will be overriden by one or more of the properties sonar.host.url, sonar.scanner.sonarcloudUrl, or sonar.scanner.apiBaseUrl." ) ]
232+ [ DataRow ( "us" , null , "https://sonarcloud.io" , null , typeof ( CloudHostInfo ) , "https://sonarcloud.io" , "https://api.sonarcloud.io" ,
233+ @"The sonar.region parameter is set to ""us"". The setting will be overriden by one or more of the properties sonar.host.url, sonar.scanner.sonarcloudUrl, or sonar.scanner.apiBaseUrl." ) ]
234+ public void PreArgProc_Region_Overrides ( string region , string hostOverride , string sonarClourUrlOverride , string apiOverride , Type expectedHostInfoType , string expectedHostUri , string expectedApiUri , params string [ ] expectedWarnings )
221235 {
222236 var logger = new TestLogger ( ) ;
223237 var args = CheckProcessingSucceeds (
@@ -232,8 +246,8 @@ public void PreArgProc_Region_Overrides(string region, string hostOverride, stri
232246 .. apiOverride is null ? Array . Empty < string > ( ) : [ $ "/d:{ SonarProperties . ApiBaseUrl } ={ apiOverride } "] ,
233247 ] ) ;
234248
235- args . ServerInfo . Should ( ) . BeOfType ( expectedHostInforType ) ;
236- args . ServerInfo . Should ( ) . BeEquivalentTo ( new { ServerUrl = expectedHostUri , ApiBaseUrl = expectedApiUri , IsSonarCloud = expectedHostInforType == typeof ( CloudHostInfo ) } ) ;
249+ args . ServerInfo . Should ( ) . BeOfType ( expectedHostInfoType ) ;
250+ args . ServerInfo . Should ( ) . BeEquivalentTo ( new { ServerUrl = expectedHostUri , ApiBaseUrl = expectedApiUri , IsSonarCloud = expectedHostInfoType == typeof ( CloudHostInfo ) } ) ;
237251 logger . AssertDebugLogged ( $ "Server Url: { expectedHostUri } ") ;
238252 logger . AssertDebugLogged ( $ "Api Url: { expectedApiUri } ") ;
239253 logger . AssertDebugLogged ( $ "Is SonarCloud: { args . ServerInfo . IsSonarCloud } ") ;
0 commit comments