集成测试ASP.NET MVC应用程序 [英] Integration testing an ASP.NET MVC application

查看:144
本文介绍了集成测试ASP.NET MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关编写集成测试我们目前的ASP.NET MVC应用程序的有效方式一些建议。我们的体系结构包括:

I need some advice about efficient way of writing integration tests for our current ASP.NET MVC application. Our architecture consists of:


  • 下方控制器服务层

  • 服务层使用存储库和消息队列(有时)将消息发送到外部应用程序。

我认为应该做的是:


  • 写在隔离所有作品行为的单元测试。因此,举例来说,我们应该单元测试服务层,同时嘲讽库和消息队列。

  • Write behavioral unit tests for all pieces in isolation. So, for example, we should unit test the Service Layer while mocking Repositories and Message Queues.

也是一样的控制器。因此,我们嘲笑服务层和单元测试的控制器。

Same goes for Controllers. So we mock the Service Layer and unit test the Controller.

我的问题:


  • 是否有任何其他类型的集成测试,我们需要写?

  • Are there any other types of integration tests that we need to write?

我们还需要编写集成测试的服务与实际存储库和消息队列?

Do we still need to write integration tests for Services with the real Repositories and Message Queues?

我们还需要编写集成测试与真正的服务(这又包括实际库和消息队列)控制器。

Do we still need to write integration tests for Controllers with the real Services (which in turn consists of real Repositories and Message Queues).

任何意见将是极大的AP preciated。

Any advice would be greatly appreciated.

干杯

推荐答案

我使用 Ivonna 的用于测试各种级别隔离。我能够测试一些特定的POST数据特定URL击中预期操作方法与预期参数,并在同一时间,我能够存根/模拟外部服务。

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.

这篇关于集成测试ASP.NET MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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