Ejemplo n.º 1
0
 public void PrometheusChainedHashSetContains()
 {
     foreach (var item in _collection)
     {
         _chainedHashSet.Contains(item);
     }
 }
Ejemplo n.º 2
0
        public void Calculate_SumOnTestData_Returns22()
        {
            List <long> values     = SumCalculationTestDataBuilder.CreateTestData(Resources.WeekSixTestInput);
            var         uniqueSums = new ChainedHashSet <long>();
            var         valuesSet  = new ChainedHashSet <long>(values);

            List <int> range = new List <int>();

            for (int i = -1000; i <= 1000; i++)
            {
                range.Add(i);
            }

            for (int i = 0; i < values.Count; i++)
            {
                for (int j = 0; j < range.Count; j++)
                {
                    var x = range[j] - values[i];
                    if (valuesSet.Contains(x))
                    {
                        uniqueSums.Add(range[j]);
                    }
                }
            }

            Assert.That(uniqueSums.Count, Is.EqualTo(22));
        }