public void SynchronisedDoubleEndedQueueCopyToThrowsIfArrayIsNull() { var items = new[] { 1, 2, 3, 4, 5, 6, 7, 8 }; var deque = new SynchronisedDeque <int>(items); Assert.Throws <ArgumentNullException>(() => deque.CopyTo(null, 0)); }
public void SynchronisedDoubleEndedQueueCopyToThrowsIfCountIsGreaterThanArrayLength() { var items = new[] { 1, 2, 3, 4, 5, 6, 7, 8 }; var deque = new SynchronisedDeque <int>(items); var array = new int[5]; Assert.Throws <ArgumentException>(() => deque.CopyTo(array, 0)); }
public void SynchronisedDoubleEndedQueueCopyToThrowsIfArrayIsLessThanZero() { var items = new[] { 1, 2, 3, 4, 5, 6, 7, 8 }; var deque = new SynchronisedDeque <int>(items); var array = new int[10]; Assert.Throws <ArgumentOutOfRangeException>(() => deque.CopyTo(array, -1)); }
public void SynchronisedDoubleEndedQueueCopyToCopiesContentsToArray() { var items = new[] { "1", "2", "3", "4", "5", "6", "7", "8" }; var deque = new SynchronisedDeque <string>(items); var array = new string[8]; deque.CopyTo(array, 0); array.ToList().ForEach(i => Assert.IsNotNull(i)); }