Ejemplo n.º 1
0
        public void Can_Create_TimeStamps_Within_Short_Range()
        {
            var timestamps = new List <long>();

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

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

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

            //All dates should be less than today's date one year from now
            Assert.IsTrue(timestamps.All(x => x <= DateTimes.GetTimeStamp(DateTime.Now.AddHours(2))));

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