本文整理匯總了C#中NGit.Treewalk.FileTreeIterator.CreateSubtreeIterator方法的典型用法代碼示例。如果您正苦於以下問題:C# FileTreeIterator.CreateSubtreeIterator方法的具體用法?C# FileTreeIterator.CreateSubtreeIterator怎麽用?C# FileTreeIterator.CreateSubtreeIterator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NGit.Treewalk.FileTreeIterator
的用法示例。
在下文中一共展示了FileTreeIterator.CreateSubtreeIterator方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestSimpleIterate
public virtual void TestSimpleIterate()
{
FileTreeIterator top = new FileTreeIterator(trash, db.FileSystem, ((FileBasedConfig
)db.GetConfig()).Get(WorkingTreeOptions.KEY));
NUnit.Framework.Assert.IsTrue(top.First);
NUnit.Framework.Assert.IsFalse(top.Eof);
NUnit.Framework.Assert.AreEqual(FileMode.REGULAR_FILE.GetBits(), top.mode);
NUnit.Framework.Assert.AreEqual(paths[0], NameOf(top));
NUnit.Framework.Assert.AreEqual(paths[0].Length, top.GetEntryLength());
NUnit.Framework.Assert.AreEqual(mtime[0], top.GetEntryLastModified());
top.Next(1);
NUnit.Framework.Assert.IsFalse(top.First);
NUnit.Framework.Assert.IsFalse(top.Eof);
NUnit.Framework.Assert.AreEqual(FileMode.REGULAR_FILE.GetBits(), top.mode);
NUnit.Framework.Assert.AreEqual(paths[1], NameOf(top));
NUnit.Framework.Assert.AreEqual(paths[1].Length, top.GetEntryLength());
NUnit.Framework.Assert.AreEqual(mtime[1], top.GetEntryLastModified());
top.Next(1);
NUnit.Framework.Assert.IsFalse(top.First);
NUnit.Framework.Assert.IsFalse(top.Eof);
NUnit.Framework.Assert.AreEqual(FileMode.TREE.GetBits(), top.mode);
ObjectReader reader = db.NewObjectReader();
AbstractTreeIterator sub = top.CreateSubtreeIterator(reader);
NUnit.Framework.Assert.IsTrue(sub is FileTreeIterator);
FileTreeIterator subfti = (FileTreeIterator)sub;
NUnit.Framework.Assert.IsTrue(sub.First);
NUnit.Framework.Assert.IsFalse(sub.Eof);
NUnit.Framework.Assert.AreEqual(paths[2], NameOf(sub));
NUnit.Framework.Assert.AreEqual(paths[2].Length, subfti.GetEntryLength());
NUnit.Framework.Assert.AreEqual(mtime[2], subfti.GetEntryLastModified());
sub.Next(1);
NUnit.Framework.Assert.IsTrue(sub.Eof);
top.Next(1);
NUnit.Framework.Assert.IsFalse(top.First);
NUnit.Framework.Assert.IsFalse(top.Eof);
NUnit.Framework.Assert.AreEqual(FileMode.REGULAR_FILE.GetBits(), top.mode);
NUnit.Framework.Assert.AreEqual(paths[3], NameOf(top));
NUnit.Framework.Assert.AreEqual(paths[3].Length, top.GetEntryLength());
NUnit.Framework.Assert.AreEqual(mtime[3], top.GetEntryLastModified());
top.Next(1);
NUnit.Framework.Assert.IsTrue(top.Eof);
}