private void GetKeyCount() { Hamster.Environment env = new Hamster.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.GetKeyCount()); db.Insert(k, r); Assert.AreEqual(1, db.GetKeyCount()); k[0] = 1; db.Insert(k, r); Assert.AreEqual(2, db.GetKeyCount()); db.Close(); env.Close(); }
public void GetKeyCount() { Database db = new Database(); db.Create("ntest.db"); byte[] k = new byte[5]; byte[] r = new byte[5]; Assert.AreEqual(0, db.GetKeyCount()); db.Insert(k, r); Assert.AreEqual(1, db.GetKeyCount()); k[0] = 1; db.Insert(k, r); Assert.AreEqual(2, db.GetKeyCount()); db.Close(); }