public void Combs_are_SQL_Ordered() { var initial = Range.Array(50, n => { SystemUtil.Sleep(20.Milliseconds()); return(GuidUtil.NewComb()); }); var copy = new List <Guid>(initial); copy.Sort(new SqlServerGuidComparer()); CollectionAssert.AreEqual(initial, copy); }
public void Sortables_are_string_ordered() { var initial = Range.Array(1000, n => { SystemUtil.Sleep(20.Milliseconds()); return(GuidUtil.NewStringSortable().ToString()); }); var copy = new List <String>(initial); copy.Sort(); CollectionAssert.AreEqual(initial, copy); }
public void Test_Sleep() { SystemUtil.Sleep(TimeSpan.FromMilliseconds(0)); var flag = false; SystemUtil.SetSleep(s => { Assert.AreEqual(1.Seconds(), s); flag = true; }); SystemUtil.Sleep(1.Seconds()); Assert.IsTrue(flag); }