When testing modules, is it necessary to use the database when testing CRUD operations? Can sql lite help with this? Do you need to create db somehow in memory?
I am using mbunit.
No. Integration of the actual database would be integration testing . No unit testing.
Yes, you can use any built-in DB, such as SQLite or MS SQL Compact, for this, if you can not abstract (ridicule) your DAL / DAO in any other way.
, DAL, DAL. DAL - .
, : :)
, , , , ?
, , ORM.
, . , .
, Unit Tests, , - , .
SQL Server. - " " . .
CRUD-?
, CRUD , mocks stub. , , SQL.
, , "" , , , , , , , SQL-.
, , mocks. , , .
. 2/3 . .
sql lite ?
, , - . , .
db - ?
. DbUnit SQL-, SQL-. , , , , , , , .
, , , - , .
, mocks, . , , , .
, , DbUnit.NET. .NET- , , Java , . DbUnit . . , Best Practices, .
, , , , .
mock-database. , , , , .
, . SQL-, , . CRUD , () / /.
DBSnapshot, sqlserver.
, db. SqlLite ( ), , , .
, : , , , , .
The above ensures that you can run each test separately. My DBSnapshot utility will simplify your code if you wrote it .net. I think its easier to use than DbUnit.NET.