.NET 有没有好的 http 级别测试框架?
.NET 有没有好的 HTTP 级别测试框架?我们希望用对 .NET 开发人员更友好的内容替换一些 Web 注入脚本。理想情况下,我们希望能够像我们的其他单元和 Web 驱动程序测试一样将它们插入 NUnit。我们已经了解了 java 的 HttpUnit。对于 .NET 来说,类似的东西将是理想的。
我们希望为整个系统创建一个薄层的健全性测试,只要部署系统的一部分就可以运行该测试。我们只是想确信系统的其他部分仍在工作。
我们真的不想使用基于浏览器的东西,比如网络驱动程序,因为我们发现这些测试往往很慢而且不稳定。它们还需要在运行它们的任何机器上安装浏览器。我们还将进行网络驱动程序验收测试来测试系统任何部分发生变化的功能,但并不认为它们是端到端测试的最佳选择。
也许这不是解决这个问题的最好方法?
Are there any good HTTP level testing frameworks for .NET? We want to replace some web inject scripts with something more friendly to .NET developers. Ideally we'd like to be able to plug them into NUnit like the rest of our unit and web driver tests. We've seen HttpUnit for java. Something like that for .NET would be ideal.
We want to create a thin layer of sanity tests for the entirety of our system that can be run whenever a part of it is deployed. We just want to feel confident that the other parts of the system are still working.
We don't really want to use something browser based like web driver because we find that these tests tend to be slow and flaky. They also require a browser on whatever machine will run them. We will also have web driver acceptance tests to test the functionality of whatever piece of the system has changed, but don't feel they are the best choice for end to end tests.
Perhaps this isn't the best way to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近不得不这样做,解决这个问题的唯一方法是使用 Moles 来模拟 HttpRequest 类。你也可以使用 TypeMock 来做同样的事情,尽管许可成本对于大多数人来说是昂贵的,而且 Moles 工作得很好。摩尔的唯一问题是您需要使用摩尔特定的测试运行程序。
I had to do this recently on and the only way I was able to resolve this was to use Moles to mock the HttpRequest class. You could also use TypeMock to do the same thing although the licence cost is prohibitory for most people and Moles works just fine. The only issue with moles is you need to use the moles specific test-runner.
我们最终使用了 。 NET IKVM 版本 HtmlUnit 并且它工作得非常好。
我们发现它使我们的冒烟测试快速可靠,特别是与使用 Firefox Selenium 驱动程序相比。
我们没有尝试使用任何客户端功能,只是为了通过 HTTP 进行测试。
We ended up using the .NET IKVM version of HtmlUnit and it worked really nicely.
We found that it made our smoke tests fast and reliable, especially when compared to using the Firefox Selenium driver.
We didn't try to use any of the clientside functionality, just for testing over HTTP.