Is there a good http level testing framework for .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开发者_如何学JAVA 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?
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.
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.
精彩评论