title: How to Unit Test method that uses a Webservice on Windows Phone?
body: <p>I'm working on a project that retrieves information from an external webservice API, but I'm not sure how I'm supposed to test it, I'm quite new at Testing and I have done just a couple of Unit Test, but as far as I know I have to mock the webservice functionality, I've been looking for info regarding this subject but haven't found anything for Windows Phone yet. What's the standard procedure for these type of cases?</p>
  
  <p>Here's a simple version of what I want to test:</p>
  
  <pre><code>    public async Task&lt;List&lt;Song&gt;&gt; FetchSongsAsync(String query)
      {
          if (String.IsNullOrEmpty(query))
              return null;
  
          string requestUrl = "webservice url";
          var client = new HttpClient();
          var result = await client.GetStringAsync(new Uri(requestUrl,UriKind.Absolute));
          try
          {
              var result = JsonConvert.DeserializeObject&lt;RootObject&gt;(result);
              return result;
          }
          catch (Exception)
          {
              return null;
           }
      }
  </code></pre>
  
  <p>Thanks!</p>