当前位置: 首页>>代码示例>>C#>>正文


C# RelativePath.Append方法代码示例

本文整理汇总了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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:9,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:13,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:12,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:14,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:13,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:14,代码来源:RelativePathTests.cs

示例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);
        }
开发者ID:cegreer,项目名称:Common,代码行数:9,代码来源:RelativePathTests.cs


注:本文中的RelativePath.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。