本文整理汇总了C#中InMemoryViewFolder.Append方法的典型用法代码示例。如果您正苦于以下问题:C# InMemoryViewFolder.Append方法的具体用法?C# InMemoryViewFolder.Append怎么用?C# InMemoryViewFolder.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InMemoryViewFolder
的用法示例。
在下文中一共展示了InMemoryViewFolder.Append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ForwardAndBackSlashAreInterchangeable
public void ForwardAndBackSlashAreInterchangeable()
{
var viewsFolder = new InMemoryViewFolder
{
{@"Home\Index.spark", "1"},
{@"Shared\_global.spark", "2"},
{@"Collision\Home\Baaz.spark", "6"}
};
var extraFolder = new InMemoryViewFolder
{
{@"Home\Foo.spark", "3"},
{@"Home\Bar.spark", "4"},
{@"Home\Quux.spark", "5"},
};
Assert.AreEqual(1, viewsFolder.ListViews(@"Collision/Home").Count);
Assert.AreEqual(1, viewsFolder.ListViews(@"Collision\Home").Count);
Assert.AreEqual(3, extraFolder.ListViews(@"Home").Count);
var combinedFolder = viewsFolder
.Append(new SubViewFolder(extraFolder, @"Extra/One"))
.Append(new SubViewFolder(extraFolder, @"Extra\Two"))
.Append(new SubViewFolder(extraFolder, @"Collision"));
Assert.AreEqual(1, combinedFolder.ListViews("Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra/One/Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra\One/Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra/One\Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra\One\Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra/Two/Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra\Two/Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra/Two\Home").Count);
Assert.AreEqual(3, combinedFolder.ListViews(@"Extra\Two\Home").Count);
Assert.AreEqual(4, combinedFolder.ListViews(@"Collision/Home").Count);
Assert.AreEqual(4, combinedFolder.ListViews(@"Collision\Home").Count);
Assert.IsTrue(combinedFolder.HasView(@"Extra/One/Home/Bar.spark"));
Assert.IsTrue(combinedFolder.HasView(@"Extra\One\Home\Bar.spark"));
Assert.IsTrue(combinedFolder.HasView(@"Extra/Two/Home/Bar.spark"));
Assert.IsTrue(combinedFolder.HasView(@"Extra\Two\Home\Bar.spark"));
}