Beispiel #1
0
        /// <summary>
        /// Sets the global base address to be used across the test cases. Default is local host.
        /// </summary>
        /// <param name="baseAddress">Base address to use.</param>
        /// <returns>The same HTTP configuration builder.</returns>
        public IHttpConfigurationBuilder WithBaseAddress(string baseAddress)
        {
            MyWebApi.BaseAddress = new Uri(baseAddress, UriKind.Absolute);

            if (!RemoteServer.GlobalIsConfigured)
            {
                RemoteServer.ConfigureGlobal(baseAddress);
            }

            return(this);
        }
Beispiel #2
0
 /// <summary>
 /// Konfiguracia vzdialeneho servera.
 /// </summary>
 /// <param name="baseAddress">Zakladna adresa pre ziadosti.</param>
 /// <returns>Server builder.</returns>
 public IApiBuilder IsLocatedAt(string baseAddress)
 {
     RemoteServer.ConfigureGlobal(baseAddress);
     return(this.WorkingRemotely());
 }
Beispiel #3
0
 /// <summary>
 /// Configures global remote server.
 /// </summary>
 /// <param name="baseAddress">Base address to use for the requests.</param>
 /// <param name="httpClientHandlerSetup">Action setting the HttpClientHandler options.</param>
 /// <returns>Server builder.</returns>
 public static IServerBuilder IsLocatedAt(string baseAddress, Action <HttpClientHandler> httpClientHandlerSetup)
 {
     RemoteServer.ConfigureGlobal(baseAddress, httpClientHandlerSetup);
     return(WorkingRemotely());
 }