public void AddAndCheck_WhenItemHasBeenAddedBefore_ShouldReturnTrue() { var filter = new BloomFilter <int>(50, 0.02); filter.Add(42); Assert.True(filter.AddAndCheck(42)); }
public Property AddAndCheck_WhenItemHasntBeenAddedBefore_ShouldReturnFalse() { return(Prop.ForAll(Arb.Default.Int32(), testData => { var filter = new BloomFilter <int>(50, 0.02, ByteConverter); return (!filter.AddAndCheck(testData)).ToProperty(); })); }
public Property AddAndCheck_WhenItemHasBeenAddedBefore_ShouldReturnTrue() { return(Prop.ForAll(Arb.Default.Int32(), testData => { var filter = new BloomFilter <int>(50, 0.02); filter.Add(testData); return filter.AddAndCheck(testData).ToProperty(); })); }
public void AddItemsThenCount_BloomFilter() { var count = 0; for (var i = 0; i < ItemsToInsert; i++) { var s = $"string-{i + 1}"; if (!_bloomFilter.AddAndCheck(s)) { count++; } } var x = count; }