Esempio n. 1
0
 public void SetPrefixComparator()
 {
     Database db = new Database();
     byte[] k = new byte[25];
     byte[] r = new byte[25];
     compareCounter = 0;
     try {
         db.Create("ntest.db");
         db.SetPrefixCompareFunc(new
             PrefixCompareFunc(MyPrefixCompareFunc));
         db.Insert(k, r);
         k[0] = 1;
         db.Insert(k, r);
         db.Close();
     }
     catch (DatabaseException e) {
         Assert.Fail("unexpected exception " + e);
     }
     Assert.AreEqual(1, compareCounter);
 }