Quick-and-Easy Database Integration Tests with SpecsFor

added by Matt_TCF
3/6/2012 11:27:21 PM

1 Kicks, 91 Views

SpecsFor makes it very easy to bolt on your own conventions, create your own base classes, and extend its behavior to support your specific testing needs. I’m working on a project that’s built on LINQ to SQL, and I wanted to start creating integration tests around our stored procedures and views. Here’s the base class I made to handle establishing a database connection, loading in “seed data,” and then cleaning up after each set of specs once they’re finished.