public void GetOnlineProxyUsesProxyAddressIfNoEndPointConfigured() { Request request = new Request(); request.Endpoint = "MissingEndpoint"; request.OnlineProxyType = typeof(MockWebServiceProxy); MockEndpointCatalog catalog = new MockEndpointCatalog(); WebServiceProxyFactory factory = new WebServiceProxyFactory((IEndpointCatalog)catalog); SoapHttpClientProtocol proxy = (SoapHttpClientProtocol)factory.GetOnlineProxy(request, "Network"); Assert.IsNotNull(proxy); Assert.IsNotNull(proxy.Url); Assert.AreEqual("http://MyUrl.myurl.com/".ToLower(), proxy.Url.ToLower()); }
public void WebServiceProxyFactorySetsAddress() { Request request = new Request(); request.Endpoint = "endpoint"; request.OnlineProxyType = typeof(MockWebServiceProxy); NetworkCredential creds = new NetworkCredential("user", "pwd"); MockEndpointCatalog catalog = new MockEndpointCatalog(); MockEndpoint endpoint = new MockEndpoint("endpoint"); endpoint.Default = new MockEndpointConfig(defaultURL); endpoint.Default.Credential = creds; catalog.Endpoints.Add("endpoint", endpoint); WebServiceProxyFactory factory = new WebServiceProxyFactory((IEndpointCatalog)catalog); SoapHttpClientProtocol proxy = (SoapHttpClientProtocol)factory.GetOnlineProxy(request, "Network"); Assert.IsNotNull(proxy); Assert.AreEqual(defaultURL, proxy.Url); }