本文整理汇总了C#中System.Data.SqlTypes.SqlDouble.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDouble.CompareTo方法的具体用法?C# SqlDouble.CompareTo怎么用?C# SqlDouble.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlTypes.SqlDouble
的用法示例。
在下文中一共展示了SqlDouble.CompareTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompareTo
public void CompareTo ()
{
SqlDouble Test1 = new SqlDouble (4e64);
SqlDouble Test11 = new SqlDouble (4e64);
SqlDouble Test2 = new SqlDouble (-9e34);
SqlDouble Test3 = new SqlDouble (10000);
SqlString TestString = new SqlString ("This is a test");
Assert.IsTrue (Test1.CompareTo (Test3) > 0, "#E01");
Assert.IsTrue (Test2.CompareTo (Test3) < 0, "#E02");
Assert.IsTrue (Test1.CompareTo (Test11) == 0, "#E03");
Assert.IsTrue (Test11.CompareTo (SqlDouble.Null) > 0, "#E04");
try {
Test1.CompareTo (TestString);
Assert.Fail ("#E05");
} catch (ArgumentException e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "#E06");
}
}
示例2: CompareTo
public void CompareTo()
{
SqlDouble Test1 = new SqlDouble (4e64);
SqlDouble Test11 = new SqlDouble (4e64);
SqlDouble Test2 = new SqlDouble (-9e34);
SqlDouble Test3 = new SqlDouble (10000);
SqlString TestString = new SqlString ("This is a test");
Assert ("#E01", Test1.CompareTo (Test3) > 0);
Assert ("#E02", Test2.CompareTo (Test3) < 0);
Assert ("#E03", Test1.CompareTo (Test11) == 0);
Assert ("#E04", Test11.CompareTo (SqlDouble.Null) > 0);
try {
Test1.CompareTo (TestString);
Fail("#E05");
} catch(Exception e) {
AssertEquals ("#E06", typeof (ArgumentException), e.GetType ());
}
}
示例3: CompareTo
public void CompareTo()
{
SqlDouble Test1 = new SqlDouble(4e64);
SqlDouble Test11 = new SqlDouble(4e64);
SqlDouble Test2 = new SqlDouble(-9e34);
SqlDouble Test3 = new SqlDouble(10000);
SqlString TestString = new SqlString("This is a test");
Assert.True(Test1.CompareTo(Test3) > 0);
Assert.True(Test2.CompareTo(Test3) < 0);
Assert.True(Test1.CompareTo(Test11) == 0);
Assert.True(Test11.CompareTo(SqlDouble.Null) > 0);
try
{
Test1.CompareTo(TestString);
Assert.False(true);
}
catch (ArgumentException e)
{
Assert.Equal(typeof(ArgumentException), e.GetType());
}
}