本文整理汇总了C#中RelativePath.Append方法的典型用法代码示例。如果您正苦于以下问题:C# RelativePath.Append方法的具体用法?C# RelativePath.Append怎么用?C# RelativePath.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RelativePath
的用法示例。
在下文中一共展示了RelativePath.Append方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelativePath_Unit_Append1_PathContainsAnotherSeparator
public void RelativePath_Unit_Append1_PathContainsAnotherSeparator()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = "Chad\\Greer";
target.Append(path);
}
示例2: RelativePath_Unit_Append1_Optimal
public void RelativePath_Unit_Append1_Optimal()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = "Chad/Greer";
RelativePath result = target.Append(path);
Assert.AreEqual("sites", result.Nodes.ElementAt(0));
Assert.AreEqual("Chad", result.Nodes.ElementAt(1));
Assert.AreEqual("Greer", result.Nodes.ElementAt(2));
Assert.AreEqual(separator, result.Separator);
}
示例3: RelativePath_Unit_Append1_PathIsEmpty
public void RelativePath_Unit_Append1_PathIsEmpty()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = String.Empty;
RelativePath result = target.Append(path);
Assert.AreEqual(target.Nodes.Count(), result.Nodes.Count());
Assert.AreEqual("sites", result.Nodes.ElementAt(0));
Assert.AreEqual(separator, result.Separator);
}
示例4: RelativePath_Unit_Append2_TargetHasEmptyLastNode
public void RelativePath_Unit_Append2_TargetHasEmptyLastNode()
{
String[] nodes = new String[] { "sites", String.Empty };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator, false);
String path = "Chad/Greer";
Boolean normalizeSeparators = true;
RelativePath result = target.Append(path, normalizeSeparators);
Assert.AreEqual("sites", result.Nodes.ElementAt(0));
Assert.AreEqual("Chad", result.Nodes.ElementAt(1));
Assert.AreEqual("Greer", result.Nodes.ElementAt(2));
Assert.AreEqual(separator, result.Separator);
}
示例5: RelativePath_Unit_Append2_PathIsWhiteSpace
public void RelativePath_Unit_Append2_PathIsWhiteSpace()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = " \t \r \n ";
Boolean normalizeSeparators = true;
RelativePath result = target.Append(path, normalizeSeparators);
Assert.AreEqual(target.Nodes.Count(), result.Nodes.Count());
Assert.AreEqual("sites", result.Nodes.ElementAt(0));
Assert.AreEqual(separator, result.Separator);
}
示例6: RelativePath_Unit_Append2_PathIsNull
public void RelativePath_Unit_Append2_PathIsNull()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = null;
Boolean normalizeSeparators = true;
target.Append(path, normalizeSeparators);
}
示例7: RelativePath_Unit_Append2_PathContainsConsecutiveSeparators
public void RelativePath_Unit_Append2_PathContainsConsecutiveSeparators()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = "Chad//Greer";
Boolean normalizeSeparators = true;
target.Append(path, normalizeSeparators);
}
示例8: RelativePath_Unit_Append2_PathContainsAnotherSeparator
public void RelativePath_Unit_Append2_PathContainsAnotherSeparator()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = "Chad\\Greer";
Boolean normalizeSeparators = true;
RelativePath result = target.Append(path, normalizeSeparators);
Assert.AreEqual("sites", result.Nodes.ElementAt(0));
Assert.AreEqual("Chad", result.Nodes.ElementAt(1));
Assert.AreEqual("Greer", result.Nodes.ElementAt(2));
Assert.AreEqual(separator, result.Separator);
}
示例9: RelativePath_Unit_Append1_PathIsNull
public void RelativePath_Unit_Append1_PathIsNull()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
String path = null;
target.Append(path);
}