Esempio n. 1
0
        public void ASeqICollCopyToCopiesToIndexPositive()
        {
            ICollection ic = new Cons(1, new Cons(2, new Cons(3, null)));
            int[] arr = new int[4];
            ic.CopyTo(arr, 1);

            Expect(arr[0], EqualTo(0));
            Expect(arr[1], EqualTo(1));
            Expect(arr[2], EqualTo(2));
            Expect(arr[3], EqualTo(3));
        }
Esempio n. 2
0
 public void ASeqICollCopyToFailsOnNegativeIndex()
 {
     ICollection ic = new Cons(1, new Cons(2, new Cons(3, null)));
     Array arr = new object[10];
     ic.CopyTo(arr, -1);
 }
Esempio n. 3
0
 public void ASeqICollCopyToFailsOnMultidimArray()
 {
     ICollection ic = new Cons(1, new Cons(2, new Cons(3, null)));
     Array arr = Array.CreateInstance(typeof(int), 4, 4);
     ic.CopyTo(arr, 0);
 }
Esempio n. 4
0
 public void ASeqICollCopyToFailsOnInsufficientSpace2()
 {
     ICollection ic = new Cons(1, new Cons(2, new Cons(3, null)));
     Array arr = new object[10];
     ic.CopyTo(arr, 8);
 }
Esempio n. 5
0
 public void ASeqICollCopyToFailsOnNullArray()
 {
     ICollection ic = new Cons(1, null);
     ic.CopyTo(null, 0);
 }