mercredi 3 juillet 2019

How to mock IEnumerable

I'm creating WebApi in .NetCore 2.2. I have an action POST where one parameter is IEnumerable<IFromFile>

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

I have to write xUnit test of this action, but I do not know how mock this formFiles.

Someone would have an idea?

Aucun commentaire:

Enregistrer un commentaire