public void TestMethod1() { var db = new MemoryDatabase(); db.Setup(); CreateTables(db.OpenDbConnection()); Assert.IsTrue(Test(db.OpenDbConnection())); Assert.IsTrue(TestCount <Employee>(db.OpenDbConnection(), 0)); //Assert.IsTrue(TestCount<Customer>(db.OpenDbConnection(), 0)); }
private void CreateTablesFirst(MemoryDatabase db) { using (var conn = db.OpenDbConnection()) { db.ExecuteCommand(@" CREATE TABLE IF NOT EXISTS Employee ( [Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, [Name] NVARCHAR(64) NOT NULL )"); } Assert.IsTrue(db.ExecuteScalar <int>("SELECT count(*) from [Employee]") == 0); }