Wait until all Task finish in unit test

后端 未结 3 1368
有刺的猬
有刺的猬 2020-12-30 06:54

I have this class I want to unit test:

public class SomeClass
{
    public void Foo()
    {
        Bar();
    }

    private void Bar()
    {
        Task.F         


        
3条回答
  •  旧时难觅i
    2020-12-30 07:15

    Task.WaitAll(the, list, of, task, objects, you, need, to, wait, on);
    

    If it's a void async method then you can't do it. The design is broken. They're only for fire and forget.

提交回复
热议问题