Example #1
0
        public static DateTime DateTime(DateTime from, DateTime to)
        {
            TimeSpan timeSpan = to - from;
            DateTime dateTime = from.AddDays((double)NumberFaker.Number(1, (int)timeSpan.TotalDays - 1));

            return(dateTime.AddSeconds((double)NumberFaker.Number(1, 86400)));
        }
Example #2
0
        public static string SelectFrom(int numElements, string characters)
        {
            StringBuilder stringBuilder = new StringBuilder();
            int           length        = characters.Length;

            while (numElements > 0)
            {
                stringBuilder.Append(characters[NumberFaker.Number(length)]);
                numElements--;
            }
            return(stringBuilder.ToString());
        }
Example #3
0
        public static EnumT SelectFrom <EnumT>()
        {
            Array values = Enum.GetValues(typeof(EnumT));

            return((EnumT)values.GetValue(NumberFaker.Number(values.Length)));
        }