コード例 #1
0
 public void GetWebServiceUrl()
 {
     #region WebServiceConfig
     string url = WebServiceConfig.GetWebServiceUri();
     #endregion
     Assert.AreEqual("http://magenicautomation.azurewebsites.net", url);
 }
コード例 #2
0
        public void CanOverrideWebServiceDriver()
        {
            WebServiceDriver tempDriver = new WebServiceDriver(WebServiceConfig.GetWebServiceUri());

            this.WebServiceDriver = tempDriver;

            Assert.AreEqual(this.TestObject.WebServiceManager.Get(), tempDriver);
        }
コード例 #3
0
        public static void TestCleanup()
        {
            // Do web service post run cleanup
            WebServiceDriver client = new WebServiceDriver(new Uri(WebServiceConfig.GetWebServiceUri()));
            string           result = client.Delete("/api/String/Delete/1", "text/plain", true);

            Assert.AreEqual(string.Empty, result);
        }
コード例 #4
0
        public void WebServiceDriverUsesProxy()
        {
            string url = WebServiceConfig.GetWebServiceUri().Replace("https://", "http://");

            this.WebServiceDriver.HttpClient.BaseAddress = new Uri(url);

            this.WebServiceDriver.GetWithResponse("/api/XML_JSON/GetAllProducts", "application/json");

            bool proxyUsed = RequestsHistory.Values.Any(r => r.RequestUri.ToString().Contains("/api/XML_JSON/GetAllProducts"));

            Assert.IsTrue(proxyUsed, "Failed to assert the proxy was used by the Web Service Driver.");
        }
コード例 #5
0
        public void GetXmlDeserialized()
        {
            WebServiceDriver client = new WebServiceDriver(new Uri(WebServiceConfig.GetWebServiceUri()));

            client.Get <ArrayOfProduct>("/api/XML_JSON/GetAllProducts", "application/xml", false);
        }
コード例 #6
0
        public void OverrideWorksForFactory()
        {
            HttpClient factoryClient = Magenic.Maqs.BaseWebServiceTest.HttpClientFactory.GetDefaultClient();

            Assert.AreEqual(WebServiceConfig.GetWebServiceUri() + "/", factoryClient.BaseAddress.ToString());
        }