Beispiel #1
0
        public void Fts5CommandRank([IncludeDataSources(TestProvName.AllSQLite)] string context)
        {
            using (var db = new TestDataConnection(context))
            {
                db.AddMappingSchema(SetupFtsMapping(SQLiteFTS.FTS5));

                try
                {
                    db.FTS5Rank(db.GetTable <FtsTable>(), "strange('function\")");
                }
                catch
                {
                    // we don't have FTS5 table, but we need to get sql for validation
                }
                finally
                {
                    Assert.AreEqual("INSERT INTO [FTS5_TABLE]([FTS5_TABLE], rank) VALUES('rank', @rank)", db.LastQuery);
                    Assert.AreEqual(1, db.Command.Parameters.Count);
                    Assert.AreEqual("strange('function\")", ((DbParameter)db.Command.Parameters[0]).Value);
                }
            }
        }