本文整理汇总了C#中ObjectId.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectId.GetHashCode方法的具体用法?C# ObjectId.GetHashCode怎么用?C# ObjectId.GetHashCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectId
的用法示例。
在下文中一共展示了ObjectId.GetHashCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DifferentObjectIdsDoesNotHaveSameHashCode
public void DifferentObjectIdsDoesNotHaveSameHashCode()
{
var a = new ObjectId(validSha1);
var b = new ObjectId(validSha2);
Assert.NotEqual(b.GetHashCode(), a.GetHashCode());
}
示例2: TestBsonObjectIdEquals
public void TestBsonObjectIdEquals()
{
BsonObjectId lhs = new ObjectId(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 });
BsonObjectId rhs = new ObjectId(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 });
Assert.NotSame(lhs, rhs);
Assert.Equal(lhs, rhs);
Assert.Equal(lhs.GetHashCode(), rhs.GetHashCode());
}
示例3: SimilarObjectIdsHaveSameHashCode
public void SimilarObjectIdsHaveSameHashCode()
{
var a = new ObjectId(validSha1);
var b = new ObjectId(validSha1);
Assert.Equal(b.GetHashCode(), a.GetHashCode());
}
示例4: SimilarObjectIdsHaveSameHashCode
public void SimilarObjectIdsHaveSameHashCode()
{
var a = new ObjectId("ce08fe4884650f067bd5703b6a59a8b3b3c99a09");
var b = new ObjectId("ce08fe4884650f067bd5703b6a59a8b3b3c99a09");
a.GetHashCode().ShouldEqual(b.GetHashCode());
}
示例5: DifferentObjectIdsDoesNotHaveSameHashCode
public void DifferentObjectIdsDoesNotHaveSameHashCode()
{
var a = new ObjectId("ce08fe4884650f067bd5703b6a59a8b3b3c99a09");
var b = new ObjectId("de08fe4884650f067bd5703b6a59a8b3b3c99a09");
a.GetHashCode().ShouldNotEqual(b.GetHashCode());
}
示例6: SimilarObjectIdsHaveSameHashCode
public void SimilarObjectIdsHaveSameHashCode()
{
var a = new ObjectId(validSha1);
var b = new ObjectId(validSha1);
a.GetHashCode().ShouldEqual(b.GetHashCode());
}