A backup can be created quickly, typically measured in seconds, with little or no effect on the server.*Snapshot backups have the following primary benefits: And this is where SQL Server's snapshot backups have got your back. Kind of like a database restore - except that would be slow. What you want is a way to wipe the slate clean - to return the database back to the state that it was in before your test ran. If it doesn't then the next test that runs may trip over the amended data and that's your test pack instantly useless. When you write a test that amends data in the database you need the test to clean up after itself. For a start you need a database server and you need a database. However hitting an actual database is has serious implications. The TL DR is that LINQ-to-Objects != Linq-to-Entities and so if you want some useful tests around your data tier then integration tests that actually hit a database are what you want. I've written before about how unit testing Entity Framework is a contentious and sometimes pointless activity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |