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)); }
public void ASeqICollCopyToFailsOnNegativeIndex() { ICollection ic = new Cons(1, new Cons(2, new Cons(3, null))); Array arr = new object[10]; ic.CopyTo(arr, -1); }
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); }
public void ASeqICollCopyToFailsOnInsufficientSpace2() { ICollection ic = new Cons(1, new Cons(2, new Cons(3, null))); Array arr = new object[10]; ic.CopyTo(arr, 8); }
public void ASeqICollCopyToFailsOnNullArray() { ICollection ic = new Cons(1, null); ic.CopyTo(null, 0); }