Filling SQLite in-memory for unit testing

I am thinking about using SQLite as a stub for my Oracle database. I can easily direct all my DAL commands to SQLite, but now I am wondering how I should easily populate the data for each test method. Should each method start by creating the necessary table (s) and inserting rows for a particular test? Should I populate the SetUp phase of the phase with data in memory? Is there any other way (like reading it from some file, but discarding the changes so that the next reading is the same)?
Maybe I just need to stub db using a regular stub and return locally created obejcts if necessary (DataSets and DataTables)? I thought about this, but this way I will not test the actual queries, and I am trying to use unit test methods that perform SQL selection. I want to check the syntax and correctness of the queries.

Any best practices in this regard? Or just good ideas?

+5
source share
1 answer

How to backup SQLite-Db file?

SQLite , db , . SQL db . , db ( ) () SQL .

SQL () .

+2

All Articles