Hi, I've been trying to use your code, but I am having some problems when HtmlHelper is instanciated.
I've detailed the problem here: http://stackoverflow.com/questions/3445770/missingmethodexception-thrown-when-trying-to-mock-htmlhelper-with-moq
apparently the ViewContext constructor's signature has changed, but even when supplying an updated Mock, I'm seeing a MissingMethodException being thrown.
This code does not compile because the viewData variable on line 15 does not exist.
ReplyDeleteBut I'm presuming the "viewData" variable on line 15 was intended to be "vd".
ReplyDeleteThanks for spotting, updated now.
ReplyDeleteHi, I've been trying to use your code, but I am having some problems when HtmlHelper is instanciated.
ReplyDeleteI've detailed the problem here: http://stackoverflow.com/questions/3445770/missingmethodexception-thrown-when-trying-to-mock-htmlhelper-with-moq
apparently the ViewContext constructor's signature has changed, but even when supplying an updated Mock, I'm seeing a MissingMethodException being thrown.
Eric,
ReplyDeletecheck out a version for MVC 2 and 3 in this new post.