public void ReturnValidDatesWithinTheMinimumAndMaximumYears()
        {
            DateTime date;

            // Create a bunch of dates and if it tries to create an invalid date an exception will be thrown...
            for (int i = 0; i < 3000; i++)
            {
                date = RandomValueProvider.RandomDateTime(
                    RandomValueProvider.RandomInteger(1600, 1900), RandomValueProvider.RandomInteger(1901, 2100));
            }
        }
Example #2
0
        /// <summary>
        /// Shuffles the items.
        /// </summary>
        /// <typeparam name="T">The enumeration type.</typeparam>
        /// <param name="array">The array.</param>
        /// <param name="count">The count.</param>
        /// <returns>A shuffled enumeration.</returns>
        private static IEnumerable <T> ShuffleItems <T>(T[] array, int count)
        {
            for (var n = 0; n < count; n++)
            {
                var k    = RandomValueProvider.RandomInteger(n, array.Length);
                var temp = array[n];
                array[n] = array[k];
                array[k] = temp;
            }

            return(array);
        }