System.Collections.Tests.QueueTests.CopyTo_Invalid C# (CSharp) Method

CopyTo_Invalid() private method

private CopyTo_Invalid ( ) : void
return void
        public static void CopyTo_Invalid()
        {
            Queue queue1 = Helpers.CreateIntQueue(100);
            Helpers.PerformActionOnAllQueueWrappers(queue1, queue2 =>
            {
                Assert.Throws<ArgumentNullException>("array", () => queue2.CopyTo(null, 0)); // Array is null
                Assert.Throws<ArgumentException>(() => queue2.CopyTo(new object[150, 150], 0)); // Array is multidimensional

                Assert.Throws<ArgumentOutOfRangeException>("index", () => queue2.CopyTo(new object[150], -1)); // Index < 0

                Assert.Throws<ArgumentException>(null, () => queue2.CopyTo(new object[150], 51)); // Index + queue.Count > array.Length
            });
        }