Search code examples
c#unit-testingtddscreen-scraping

Unit testing screen scraper


I'm in the process of writing an HTML screen scraper. What would be the best way to create unit tests for this?

Is it "ok" to have a static html file and read it from disk on every test?

Do you have any suggestions?


Solution

  • To guarantee that the test can be run over and over again, you should have a static page to test against. (Ie. from disk is OK)

    If you write a test that touches the live page on the web, thats probably not a unit test, but an integration test. You could have those too.