public void CopyTo_ThrowsArgumentExceptionIfSpaceDesignedForCollectionInArrayIsShort() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); Assert.Throws <ArgumentException>(() => target.CopyTo(array, 4)); }
public void CopyTo_ThrowsArgumentOutOfRangeExceptionIfIndexIsLessThenZero() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); Assert.Throws <ArgumentOutOfRangeException>(() => target.CopyTo(array, -4)); }
public void CopyTo_CopiesElementsToArray() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); target.CopyTo(array, 1); Assert.Null(array[0]); Assert.Same(_tags[0], array[1]); Assert.Same(_tags[1], array[2]); Assert.Same(_tags[2], array[3]); Assert.Null(array[4]); }
public void CopyTo_ThrowsArgumentOutOfRangeExceptionIfIndexIsLessThenZero() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); Assert.Throws<ArgumentOutOfRangeException>(() => target.CopyTo(array, -4)); }
public void CopyTo_ThrowsArgumentNullExceptionIfArrayIsNull() { TagsCollection target = new TagsCollection(_tags); Assert.Throws<ArgumentNullException>(() => target.CopyTo(null, 0)); }
public void CopyTo_ThrowsArgumentExceptionIfSpaceDesignedForCollectionInArrayIsShort() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); Assert.Throws<ArgumentException>(() => target.CopyTo(array, 4)); }
public void CopyTo_CopiesElementsToArray() { Tag[] array = new Tag[5]; TagsCollection target = new TagsCollection(_tags); target.CopyTo(array, 1); Assert.Null(array[0]); Assert.Same(_tags[0], array[1]); Assert.Same(_tags[1], array[2]); Assert.Same(_tags[2], array[3]); Assert.Null(array[4]); }
public void CopyTo_ThrowsArgumentNullExceptionIfArrayIsNull() { TagsCollection target = new TagsCollection(_tags); Assert.Throws <ArgumentNullException>(() => target.CopyTo(null, 0)); }