本文整理汇总了C#中Fingerprint.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Fingerprint.Get方法的具体用法?C# Fingerprint.Get怎么用?C# Fingerprint.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fingerprint
的用法示例。
在下文中一共展示了Fingerprint.Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestClear
public void TestClear()
{
// Length > 32
Fingerprint fp = new Fingerprint(65);
for (int i = 0; i < 65; ++i)
{
fp.Touch(i);
Assert.True(fp.Get(i));
}
fp.Clear();
for (int i = 0; i < 65; ++i)
{
Assert.False(fp.Get(i));
}
// Length <= 32
var fp2 = new Fingerprint(6);
for (int i = 0; i < 6; ++i)
{
fp2.Touch(i);
Assert.True(fp2.Get(i));
}
fp.Clear();
for (int i = 0; i < 6; ++i)
{
Assert.False(fp.Get(i));
}
}
示例2: 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));
}
示例3: TestCreation
public void TestCreation()
{
var fp1 = new Fingerprint(1);
Assert.AreEqual(1, fp1.Length);
Assert.False(fp1.Get(0));
Fingerprint fp2 = new Fingerprint(33);
Assert.AreEqual(33, fp2.Length);
for (int i = 0; i < 33; ++i)
{
Assert.False(fp2.Get(i));
}
}
示例4: TestCopyCreation
public void TestCopyCreation()
{
Fingerprint fp1 = new Fingerprint(65);
fp1.Touch(32);
Fingerprint fp2 = new Fingerprint(fp1);
Assert.True(fp2.Get(32));
// Ensure that the original block array is not shared
fp1.Touch(64);
Assert.False(fp2.Get(64));
}