Exemplo n.º 1
0
        public void CopyToAtNonZeroArrayIndex()
        {
            // Setup
            var sequence = InitializeSequence();
            var set      = new TestSet <SimpleType>(sequence);
            var array    = new SimpleType[5];

            // Execute
            set.CopyTo(array, 1);

            // Assert
            Assert.IsNull(array[0]);
            Assert.IsTrue(array.Skip(1).All(i => i != null));
            Assert.AreSame(sequence[0], array[1]);
            Assert.AreSame(sequence[1], array[2]);
            Assert.AreSame(sequence[2], array[3]);
            Assert.AreSame(sequence[3], array[4]);
        }
Exemplo n.º 2
0
        public void CopyToAtNonZeroArrayIndex()
        {
            // Setup
            var sequence = InitializeSequence();
            var set = new TestSet<SimpleType>(sequence);
            var array = new SimpleType[5];

            // Execute
            set.CopyTo(array, 1);

            // Assert
            Assert.IsNull(array[0]);
            Assert.IsTrue(array.Skip(1).All(i => i != null));
            Assert.AreSame(sequence[0], array[1]);
            Assert.AreSame(sequence[1], array[2]);
            Assert.AreSame(sequence[2], array[3]);
            Assert.AreSame(sequence[3], array[4]);
        }