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])); }
public override long Generate() { return(DateTimes.GetTimeStamp(Min(), Max())); }
public override long Generate() { return(DateTimes.GetTimeStamp(From, To)); }