本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}