Exemplo n.º 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)));
        }
Exemplo n.º 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());
        }
Exemplo n.º 3
0
        public static EnumT SelectFrom <EnumT>()
        {
            Array values = Enum.GetValues(typeof(EnumT));

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