public void SizeOnFullSet() { var queue = new BoundedFifoQueue <int>(); queue.Enqueue(4); Assert.That(() => queue.Size(), Is.EqualTo(1)); }
public void IsEmptyOnFullSet() { var queue = new BoundedFifoQueue <int>(); queue.Enqueue(4); Assert.That(() => queue.IsEmpty(), Is.False); }
public void CanAssignThreshold(int threshold) { var queue = new BoundedFifoQueue <int>(threshold); for (var i = 0; i < threshold; i++) { queue.Enqueue(i); } Assert.That(() => queue.Enqueue(4), Throws.InstanceOf <IndexOutOfRangeException>()); }
public void DefaultThresholdIs10() { var queue = new BoundedFifoQueue <int>(); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); queue.Enqueue(4); Assert.That(() => queue.Enqueue(4), Throws.InstanceOf <IndexOutOfRangeException>()); }
public void SizeOnEmptySet() { var queue = new BoundedFifoQueue <int>(); Assert.That(() => queue.Size(), Is.EqualTo(0)); }
public void DequeueOnEmptySet() { var queue = new BoundedFifoQueue <int>(); Assert.That(() => queue.Dequeue(), Throws.InstanceOf <ArgumentOutOfRangeException>()); }
public void IsEmptyOnEmptySet() { var queue = new BoundedFifoQueue <int>(); Assert.That(() => queue.IsEmpty(), Is.True); }