Ejemplo n.º 1
0
        public void Can_Spawn_DateTimes_Within_Short_Range()
        {
            var dateTimes = new List <DateTime>();

            for (var i = 0; i < 1000; i++)
            {
                dateTimes.Add(DateTimes.GetDateTime(DateTime.Now, DateTime.Now.AddHours(2)));
            }

            //Should not have any dates below the current date
            Assert.IsFalse(dateTimes.Any(x => x < DateTime.Now));

            //All dates should be greater than the current date
            Assert.IsTrue(dateTimes.All(x => x >= DateTime.Now));

            //All dates should be less than today's date one year from now
            Assert.IsTrue(dateTimes.All(x => x <= DateTime.Now.AddYears(1)));

            //All dates should not be the same
            Assert.IsFalse(dateTimes.All(x => x == dateTimes[0]));
        }
Ejemplo n.º 2
0
 public override DateTime Generate()
 {
     return(DateTimes.GetDateTime(Min(), Max()));
 }
Ejemplo n.º 3
0
 public override DateTime Generate()
 {
     return(DateTimes.GetDateTime(From, To));
 }