public virtual async Task <TResponse> ParseResponseDataAsync(string data, CancellationToken cancelToken)
        {
            Func <UTResponse> syncParseResponse = () =>
            {
#warning @igk debug response output, remove later
                Debug.WriteLine("RESPONSE: " + data);
                return(UTResponseParser.Parse(data, this.statusCode, cancelToken));
            };

            return(await Task.Factory.StartNew(syncParseResponse, cancelToken) as TResponse);
        }
        public async Task <UTResponse> ParseResponseDataAsync(string httpData, CancellationToken cancelToken)
        {
            Func <UTResponse> syncParseResponse = () =>
            {
                //TODO: @igk debug response output, remove later
                Debug.WriteLine("RESPONSE: " + httpData);

                return(UTResponseParser.Parse(httpData, this.statusCode, cancelToken));
            };

            return(await Task.Factory.StartNew(syncParseResponse, cancelToken));
        }
Пример #3
0
        public void TestParseNullData()
        {
            TestDelegate action = () => UTResponseParser.Parse(null, CancellationToken.None);

            Assert.Throws <ArgumentNullException>(action, "cannot parse null response");
        }