Exemple #1
0
        public void ClearingScalabeBloomFilterResetsEverything()
        {
            ScalableBloomFilter <int> filter = new ScalableBloomFilter <int>(0.9, 1000, 0.001);

            //Add a load of numbers
            for (int i = 0; i < 100; i++)
            {
                filter.Add(i);
                Assert.IsTrue(filter.Contains(i));
            }
            Assert.AreEqual(100, filter.Count);

            filter.Clear();
            Assert.AreEqual(0, filter.Count);

            //Add them again
            for (int i = 0; i < 100; i++)
            {
                filter.Add(i);
                Assert.IsTrue(filter.Contains(i));
            }
            Assert.AreEqual(100, filter.Count);
        }
        public void ClearingScalabeBloomFilterResetsEverything()
        {
            ScalableBloomFilter<int> filter = new ScalableBloomFilter<int>(0.9, 1000, 0.001);

            //Add a load of numbers
            for (int i = 0; i < 100; i++)
            {
                filter.Add(i);
                Assert.IsTrue(filter.Contains(i));
            }
            Assert.AreEqual(100, filter.Count);

            filter.Clear();
            Assert.AreEqual(0, filter.Count);

            //Add them again
            for (int i = 0; i < 100; i++)
            {
                filter.Add(i);
                Assert.IsTrue(filter.Contains(i));
            }
            Assert.AreEqual(100, filter.Count);
        }