Beispiel #1
0
        public void CopyFrom()
        {
            var source = new CloneableType[] { "a", "b", "c", "d" };

            Assert.Throws <NotSupportedException>(() => _readOnly.CopyFrom(source, 1));
            Assert.Throws <ArgumentException>(() => _array.CopyFrom(source, 3));

            _array.CopyFrom(source, 1);
            Assert.AreEqual(new CloneableType("one"), _array[0]);
            Assert.AreEqual(new CloneableType("a"), _array[1]);
            Assert.AreEqual(new CloneableType("b"), _array[2]);
            Assert.AreEqual(new CloneableType("c"), _array[3]);
            Assert.AreEqual(new CloneableType("d"), _array[4]);
            Assert.AreEqual(new CloneableType("six"), _array[5]);
        }