Beispiel #1
0
 public static string Email()
 {
     if (NumberFaker.Number(5) == 2)
     {
         return(NameFaker.FirstName().ToLower() + StringFaker.Numeric(2) + "@" + Domain());
     }
     else
     {
         return(NameFaker.FirstName().ToLower() + "@" + Domain());
     }
 }
Beispiel #2
0
        public static string SelectFrom(int numElements, string characters)
        {
            var returned = new StringBuilder();
            var length   = characters.Length;

            while (numElements > 0)
            {
                returned.Append(characters[NumberFaker.Number(length)]);
                numElements--;
            }

            return(returned.ToString());
        }
Beispiel #3
0
        public static T SelectFrom <T>(params T[] array)
        {
            var index = NumberFaker.Number(0, array.Length);

            return((T)array.GetValue(index));
        }
Beispiel #4
0
 static public int StreetNumber()
 {
     return(NumberFaker.Number(1, 50));
 }
Beispiel #5
0
 public static bool Boolean()
 {
     return(NumberFaker.Number(2) == 1);
 }
Beispiel #6
0
        public static EnumT SelectFrom <EnumT>()
        {
            var enumValues = System.Enum.GetValues(typeof(EnumT));

            return((EnumT)enumValues.GetValue(NumberFaker.Number(enumValues.Length)));
        }
Beispiel #7
0
        public static DateTime DateTime(DateTime from, DateTime to)
        {
            var timeSpan = to - from;

            return(from.AddDays((double)NumberFaker.Number(1, (int)timeSpan.TotalDays - 1)).AddSeconds(NumberFaker.Number(1, 86400)));
        }