public void Select_SourceIsArray_ElementAt()
{
var source = new[] { 1, 2, 3, 4 }.Select(i => i * 2);
for (int i = 0; i != 4; ++i)
Assert.Equal(i * 2 + 2, source.ElementAt(i));
Assert.Throws<ArgumentOutOfRangeException>("index", () => source.ElementAt(-1));
Assert.Throws<ArgumentOutOfRangeException>("index", () => source.ElementAt(4));
Assert.Throws<ArgumentOutOfRangeException>("index", () => source.ElementAt(40));
Assert.Equal(6, source.Skip(1).ElementAt(1));
Assert.Throws<ArgumentOutOfRangeException>("index", () => source.Skip(2).ElementAt(9));
}