开发者

Help testing mvc3 controller that accesses querystring

Just started learning mvc3. I've built a fairly basic w开发者_JAVA技巧ebsite (also using EF-Code-First if that makes a difference), now I'm trying to progress to building tests for it

My controller gets querystring data by going Request["whatever"], and when I run the test it says request is null

All the tutorials I've looked at so far have kinda lost me. Going into mocks and such, which they seem to assume prior knowledge of (never used mocks, so don't understand them yet)

Does anyone have a nice and basic tutorial to get me into unit testing? Or perhaps could give me an example


It is against MVC's design pattern to use HttpRequest directly. You can access the query string variables on your action as parameters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜