如何模拟IEnumerable <IFormFile>

时间:2019-07-03 10:43:20

标签: c# .net testing xunit

我正在.NetCore 2.2中创建WebApi。我有一个动作POST,其中一个参数为IEnumerable<IFromFile>

public IActionResult Create([ModelBinder(BinderType = typeof(JsonModelBinder))] OfferPlaceDto offerPlaceDto,
        IEnumerable<IFormFile> formFiles)

我必须为此动作编写xUnit测试,但是我不知道该formFiles是如何模拟的。

有人会有想法吗?

0 个答案:

没有答案