Ejemplo n.º 1
0
 /// <summary>
 /// Wakes up any sleeping processes, and MyWebService chain
 /// </summary>
 /// <returns></returns>
 public virtual async Task WakeServicesAsync()
 {
     if (MyWebService.ToString() == TypeExtension.DefaultString)
     {
         HttpRequestGetString Request = new HttpRequestGetString(MyWebService.ToString());
         Request.ThrowExceptionWithEmptyReponse = false;
         await Request.SendAsync();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Wakes up any sleeping processes, and MyWebService chain
 /// </summary>
 /// <returns></returns>
 public virtual async Task WakeServicesAsync()
 {
     if (MyWebService.ToString() == Defaults.String)
     {
         var Request = new HttpRequestGetString(MyWebService.ToString())
         {
             ThrowExceptionWithEmptyReponse = false
         };
         await Request.SendAsync();
     }
 }
Ejemplo n.º 3
0
        public async Task Core_Net_HttpRequestGetString_SendAsync()
        {
            var configuration = new ConfigurationManagerCore(ApplicationTypes.Native);
            var dataOut       = string.Empty;
            var request       = new HttpRequestGetString(configuration.AppSettingValue("MyWebService") + "/HomeApi");

            try
            {
                dataOut = await request.SendAsync();

                Assert.IsTrue(request.Response.IsSuccessStatusCode);
                throw new HttpRequestException();
            }
            catch (HttpRequestException ex)
            {
                Assert.IsTrue(dataOut != null || ex.Message.Contains("No such host") || ex.Message.Contains("no data"));
            }
            finally
            {
                request.Dispose();
            }
        }
Ejemplo n.º 4
0
        public async Task Net_HttpRequestGetString_SendAsync()
        {
            var configuration = ConfigurationManagerSafeTests.ConfigurationManagerSafeConstruct();
            var dataOut       = TypeExtension.DefaultString;
            var request       = new HttpRequestGetString(configuration.AppSettingValue("MyWebService") + "/HomeApi");

            try
            {
                dataOut = await request.SendAsync();

                Assert.IsTrue(request.Response.IsSuccessStatusCode);
                throw new WebException();
            }
            catch (WebException)
            {
                Assert.IsTrue(dataOut != null);
            }
            finally
            {
                request.Dispose();
            }
        }