Example #1
0
        public void MoveNext_WithTree1_AfterSecondMoveNextReturnsFalse()
        {
            AddEntries1();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();

            Assert.That(ee.MoveNext(), Is.False);
        }
Example #2
0
        public void MoveNext_WithTree1_AfterSecondMoveNextCurrentNull()
        {
            AddEntries1();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();
            ee.MoveNext();

            Assert.That(ee.Current, Is.Null);
        }
Example #3
0
        public void MoveNext_WithTree2_AfterTwoMoveNextCurrentHasSecondEntry()
        {
            AddEntries1();
            AddEntries2();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();
            ee.MoveNext();

            Assert.That(ee.Current.Index, Is.EqualTo(File1Index), "Did not get File1Index entry.");
        }
Example #4
0
        public void MoveNext_WithTree2_FourthMoveNextReturnsFalse()
        {
            AddEntries1();
            AddEntries2();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();
            ee.MoveNext();
            ee.MoveNext();

            Assert.That(ee.MoveNext(), Is.False, "Fouth MoveNext() true.");
        }
Example #5
0
        public void MoveNext_WithTree3_AfterFourMoveNextReturnsFourthEntry()
        {
            AddEntries1();
            AddEntries2();
            AddEntries3();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();
            ee.MoveNext();
            ee.MoveNext();
            ee.MoveNext();

            Assert.That(ee.Current.Index, Is.EqualTo(File3Index), "Did not get File3Index entry.");
        }
Example #6
0
        public void MoveNext_WithTree3_FifthMoveNextReturnsFalse()
        {
            AddEntries1();
            AddEntries2();
            AddEntries3();
            var ee = new EntryEnumerator(EStore);

            ee.MoveNext();
            ee.MoveNext();
            ee.MoveNext();
            ee.MoveNext();

            Assert.That(ee.MoveNext(), Is.False, "Fifth MoveNext() True,");
        }
Example #7
0
        public void MoveNext_WithTree1_FirstMoveNextIsTrue()
        {
            AddEntries1();
            var ee = new EntryEnumerator(EStore);

            Assert.That(ee.MoveNext(), Is.True);
        }
Example #8
0
        public void PrintPathsHaveHash2_WithTree4_A()
        {
            AddEntriesX4();

            var ee = new EntryEnumerator(EStore);

            Assert.That(ee.MoveNext(), Is.True, "t1");
            Assert.That(ee.Current.Index, Is.EqualTo(File1Index), "Did not get Dir2Index entry.");
            Assert.That(ee.MoveNext(), Is.True, "t2");
            Assert.That(ee.Current.Index, Is.EqualTo(Dir2Index), "Did not get File1Index entry.");
            Assert.That(ee.MoveNext(), Is.True, "t3");
            Assert.That(ee.Current.Index, Is.EqualTo(Dir5Index), "Did not get File4Dir5IndexIndex entry.");
            Assert.That(ee.MoveNext(), Is.False, "t6");

            EStore.PrintPathsHaveHash2();
        }
Example #9
0
 private bool FillEntries(
     IntPtr filler,
     IntPtr buf,
     IntPtr stbuf,
     long offset,
     EntryEnumerator entries)
 {
     while (entries.MoveNext())
     {
         DirectoryEntry entry  = entries.Current;
         IntPtr         _stbuf = IntPtr.Zero;
         int            r      = Interop.adaptor_invoke_filler(filler, buf, entry.Name, _stbuf, offset);
         if (r != 0)
         {
             entries.Repeat = true;
             return(false);
         }
     }
     return(true);
 }
Example #10
0
        public void MoveNext_NoRootEntries_FirstMoveNextFalse()
        {
            var ee = new EntryEnumerator(EStore);

            Assert.That(ee.MoveNext(), Is.False);
        }