I changed my mind - Mock objects are wrong for database unit testing
Un post interessante a proposito dell'uso dei Mock objects per lo Unit testing dell'accesso ai dati...
More than a year ago I wrote about the problems in database testing. I alsostatedthat I feel it's totally wrong to run your unit tests against a live test database, but instead you should be using mock objects to save you from all the trouble.
Boy have things changed since then. I take back what I said. For a long time now I've been doing DB testing without mock objects, because I believe that's currently the best way to make sure you test data access logic and integration with the database procedures and views.
There are now several easy to implement solutions to the "how-the-hell-do-I-roll-back-the-changes-i've-made-to-the-db" problem(seethis article, mbUnit, xtUnitand this one about extending the new Nunitas well for several options for doing the same thing).
With those - there's no reason for you not to do it.
Funny how things change overtime. Like any other thing, but usually more, software development is one of those things that looking back 6 months from now I'll always say to myself "Gosh! if I knew then what I now!"..
Source:ย I changed my mind - Mock objects are wrong for database unit testing
ย