本文整理汇总了C#中RelativePath.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# RelativePath.CompareTo方法的具体用法?C# RelativePath.CompareTo怎么用?C# RelativePath.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RelativePath
的用法示例。
在下文中一共展示了RelativePath.CompareTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelativePath_Unit_CompareTo2_ObjIsSmaller
public void RelativePath_Unit_CompareTo2_ObjIsSmaller()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
IComparable target = new RelativePath(nodes, separator);
Object obj = new RelativePath(new String[] { "site" }, separator);
Int32 actual = target.CompareTo(obj);
Assert.AreEqual(1, actual);
}
示例2: RelativePath_Unit_CompareTo1_OtherIsSmaller
public void RelativePath_Unit_CompareTo1_OtherIsSmaller()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
RelativePath other = new RelativePath(new String[] { "site" }, separator);
Int32 actual = target.CompareTo(other);
Assert.AreEqual(1, actual);
}
示例3: RelativePath_Unit_CompareTo2_ObjIsGreater
public void RelativePath_Unit_CompareTo2_ObjIsGreater()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
IComparable target = new RelativePath(nodes, separator);
Object obj = new RelativePath(new String[] { "sites1" }, separator);
Int32 actual = target.CompareTo(obj);
Assert.IsTrue(actual < 0);
}
示例4: RelativePath_Unit_CompareTo1_OtherIsGreater
public void RelativePath_Unit_CompareTo1_OtherIsGreater()
{
String[] nodes = new String[] { "sites" };
Char separator = RelativePath.ForwardSlash;
RelativePath target = new RelativePath(nodes, separator);
RelativePath other = new RelativePath(new String[] { "sites1" }, separator);
Int32 actual = target.CompareTo(other);
Assert.IsTrue(actual < 0);
}