How to Unit Test HtmlHelper with Moq?

前端 未结 4 1720
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-03 20:06

Could somebody show me how you would go about creating a mock HTML Helper with Moq?

This article has a link to an article claiming to describe this, but following the li

4条回答
  •  迷失自我
    2021-02-03 21:04

    What you can do is this:

    HtmlHelper helper = null;
    helper.YourHelperMethod();
    

    No need to mock anything. Works brilliant for me.

提交回复
热议问题