Exemple #1
0
        public void TestBloomEstimatedFillRatio()
        {
            var f = new BloomFilter(100, 0.5);

            for (uint i = 0; i < 100; i++)
            {
                f.Add(Encoding.ASCII.GetBytes(i.ToString()));
            }

            var ratio = f.EstimatedFillRatio();

            if (ratio > 0.5)
            {
                Assert.Fail("Expected less than or equal to 0.5, got {0}", ratio);
            }
        }