GetCount() public method

Returns the number of keys in this Database
public GetCount ( ) : System.Int64
return System.Int64
Ejemplo n.º 1
0
        private void GetKeyCount()
        {
            Upscaledb.Environment env = new Upscaledb.Environment();
            Database db = new Database();
            env.Create("ntest.db");
            db = env.CreateDatabase(1);

            byte[] k = new byte[5];
            byte[] r = new byte[5];
            Assert.AreEqual(0, db.GetCount());
            db.Insert(k, r);
            Assert.AreEqual(1, db.GetCount());
            k[0] = 1;
            db.Insert(k, r);
            Assert.AreEqual(2, db.GetCount());
            db.Close();
            env.Close();
        }