mercredi 9 octobre 2019

How to mock HttpContext.Current.Request.Form using Moq in Controller

How can I mock HttpContext.Current.Request.Form["something"] data in the tested controller? I can mock HttpContext.Current and it works but Request is readonly. I can not change the implementation of the controller where the Form data is used. I only have to write a test.

Aucun commentaire:

Enregistrer un commentaire