Integration testing an ASP.NET MVC application

こ雲淡風輕ζ 提交于 2019-12-03 07:53:46

Here at office we do not test against real services.

  • We have test in service side
  • We are testing controllers as unit tests, we use mock in these unit tests
  • Yet we don't have a integration test :-(

We were advised to not use real services for testing, we use Rhino Mocks to simulate answers for methods being called inside controller actions.

So the problem is still about how to do integration tests in a good way.

Maybe this could help you:

http://www.codeproject.com/Articles/98373/Integration-testing-an-ASP-NET-MVC-application-wit.aspx

but I am still looking for a better understanding about its possibilities.

I'm using Ivonna for testing various levels of isolation. I'm able to test that a particular Url with some particular POST data hits the expected Action method with the expected arguments, and at the same time I'm able to stub/mock external services.

I've been using SpecsFor.MVC for integration testing. Essentially you write code in a test class and the framework runs a browser interpreting your C# into browser actions. It's beautifully simple to use and setup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!