Search code examples
testingmockingfunctional-testingfitnesse

Fitnesse- Should tests talk to the database?


We are trying to use Fitnesse for our Functional test. Should i be mocking dependencies or should it be testing against the database?

What are the Pros/Cons of either of the approach?

The whole issue of testing against the DB is setting up data which is huge dependency. If we mock then is it real functional test?

Thanks


Solution

  • We have a full set of end to end functional tests that run in fitnesse in two modes: "InMemory" and "Database", Depending on which configuration to run the tests in dictates which repositories the tests use. This has several advantages:

    1) It keeps the developers from building a lot of functionality into the database and keeps in in the code.

    2) When "In-Memory" the fitnesse tests run very very fast. Allowing the tests to fail very very fast...and thus speed up development and agility. When they run in db mode only they do take some time.