unit testing async task in csharp

后端 未结 1 477
北恋
北恋 2021-01-15 08:07

I\'m new to unit testing and async operations in visual studio/c#. Appreciate any help on this.

My Main class

class Foo 
{
    publi         


        
相关标签:
1条回答
  • 2021-01-15 08:35

    Make the Test async as well

    [TestMethod]
    public async Task TestGet() {
        var foo = new Foo();
        var result = await foo.GetWebAsync();
        Assert.IsNotNull(result, "error");
        Console.Write(result);
    }
    
    0 讨论(0)
提交回复
热议问题