Пример #1
0
        public void TestRollback()
        {
            const string dbPath = "TestRollback.s3db";
            const string value  = "committed";

            InsertValueInNewDb(value, dbPath, false);

            var connString = new SqliteConnectionStringBuilder {
                DataSource = Path.Combine(Path.GetTempPath(), dbPath)
            };
            var adapter = new SqliteCommandChannelFactory().Open(connString);

            Assert.AreEqual((long)0, adapter.FetchValue("SELECT COUNT(*) FROM test"));
        }
Пример #2
0
        public void TestCommit()
        {
            const string dbPath = "TestCommit.s3db";
            const string value  = "committed";

            InsertValueInNewDb(value, dbPath, true);

            var connString = new SqliteConnectionStringBuilder {
                DataSource = Path.Combine(Path.GetTempPath(), dbPath)
            };
            var adapter = new SqliteCommandChannelFactory().Open(connString);

            Assert.AreEqual("committed", adapter.FetchValue("SELECT reference FROM test LIMIT 1"));
        }