public void GivenLazyListWhenCopyToShouldLoad() { _lazyLoadResolverMock.Setup(x => x.Resolve(It.IsAny <LazyLoadParameter>())) .Returns(new[] { new Stub(), new Stub() }) .Verifiable(); var lazyList = new LazyList <Stub>(_lazyLoadResolverMock.Object); var list = new Stub[2]; lazyList.CopyTo(list, 0); list.Should().HaveCount(2); _lazyLoadResolverMock.VerifyAll(); }
public void CopyToShouldCopyAllElements() { MockEnumerable source = new MockEnumerable(3); var list = new LazyList <int>(source); var copy = new int[4]; list.CopyTo(copy, 1); Assert.AreEqual(0, copy[1]); Assert.AreEqual(1, copy[2]); Assert.AreEqual(2, copy[3]); Assert.AreEqual(3, source.TotalElementsReturned, "Should have read exactly the necessary number of elements."); }
/// <inheritdoc/> public void CopyTo(Local[] array, int arrayIndex) { locals.CopyTo(array, arrayIndex); }
public void CopyTo(CodedValue[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(ExerciseSegment[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(VersionInformation[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(string[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(Blob[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(ItemFilter[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(StructuredNameValue[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }
public void CopyTo(object[] array, int arrayIndex) { m_items.CopyTo(array, arrayIndex); }