moq System.Web.Mvc.HtmlHelper Partial method -


does knows how mock htmlhelper.partial?

i've created own htmlhelper class , 1 of feature of said helper class return mvchtmlstring of htmlhelper.partial.

example:

public static mvchtmlstring scripteditorfor(this htmlhelper<viewmodel> htmlhelper,     identifiers.painassessmentvariables painvariable) {      return htmlhelper.partial("test"); } 

i'm getting null reference exception when try moq test this

you can't. partial static method (an extension method), , moq can't mock static methods.

you have eihter hide call partial behind interface, or use mocking framework capable of mocking static methods.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -