private IEnumerable <List <string> > GetRepeatedString(int n, FastRandom rand)
 {
     for (int i = 0; i < n; i++)
     {
         yield return(Enumerable.Repeat(StringValueGenerator.GetRandomString(rand.Next(1, 50), rand), 3).ToList());
     }
 }
Example #2
0
        // https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
        // characters used
        // 9 \t
        // 10 \n
        // 32 space
        // 33-126 other printable characters

        /// <summary>
        /// length is inclusive minLength and inclusive maxLength
        /// </summary>
        public static IEnumerable <string> GetRandomStrings(int n, int minLength, int maxLengthInclusive, FastRandom rand)
        {
            for (int i = 0; i < n; i++)
            {
                yield return(StringValueGenerator.GetRandomString(rand.Next(minLength, maxLengthInclusive + 1), rand)); // +1 , because rand.Next is exclusive upperBound
            }
        }
        private List <List <string> > GetPermutationsWithTwoEmptyStrings(int n, FastRandom rand)
        {
            List <List <string> > strings = new List <List <string> >();

            for (int i = 0; i < n; i++)
            {
                int    length = rand.Next(1, 50);
                string value  = StringValueGenerator.GetRandomString(length, rand);
                strings.AddRange(GetDistinctPermutations(new string[] { String.Empty, String.Empty, value }));
            }
            return(strings);
        }
        private IEnumerable <List <string> > GetStringsInSortedLengthOrder(int n, FastRandom rand)
        {
            for (int i = 0; i < n; i++)
            {
                List <string> strings = new List <string>(3)
                {
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand),
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand),
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand)
                };

                yield return(strings.OrderBy(x => x.Length).ToList());
            }
        }
        private IEnumerable <List <string> > GetStrings(int n, FastRandom rand)
        {
            for (int i = 0; i < n; i++)
            {
                List <string> strings = new List <string>(3)
                {
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand),
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand),
                    StringValueGenerator.GetRandomString(rand.Next(0, 50), rand)
                };

                yield return(strings);
            }
        }