Moq with Task await

后端 未结 3 687
滥情空心
滥情空心 2021-02-03 17:43

Since I have converted my WCF methods to Async, my unit tests have failed, and I can\'t figure out the correct syntax to get them to work.

Cllient proxy class

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-03 18:14

    You can reduce the amount of clutter in the code by using ReturnsAsync

    this._mockService.Setup(...).ReturnsAsync(false);

    This way you can remove the Task.FromResult part of the code

提交回复
热议问题