本文整理汇总了C#中Fingerprint.Wipe方法的典型用法代码示例。如果您正苦于以下问题:C# Fingerprint.Wipe方法的具体用法?C# Fingerprint.Wipe怎么用?C# Fingerprint.Wipe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fingerprint
的用法示例。
在下文中一共展示了Fingerprint.Wipe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAccessors
public void TestAccessors()
{
var fp = new Fingerprint(33);
Assert.Throws(typeof(IndexOutOfRangeException),
() => { fp.Get(-1); });
Assert.Throws(typeof(IndexOutOfRangeException),
() => { fp.Get(33); });
Assert.False(fp.Get(31));
fp.Touch(31);
Assert.True(fp.Get(31));
fp.Wipe(31);
Assert.False(fp.Get(31));
Assert.False(fp.Get(32));
fp.Touch(32);
Assert.True(fp.Get(32));
fp.Wipe(32);
Assert.False(fp.Get(32));
}
示例2: TestCapoing
public void TestCapoing()
{
var fp = new Fingerprint(8);
fp.Touch(2);
fp.Touch(4);
var window = new Capo<bool>(fp, 3);
Assert.False(window[0]);
Assert.True(window[1]);
Assert.False(window[2]);
fp.Wipe(4);
Assert.False(window[1]);
// Out-of-range indexing never throws
Assert.False(window[-8]);
Assert.False(window[8]);
}
示例3: TestComparison
public void TestComparison()
{
Fingerprint fp1 = new Fingerprint(65);
Fingerprint fp2 = new Fingerprint(65);
Fingerprint fp3 = new Fingerprint(64);
Fingerprint fp4 = new Fingerprint(66);
// Length first
Assert.Less(fp3.CompareTo(fp1), 0);
Assert.Greater(fp1.CompareTo(fp3), 0);
fp3.Touch(2);
Assert.Less(fp3.CompareTo(fp1), 0);
Assert.Greater(fp1.CompareTo(fp3), 0);
Assert.Greater(fp4.CompareTo(fp2), 0);
Assert.Less(fp2.CompareTo(fp4), 0);
fp2.Touch(64);
Assert.Greater(fp4.CompareTo(fp2), 0);
Assert.Less(fp2.CompareTo(fp4), 0);
fp2.Wipe(64);
// Bits second
Assert.AreEqual(0, fp1.CompareTo(fp2));
fp1.Touch(31);
Assert.Greater(fp1.CompareTo(fp2), 0);
Assert.Less(fp2.CompareTo(fp1), 0);
fp2.Touch(32);
Assert.Less(fp1.CompareTo(fp2), 0);
Assert.Greater(fp2.CompareTo(fp1), 0);
fp1.Touch(32);
Assert.Greater(fp1.CompareTo(fp2), 0);
Assert.Less(fp2.CompareTo(fp1), 0);
fp2.Touch(31);
Assert.AreEqual(0, fp1.CompareTo(fp2));
Assert.AreEqual(0, fp2.CompareTo(fp1));
fp2.Touch(64);
Assert.Less(fp1.CompareTo(fp2), 0);
Assert.Greater(fp2.CompareTo(fp1), 0);
}