Exemple #1
0
        public void getSpecificFrequencyForRangesTest()
        {
            List <int> numlist1 = new List <int> {
                1, 2, 3, 4, 5, 6
            };
            List <int> numlist2 = new List <int> {
                1, 2, 3, 4, 5, 60
            };
            List <int> numlist3 = new List <int> {
                1, 2, 3, 4, 50, 60
            };
            List <int> numlist4 = new List <int> {
                1, 2, 3, 50, 51, 60
            };
            List <List <int> > numlistcollection = new List <List <int> >();

            numlistcollection.Add(numlist1);
            numlistcollection.Add(numlist2);
            numlistcollection.Add(numlist3);
            numlistcollection.Add(numlist4);

            Assert.Equal(4, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 0));
            Assert.Equal(3, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 1));
            Assert.Equal(1, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 2));
            Assert.Equal(1, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 3));
            Assert.Equal(1, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 4));
            Assert.Equal(1, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 5));
            Assert.Equal(1, rangeHandler.getFrequencyOfOccurrence(numlistcollection, 6));
        }
Exemple #2
0
        public void testingThatRangesAreRemovedCorrectly(int drawSize, int drawPool, int result)
        {
            RangeHandler    rangeHandler    = new RangeHandler(drawPool);
            NumberGenerator numberGenerator = new NumberGenerator(drawSize, drawPool);

            numberGenerator.generateList(new List <int>(), 0, 1, numberGenerator.highestStartPoint, false);
            Exclusions rangeExclusions = new Exclusions();

            rangeExclusions.rangeFrequencyExclusions = new int[] { 4, 5 };
            numberGenerator.exclusions = rangeExclusions;
            int rangeToRemove1 = rangeHandler.getFrequencyOfOccurrence(numberGenerator.numberCollection, 4);
            int rangeToRemove2 = rangeHandler.getFrequencyOfOccurrence(numberGenerator.numberCollection, 5);

            numberGenerator.numberCollection = new List <List <int> >();
            numberGenerator.generateList(new List <int>(), 0, 1, numberGenerator.highestStartPoint, true);
            result = result - rangeToRemove1 - rangeToRemove2;
            Assert.Equal(result, numberGenerator.numberCollection.Count);
        }