@@ -270,6 +270,29 @@ public void VertexConstructor_LocationGlobal_SetsCorrectBaseUrl() {
270270 Assert . AreEqual ( "https://aiplatform.googleapis.com" , client . HttpOptions . BaseUrl ) ;
271271 }
272272
273+ [ TestMethod ]
274+ public void VertexConstructor_LocationUs_SetsCorrectBaseUrl ( ) {
275+ var mockCredential = new Mock < ICredential > ( ) ;
276+ var client = new HttpApiClient ( vertexAI : true , project : "my-project" , location : "us" , credentials : mockCredential . Object ) ;
277+
278+ Assert . AreEqual ( "my-project" , client . Project ) ;
279+ Assert . AreEqual ( "us" , client . Location ) ;
280+ Assert . IsTrue ( client . VertexAI ) ;
281+ Assert . AreEqual ( "https://aiplatform.us.rep.googleapis.com" , client . HttpOptions . BaseUrl ) ;
282+ }
283+
284+ [ TestMethod ]
285+ public void VertexConstructor_LocationUsAndCustomHttpOptions_SetsCorrectBaseUrl ( ) {
286+ var mockCredential = new Mock < ICredential > ( ) ;
287+ var customOptions = new Types . HttpOptions { BaseUrl = "https://my-custom-url.com/" } ;
288+ var client = new HttpApiClient ( vertexAI : true , project : "my-project" , location : "us" , credentials : mockCredential . Object , httpOptions : customOptions ) ;
289+
290+ Assert . AreEqual ( "my-project" , client . Project ) ;
291+ Assert . AreEqual ( "us" , client . Location ) ;
292+ Assert . IsTrue ( client . VertexAI ) ;
293+ Assert . AreEqual ( "https://my-custom-url.com/" , client . HttpOptions . BaseUrl ) ;
294+ }
295+
273296 [ TestMethod ]
274297 public void Constructor_HttpOptions_BaseUrlResourceScopeWithoutBaseUrl_ThrowsArgumentException ( ) {
275298 var customOptions = new Types . HttpOptions { BaseUrlResourceScope = Types . ResourceScope . Collection , BaseUrl = null } ;
0 commit comments