单元测试的看法? [英] Unit Testing the Views?

查看:74
本文介绍了单元测试的看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何单元测试ASP.NET MVC的意见,你知道吗?

Any idea on how to unit test the views in ASP.NET MVC?

我讨厌遇到死亡的黄色画面,当我启动我的MVC项目只是因为我忘记更新的意见时我控制器改变动作方法之一名称。

I am sick of encountering the yellow screen of death when I launch my MVC project just because I forget to update the views when one of the Action methods of my controller changes name.

推荐答案

您使用可以写集成测试华廷但如果你只需要一个快速检查,看看是否你已经在你的意见的任何错误,你也可以尝试在这篇文章中提到的解决办法:<一href=\"http://stackoverflow.com/questions/108405/how-can-i-compile-aspnet-aspx-pages-before-loading-them-with-a-webserver\">How与网络服务器加载它们之前,我可以编译ASP.NET页面。 prebuild你的aspx页面,你是好去!

You could write integration tests using Watin, but if you just need a quick check to see if you've any errors in your views, you could also try the solution mentioned in this post: How can I compile ASP.NET pages before loading them with a webserver. Prebuild your aspx pages and you're good to go!

这篇关于单元测试的看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆