Ejemplo n.º 1
0
 public void the_right_items_are_deleted()
 {
     for (uint i = 2; i <= 3; i++)
     {
         long position;
         Assert.IsTrue(_newtable.TryGetOneValue(i, 0, out position));                         // 0th events are left
         Assert.IsFalse(_newtable.TryGetOneValue(i, 1, out position));
         Assert.IsTrue(_newtable.TryGetOneValue(i, EventNumber.DeletedStream, out position)); // delete tombstones are left
     }
 }
        public void the_smallest_items_can_be_found()
        {
            long position;

            Assert.IsTrue(PTable.TryGetOneValue(0x010100000000, 0, out position));
            Assert.AreEqual(0x0002, position);
        }
Ejemplo n.º 3
0
        public void the_largest_items_can_be_found()
        {
            long position;

            Assert.IsTrue(PTable.TryGetOneValue(1, 0, out position));
            Assert.AreEqual(0x0005, position);
        }
Ejemplo n.º 4
0
        public void the_fifth_item_can_be_found()
        {
            long position;

            Assert.IsTrue(PTable.TryGetOneValue(0x010500000000, 0x0001, out position));
            Assert.AreEqual(0x0002, position);
        }
        public void the_third_item_can_be_found()
        {
            long position;

            Assert.IsTrue(PTable.TryGetOneValue(0x0102, 0x0002, out position));
            Assert.AreEqual(0x0004, position);
        }
 public void the_right_items_are_deleted()
 {
     for (int i = 0; i < 4; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             long position;
             if ((i*10 + j)%2 == 0)
             {
                 Assert.IsTrue(_newtable.TryGetOneValue((uint)i, j, out position));
                 Assert.AreEqual(i*10+j, position);
             }
             else
                 Assert.IsFalse(_newtable.TryGetOneValue((uint)i, j, out position));
         }
     }
 }
 public void the_items_are_deleted()
 {
     for (uint i = 1; i < 5; i++)
     {
         long position;
         Assert.IsFalse(_newtable.TryGetOneValue(i, 1, out position));
     }
 }
Ejemplo n.º 8
0
        public void the_right_items_are_deleted()
        {
            long position;

            for (uint i = 2; i <= 3; i++)
            {
                Assert.IsFalse(_newtable.TryGetOneValue(i, 0, out position));
            }
        }
 public void the_right_items_are_deleted()
 {
     for (int i = 0; i < 4; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             long position;
             Assert.IsTrue(_newtable.TryGetOneValue((ulong)(0x010100000000 << i), j, out position));
             Assert.AreEqual(i * 10 + j, position);
         }
     }
 }
Ejemplo n.º 10
0
        public void throw_exception_if_index_entries_not_descending_during_ptable_get_one_value_2(byte version, bool skipIndexVerify)
        {
            string ptableFileName = ConstructPTable(version);

            CorruptPTableFile(ptableFileName, version, "maxOutMiddleEntries");
            //loading with a depth of 1 should load only 2 midpoints (first and last index entry)
            PTable pTable = PTable.FromFile(ptableFileName, 1, skipIndexVerify);
            long   position;

            Assert.Throws <MaybeCorruptIndexException>(() => pTable.TryGetOneValue(GetOriginalHash(numIndexEntries / 2, version), 1, out position));
            pTable.Dispose();
        }
        public void non_existent_item_cannot_be_found()
        {
            long position;

            Assert.IsFalse(PTable.TryGetOneValue(2, 0, out position));
        }
Ejemplo n.º 12
0
        public void throw_argumentoutofrangeexception_on_get_one_entry_query_when_provided_with_negative_version()
        {
            long pos;

            Assert.Throws <ArgumentOutOfRangeException>(() => _ptable.TryGetOneValue(0x0000, -1, out pos));
        }