将当前实例与所提供的测试 ID 进行比较,并返回一个整数,该整数指示当前实例在排序顺序中的位置是位于另一个对象之前、之后还是与其位置相同。
命名空间:  Microsoft.VisualStudio.TestTools.Common
程序集:  Microsoft.VisualStudio.QualityTools.Common(在 Microsoft.VisualStudio.QualityTools.Common.dll 中)
语法
声明
Public Function CompareTo ( _
    other As TestId _
) As Integer
public int CompareTo(
    TestId other
)
public:
virtual int CompareTo(
    TestId^ other
) sealed
abstract CompareTo : 
        other:TestId -> int 
override CompareTo : 
        other:TestId -> int 
public final function CompareTo(
    other : TestId
) : int
参数
- other
 类型:Microsoft.VisualStudio.TestTools.Common.TestId
 一个 TestId 对象。
返回值
类型:System.Int32
实现
异常
| 异常 | 条件 | 
|---|---|
| [ArgumentException] | 该 other 对象不是 TestId 对象。 | 
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.VisualStudio.TestTools.Common 命名空间
CompareTo()