Esempio n. 1
0
 public static T GetRandomItemFromList <T>(IList <T> list)
 {
     if (list == null || list.Count == 0)
     {
         return(default(T));
     }
     return(list[RandomProxy.Next(list.Count)]);
 }
Esempio n. 2
0
        private string FillInRandomDataFromNumber(string format, char symbol = '#')
        {
            var result = format.ToCharArray();

            for (int i = 0; i < result.Length; i++)
            {
                if (result[i] == symbol)
                {
                    result[i] = (char)(RandomProxy.Next(10) + 48);
                }
            }
            return(new string(result));
        }