I am trying to write unit tests for the following code:
m_Client.SendAsync(request).ContinueWith(responseTask =>
{
HttpResponseMessage response = responseTask.Result;
try
{
string str = response.Content.ReadAsStringAsync().Result;
// ...
}
catch
{
// process exception here
}
}
Is it possible to emulate exception of any kind during the ReadAsStringAsync execution?