本文整理汇总了C#中Symbol.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# Symbol.CompareTo方法的具体用法?C# Symbol.CompareTo怎么用?C# Symbol.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol.CompareTo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComparesTheSameAsStringCompareAndIgnoresCase
public void ComparesTheSameAsStringCompareAndIgnoresCase()
{
var a = new Symbol("a");
var z = new Symbol("z");
Assert.AreEqual(string.Compare("a", "Z", StringComparison.OrdinalIgnoreCase), a.CompareTo(z));
Assert.AreEqual(string.Compare("z", "A", StringComparison.OrdinalIgnoreCase), z.CompareTo(a));
}
示例2: ComparesTheSameAsStringCompare
public void ComparesTheSameAsStringCompare()
{
var a = new Symbol(SecurityIdentifier.GenerateForex("a", Market.FXCM), "a");
var z = new Symbol(SecurityIdentifier.GenerateForex("z", Market.FXCM), "z");
Assert.AreEqual(string.Compare("a", "z", StringComparison.Ordinal), a.CompareTo(z));
Assert.AreEqual(string.Compare("z", "a", StringComparison.Ordinal), z.CompareTo(a));
}
示例3: CompareToItselfReturnsZero
public void CompareToItselfReturnsZero()
{
var sym = new Symbol(SecurityIdentifier.GenerateForex("sym", Market.FXCM), "sym");
Assert.AreEqual(0, sym.CompareTo(sym));
}
示例4: ComparesAgainstStringWithoutException
public void ComparesAgainstStringWithoutException()
{
var a = new Symbol(SecurityIdentifier.GenerateForex("a", Market.FXCM), "a");
Assert.AreEqual(0, a.CompareTo("a"));
}
示例5: ComparesAgainstStringIgnoringCase
public void ComparesAgainstStringIgnoringCase()
{
var a = new Symbol(SecurityIdentifier.GenerateForex("a", Market.FXCM), "a");
Assert.AreEqual(0, a.CompareTo("A"));
}
示例6: CompareToItselfReturnsZero
public void CompareToItselfReturnsZero()
{
var sym = new Symbol("sym");
Assert.AreEqual(0, sym.CompareTo(sym));
}
示例7: ComparesAgainstStringWithoutException
public void ComparesAgainstStringWithoutException()
{
var a = new Symbol("a");
Assert.AreEqual(0, a.CompareTo("a"));
}
示例8: ComparesAgainstStringIgnoringCase
public void ComparesAgainstStringIgnoringCase()
{
var a = new Symbol("a");
Assert.AreEqual(0, a.CompareTo("A"));
}