Пример #1
0
        private void ValidateRevision(FSpotDatabaseConnection db, string revision)
        {
            var query = "SELECT data FROM meta WHERE name = 'F-Spot Database Version'";
            var found = db.Query <string> (query).ToString();

            Assert.AreEqual(revision, found);
        }
Пример #2
0
        private void CheckTag(FSpotDatabaseConnection db, uint id, string name, uint cat_id, int is_cat, int sort, string icon)
        {
            var reader = db.Query("SELECT id, name, category_id, is_category, sort_priority, icon FROM tags WHERE id = " + id);
            var found  = false;

            while (reader.Read())
            {
                Assert.AreEqual(id, Convert.ToUInt32(reader[0]), "id on tag " + id);
                Assert.AreEqual(name, reader[1], "name on tag " + id);
                Assert.AreEqual(cat_id, Convert.ToUInt32(reader[2]), "category_id on tag " + id);
                Assert.AreEqual(is_cat, Convert.ToInt32(reader[3]), "is_cat on tag " + id);
                Assert.AreEqual(sort, reader[4], "sort_priority on tag " + id);
                Assert.AreEqual(icon, reader[5], "icon on tag " + id);
                found = true;
            }
            Assert.IsTrue(found, "tag " + id + " missing");
        }
Пример #3
0
        private void CheckPhotoVersion(FSpotDatabaseConnection db, uint photo_id, uint version_id, string name, string base_uri, string filename, string import_md5, uint is_protected)
        {
            var reader = db.Query("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id = " + photo_id + " AND version_id = " + version_id);
            var found  = false;

            while (reader.Read())
            {
                Assert.AreEqual(photo_id, Convert.ToUInt32(reader[0]), "photo_id on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(version_id, Convert.ToUInt32(reader[1]), "version_id on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(name, reader[2], "name on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(base_uri, reader[3], "base_uri on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(filename, reader[4], "filename on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(import_md5, reader[5], "import_md5 on photo version " + photo_id + "/" + version_id);
                Assert.AreEqual(is_protected, Convert.ToUInt32(reader[6]), "protected on photo version " + photo_id + "/" + version_id);
                found = true;
            }
            Assert.IsTrue(found, "photo version " + photo_id + "/" + version_id + " missing");
        }
Пример #4
0
        private void CheckPhoto(FSpotDatabaseConnection db, uint id, uint time, string base_uri, string filename, string description, uint roll_id, uint default_version_id, uint rating)
        {
            var reader = db.Query("SELECT id, time, base_uri, filename, description, roll_id, default_version_id, rating FROM photos WHERE id = " + id);
            var found  = false;

            while (reader.Read())
            {
                Assert.AreEqual(id, Convert.ToUInt32(reader[0]), "id on photo " + id);
                Assert.AreEqual(time, Convert.ToUInt32(reader[1]), "time on photo " + id);
                Assert.AreEqual(base_uri, reader[2], "base_uri on photo " + id);
                Assert.AreEqual(filename, reader[3], "filename on photo " + id);
                Assert.AreEqual(description, reader[4], "description on photo " + id);
                Assert.AreEqual(roll_id, Convert.ToUInt32(reader[5]), "roll_id on photo " + id);
                Assert.AreEqual(default_version_id, Convert.ToUInt32(reader[6]), "default_version_id on photo " + id);
                Assert.AreEqual(rating, Convert.ToUInt32(reader[7]), "rating on photo " + id);
                found = true;
            }
            Assert.IsTrue(found, "photo " + id + " missing");
        }
Пример #5
0
 private void CheckPhoto(FSpotDatabaseConnection db, uint id, uint time, string base_uri, string filename, string description, uint roll_id, uint default_version_id, uint rating)
 {
     var reader = db.Query ("SELECT id, time, base_uri, filename, description, roll_id, default_version_id, rating FROM photos WHERE id = " + id);
     var found = false;
     while (reader.Read ()) {
         Assert.AreEqual (id, Convert.ToUInt32 (reader[0]), "id on photo "+id);
         Assert.AreEqual (time, Convert.ToUInt32 (reader[1]), "time on photo "+id);
         Assert.AreEqual (base_uri, reader[2], "base_uri on photo "+id);
         Assert.AreEqual (filename, reader[3], "filename on photo "+id);
         Assert.AreEqual (description, reader[4], "description on photo "+id);
         Assert.AreEqual (roll_id, Convert.ToUInt32 (reader[5]), "roll_id on photo "+id);
         Assert.AreEqual (default_version_id, Convert.ToUInt32 (reader[6]), "default_version_id on photo "+id);
         Assert.AreEqual (rating, Convert.ToUInt32 (reader[7]), "rating on photo "+id);
         found = true;
     }
     Assert.IsTrue (found, "photo "+id+" missing");
 }
Пример #6
0
 private void ValidateRevision(FSpotDatabaseConnection db, string revision)
 {
     var query = "SELECT data FROM meta WHERE name = 'F-Spot Database Version'";
     var found = db.Query<string> (query).ToString ();
     Assert.AreEqual (revision, found);
 }
Пример #7
0
 private int GetCount(FSpotDatabaseConnection db, string table, string where)
 {
     return db.Query<int> ("SELECT COUNT(*) FROM "+table+" WHERE "+where);
 }
Пример #8
0
 private void CheckTag(FSpotDatabaseConnection db, uint id, string name, uint cat_id, int is_cat, int sort, string icon)
 {
     var reader = db.Query ("SELECT id, name, category_id, is_category, sort_priority, icon FROM tags WHERE id = " + id);
     var found = false;
     while (reader.Read ()) {
         Assert.AreEqual (id, Convert.ToUInt32 (reader[0]), "id on tag "+id);
         Assert.AreEqual (name, reader[1], "name on tag "+id);
         Assert.AreEqual (cat_id, Convert.ToUInt32 (reader[2]), "category_id on tag "+id);
         Assert.AreEqual (is_cat, Convert.ToInt32 (reader[3]), "is_cat on tag "+id);
         Assert.AreEqual (sort, reader[4], "sort_priority on tag "+id);
         Assert.AreEqual (icon, reader[5], "icon on tag "+id);
         found = true;
     }
     Assert.IsTrue (found, "tag "+id+" missing");
 }
Пример #9
0
 private void CheckPhotoVersion(FSpotDatabaseConnection db, uint photo_id, uint version_id, string name, string base_uri, string filename, string import_md5, uint is_protected)
 {
     var reader = db.Query ("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id = " + photo_id + " AND version_id = " + version_id);
     var found = false;
     while (reader.Read ()) {
         Assert.AreEqual (photo_id, Convert.ToUInt32 (reader[0]), "photo_id on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (version_id, Convert.ToUInt32 (reader[1]), "version_id on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (name, reader[2], "name on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (base_uri, reader[3], "base_uri on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (filename, reader[4], "filename on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (import_md5, reader[5], "import_md5 on photo version "+photo_id+"/"+version_id);
         Assert.AreEqual (is_protected, Convert.ToUInt32 (reader[6]), "protected on photo version "+photo_id+"/"+version_id);
         found = true;
     }
     Assert.IsTrue (found, "photo version "+photo_id+"/"+version_id+" missing");
 }
Пример #10
0
 private int GetCount(FSpotDatabaseConnection db, string table, string where)
 {
     return(db.Query <int> ("SELECT COUNT(*) FROM " + table + " WHERE " + where));
 }