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


C# SqlInt64.CompareTo方法代码示例

本文整理汇总了C#中System.Data.SqlTypes.SqlInt64.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# SqlInt64.CompareTo方法的具体用法?C# SqlInt64.CompareTo怎么用?C# SqlInt64.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SqlTypes.SqlInt64的用法示例。


在下文中一共展示了SqlInt64.CompareTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompareTo

        public void CompareTo()
        {
            SqlInt64 TestInt4000 = new SqlInt64(4000);
            SqlInt64 TestInt4000II = new SqlInt64(4000);
            SqlInt64 TestInt10 = new SqlInt64(10);
            SqlInt64 TestInt10000 = new SqlInt64(10000);
            SqlString TestString = new SqlString("This is a test");

            Assert.True(TestInt4000.CompareTo(TestInt10) > 0);
            Assert.True(TestInt10.CompareTo(TestInt4000) < 0);
            Assert.True(TestInt4000II.CompareTo(TestInt4000) == 0);
            Assert.True(TestInt4000II.CompareTo(SqlInt64.Null) > 0);

            try
            {
                TestInt10.CompareTo(TestString);
                Assert.False(true);
            }
            catch (ArgumentException e)
            {
                Assert.Equal(typeof(ArgumentException), e.GetType());
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:23,代码来源:SqlInt64Test.cs

示例2: CompareTo

		public void CompareTo ()
		{
			SqlInt64 TestInt4000 = new SqlInt64 (4000);
			SqlInt64 TestInt4000II = new SqlInt64 (4000);
			SqlInt64 TestInt10 = new SqlInt64 (10);
			SqlInt64 TestInt10000 = new SqlInt64 (10000);
			SqlString TestString = new SqlString ("This is a test");

			Assert.IsTrue (TestInt4000.CompareTo (TestInt10) > 0, "#F01");
			Assert.IsTrue (TestInt10.CompareTo (TestInt4000) < 0, "#F02");
			Assert.IsTrue (TestInt4000II.CompareTo (TestInt4000) == 0, "#F03");
			Assert.IsTrue (TestInt4000II.CompareTo (SqlInt64.Null) > 0, "#F04");

			try {
				TestInt10.CompareTo (TestString);
				Assert.Fail ("#F05");
			} catch (ArgumentException e) {
				Assert.AreEqual (typeof (ArgumentException), e.GetType (), "#F06");
			}
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:20,代码来源:SqlInt64Test.cs

示例3: CompareTo

                public void CompareTo()
                {
                        SqlInt64 TestInt4000 = new SqlInt64 (4000);
                        SqlInt64 TestInt4000II = new SqlInt64 (4000);
                        SqlInt64 TestInt10 = new SqlInt64 (10);
                        SqlInt64 TestInt10000 = new SqlInt64 (10000);
                        SqlString TestString = new SqlString ("This is a test");

                        Assert ("#F01", TestInt4000.CompareTo (TestInt10) > 0);
                        Assert ("#F02", TestInt10.CompareTo (TestInt4000) < 0);
                        Assert ("#F03", TestInt4000II.CompareTo (TestInt4000) == 0);
                        Assert ("#F04", TestInt4000II.CompareTo (SqlInt64.Null) > 0);

                        try {
                                TestInt10.CompareTo (TestString);
                                Fail("#F05");
                        } catch(Exception e) {
                                AssertEquals ("#F06", typeof (ArgumentException), e.GetType ());
                        }
                }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:20,代码来源:SqlInt64Test.cs


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