I'm new to unit testing and async operations in visual studio/c#. Appreciate any help on this.
My Main class
class Foo
{
public async Task<string> GetWebAsync()
{
using (var client = new HttpClient())
{
var response = await client.GetAsync("https://hotmail.com");
return await response.Content.ReadAsStringAsync();
}
}
}
Unit Test
[TestMethod]
public void TestGet()
{
Foo foo = new Foo();
foo.GetWebAsync().ContinueWith((k) =>
{
Console.Write(k);
Assert.IsNotNull(null, "error");
});
}
var response = await client.GetAsync("https://hotmail.com"); return await response.Content.ReadAsStringAsync();.....why not two responses and wait all, when all?