Exemplo n.º 1
0
 public void MaxResponseContentBufferSize_UnitTest()
 {
     ExecuteProperty(
         () =>
         // Create Test Instance
     {
         HttpClientLive instance = GetInstance();
         return(instance);
     },
         // Create Set Value
         instance =>
     {
         long setValue = default(Int64);
         MaxResponseContentBufferSize_SetCondition(ref instance, ref setValue);
         return(setValue);
     },
         // Invoke Setter
         (instance, setValue) => { instance.MaxResponseContentBufferSize = setValue; },
         // Validate Set Operation
         (instance, setValue) => { },
         // Invoke Getter
         instance => { return(instance.MaxResponseContentBufferSize); },
         // Validate Get Operation
         (instance, setValue, getValue) => { });
 }
Exemplo n.º 2
0
        internal static HttpClientLive GetInstance([CallerMemberName] string callerName = "")
        {
            var instance = new HttpClientLive();

            InstanceFactory(ref instance, callerName);
            return(instance);
        }
Exemplo n.º 3
0
 public void Timeout_UnitTest()
 {
     ExecuteProperty(
         () =>
         // Create Test Instance
     {
         HttpClientLive instance = GetInstance();
         return(instance);
     },
         // Create Set Value
         instance =>
     {
         TimeSpan setValue = default(TimeSpan);
         Timeout_SetCondition(ref instance, ref setValue);
         return(setValue);
     },
         // Invoke Setter
         (instance, setValue) => { instance.Timeout = setValue; },
         // Validate Set Operation
         (instance, setValue) => { },
         // Invoke Getter
         instance => { return(instance.Timeout); },
         // Validate Get Operation
         (instance, setValue, getValue) => { });
 }
Exemplo n.º 4
0
 public void BaseAddress_UnitTest()
 {
     ExecuteProperty(
         () =>
         // Create Test Instance
     {
         HttpClientLive instance = GetInstance();
         return(instance);
     },
         // Create Set Value
         instance =>
     {
         Uri setValue = default(Uri);
         BaseAddress_SetCondition(ref instance, ref setValue);
         return(setValue);
     },
         // Invoke Setter
         (instance, setValue) => { instance.BaseAddress = setValue; },
         // Validate Set Operation
         (instance, setValue) => { },
         // Invoke Getter
         instance => { return(instance.BaseAddress); },
         // Validate Get Operation
         (instance, setValue, getValue) => { });
 }
Exemplo n.º 5
0
 public void DefaultRequestHeaders_UnitTest()
 {
     ExecuteProperty(
         () =>
         // Create Test Instance
     {
         HttpClientLive instance = GetInstance();
         return(instance);
     },
         null, null, null, // No Set Accessor
         // Invoke Getter
         instance => { return(instance.DefaultRequestHeaders); },
         // Validate Get Operation
         (instance, setValue, getValue) => { });
 }
Exemplo n.º 6
0
        /// <summary>
        ///     Creates the client.
        /// </summary>
        private void CreateClient()
        {
            lock (r_SyncRoot)
            {
                if (m_Client == null)
                {
                    m_Client = new HttpClientLive();
                    m_Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    Fire_OnClientCreated(m_Client);

                    m_Client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
                                                                                                 Convert.ToBase64String(
                                                                                                     Encoding.ASCII.GetBytes(string.Format("{0}:{1}", BasicAuthorizationUsername, BasicAuthorizationPassword))));

                    m_Deadman = TaskHelpers.DeadmanAction(TimeSpan.FromMilliseconds(1000), FreeClient);
                }
            }
        }
Exemplo n.º 7
0
 partial void PutAsync_PostValidate(HttpClientLive instance, String requestUri, HttpContent content, Task <HttpResponseMessage> _retVal);
Exemplo n.º 8
0
 static partial void InstanceFactory(ref HttpClientLive instance, [CallerMemberName] string callerName = "");
Exemplo n.º 9
0
 partial void MaxResponseContentBufferSize_SetCondition(ref HttpClientLive instance, ref Int64 setValue);
Exemplo n.º 10
0
 partial void DefaultRequestHeaders_SetCondition(ref HttpClientLive instance, ref HttpRequestHeaders setValue);
Exemplo n.º 11
0
 partial void Equals_PostValidate(HttpClientLive instance, Object obj, Boolean _retVal);
Exemplo n.º 12
0
 partial void SendAsync_PreCondition(ref HttpClientLive instance, ref HttpRequestMessage request);
Exemplo n.º 13
0
 partial void ToString_PostValidate(HttpClientLive instance, String _retVal);
Exemplo n.º 14
0
 partial void GetHashCode_PreCondition(ref HttpClientLive instance);
Exemplo n.º 15
0
 partial void Dispose_PostValidate(HttpClientLive instance);
Exemplo n.º 16
0
 partial void GetByteArrayAsync_PostValidate(HttpClientLive instance, String requestUri, Task <Byte[]> _retVal);
Exemplo n.º 17
0
 partial void GetHashCode_PostValidate(HttpClientLive instance, Int32 _retVal);
Exemplo n.º 18
0
 partial void GetAsync_PreCondition(ref HttpClientLive instance, ref Uri requestUri, ref CancellationToken cancellationToken);
Exemplo n.º 19
0
 partial void GetAsync_PostValidate(HttpClientLive instance, Uri requestUri, CancellationToken cancellationToken, Task <HttpResponseMessage> _retVal);
Exemplo n.º 20
0
 partial void Equals_PreCondition(ref HttpClientLive instance, ref Object obj);
Exemplo n.º 21
0
 partial void PutAsync_PreCondition(ref HttpClientLive instance, ref String requestUri, ref HttpContent content);
Exemplo n.º 22
0
 partial void DeleteAsync_PostValidate(HttpClientLive instance, String requestUri, Task <HttpResponseMessage> _retVal);
Exemplo n.º 23
0
 partial void SendAsync_PostValidate(HttpClientLive instance, HttpRequestMessage request, Task <HttpResponseMessage> _retVal);
Exemplo n.º 24
0
 partial void GetStringAsync_PreCondition(ref HttpClientLive instance, ref String requestUri);
Exemplo n.º 25
0
 partial void Timeout_SetCondition(ref HttpClientLive instance, ref TimeSpan setValue);
Exemplo n.º 26
0
 partial void GetType_PostValidate(HttpClientLive instance, Type _retVal);
Exemplo n.º 27
0
 partial void ToString_PreCondition(ref HttpClientLive instance);
Exemplo n.º 28
0
 partial void GetType_PreCondition(ref HttpClientLive instance);
Exemplo n.º 29
0
 partial void GetStringAsync_PostValidate(HttpClientLive instance, String requestUri, Task <String> _retVal);
Exemplo n.º 30
0
 partial void Dispose_PreCondition(ref HttpClientLive instance);