/// <summary> /// Dequeues head from hashqueue. /// </summary> public T Dequeue() { Ex.ThrowIfEmpty(IsEmpty(), "HashQueue is empty."); var x = dq.Dequeue(); DeleteFromMap(x); return(x); }
public void dequeue_whenPopulated(IDeque <SimpleLinkedValue> deque) { SimpleLinkedValue first = deque.Peek(); Assert.That(deque.Dequeue(), Is.SameAs(first)); Assert.That(deque, HasCount((int)Capacity() - 1)); Assert.That(deque.Contains(first), Is.False); }
private void CheckDeque(IDeque <Type> c) { builder.ExpectThat(c.Peek(), Is.Null); builder.ExpectException <InvalidOperationException> (() => c.Dequeue()); if (c.ToArray() != null) { builder.ExpectThat(c.ToArray().Length, Is.EqualTo(0)); } builder.ExpectThat(c.GetEnumerator().MoveNext(), Is.False); builder.ExpectThat(c.GetDescendingEnumerator().MoveNext(), Is.False); }
public void dequeue_toEmpty(IDeque <SimpleLinkedValue> deque) { SimpleLinkedValue value; while (deque.Peek() != null) { value = deque.Dequeue(); Assert.That(deque.Contains(value), Is.False); } Assert.That(deque, emptyCollection <SimpleLinkedValue>()); }
/// <inheritdoc /> public T Dequeue() { return(_deque.Dequeue()); }
public void dequeue_whenEmpty(IDeque <SimpleLinkedValue> deque) { Assert.Throws <InvalidOperationException> (new TestDelegate(() => { deque.Dequeue(); })); }