public void FirstLastTest() { var master = new SortSet <int, int>(0.25, 32); for (var i = 0; i < 65536; i++) { master.Add(i, i); } Assert.AreEqual(0, master.First()); Assert.AreEqual(65535, master.Last()); for (var i = 0; i < 65536; i++) { Assert.AreEqual(i, master.First()); Assert.AreEqual(i, master.Shift()); } Assert.AreEqual(0, master.Count); master = new SortSet <int, int>(0.25, 32); for (var i = 0; i < 65536; i++) { master.Add(i, i); } for (var i = 0; i < 65536; i++) { Assert.AreEqual(65535 - i, master.Last()); Assert.AreEqual(65535 - i, master.Pop()); } }
public void FirstEmptySortSet() { var master = new SortSet <int, int>(0.25, 32); ExceptionAssert.Throws <InvalidOperationException>(() => { master.First(); }); }
public void BoundFirstTest() { var master = new SortSet <int, int>(0.25, 32); ExceptionAssert.DoesNotThrow(() => { master.First(); }); }