Exemplo n.º 1
0
        public void CanCountTransactionEntries()
        {
            //arrange
            _txn = _env.BeginTransaction();
            var db = _txn.OpenDatabase(null, new DatabaseOptions { Flags = DatabaseOpenFlags.None });

            const int entriesCount = 10;
            for (var i = 0; i < entriesCount; i++)
                _txn.Put(db, i.ToString(), i.ToString());

            //act
            var count = _txn.GetEntriesCount(db);

            //assert;
            Assert.AreEqual(entriesCount, count);
        }