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


C# BsonInt32.CompareTo方法代码示例

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


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

示例1: CompareTo_BsonInt32_should_return_expected_result

        public void CompareTo_BsonInt32_should_return_expected_result(int int32Value, int otherInt32Value, int expectedResult)
        {
            var subject = new BsonInt32(int32Value);
            var other = new BsonInt32(otherInt32Value);

            var result1 = subject.CompareTo((BsonInt32)other);
            var result2 = subject.CompareTo((BsonValue)other);

            result1.Should().Be(expectedResult);
            result2.Should().Be(expectedResult);
        }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:11,代码来源:BsonInt32Tests.cs

示例2: CompareTo_BsonInt64_should_return_expected_result

        public void CompareTo_BsonInt64_should_return_expected_result(int int32Value, long otherInt64Value, int expectedResult)
        {
            var subject = new BsonInt32(int32Value);
            var other = new BsonInt64(otherInt64Value);

            var result = subject.CompareTo(other);

            result.Should().Be(expectedResult);
        }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:9,代码来源:BsonInt32Tests.cs

示例3: CompareTo_BsonDouble_should_return_expected_result

        public void CompareTo_BsonDouble_should_return_expected_result(int int32Value, double otherDoubleValue, int expectedResult)
        {
            var subject = new BsonInt32(int32Value);
            var other = new BsonDouble(otherDoubleValue);

            var result = subject.CompareTo(other);

            result.Should().Be(expectedResult);
        }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:9,代码来源:BsonInt32Tests.cs

示例4: CompareTo_null_should_return_expected_result

        public void CompareTo_null_should_return_expected_result()
        {
            var subject = new BsonInt32(0);

            var result1 = subject.CompareTo((BsonInt32)null);
            var result2 = subject.CompareTo((BsonValue)null);

            result1.Should().Be(1);
            result2.Should().Be(1);
        }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:10,代码来源:BsonInt32Tests.cs


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