本文整理汇总了C#中Fingerprint.IsEquivalent方法的典型用法代码示例。如果您正苦于以下问题:C# Fingerprint.IsEquivalent方法的具体用法?C# Fingerprint.IsEquivalent怎么用?C# Fingerprint.IsEquivalent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fingerprint
的用法示例。
在下文中一共展示了Fingerprint.IsEquivalent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestEquivalence
public void TestEquivalence()
{
Fingerprint fp1 = new Fingerprint(65);
Fingerprint fp2 = new Fingerprint(65);
Fingerprint fp3 = new Fingerprint(64);
Fingerprint fp4 = new Fingerprint(66);
// Reference first
Assert.True(fp1.IsEquivalent(fp1));
Assert.True(fp2.IsEquivalent(fp2));
Assert.True(fp3.IsEquivalent(fp3));
Assert.True(fp4.IsEquivalent(fp4));
// Length second
Assert.True(fp3.IsEquivalent(fp1));
Assert.False(fp1.IsEquivalent(fp3));
Assert.False(fp4.IsEquivalent(fp2));
Assert.True(fp2.IsEquivalent(fp4));
// Bits third
Assert.True(fp1.IsEquivalent(fp2));
Assert.True(fp2.IsEquivalent(fp1));
fp1.Touch(32);
Assert.False(fp1.IsEquivalent(fp2));
Assert.True(fp2.IsEquivalent(fp1));
fp2.Touch(32);
Assert.True(fp1.IsEquivalent(fp2));
Assert.True(fp2.IsEquivalent(fp1));
fp2.Touch(31);
Assert.True(fp1.IsEquivalent(fp2));
Assert.False(fp2.IsEquivalent(fp1));
fp4.Touch(31);
fp4.Touch(32);
fp4.Touch(33);
Assert.True(fp2.IsEquivalent(fp4));
Assert.False(fp4.IsEquivalent(fp2));
}