How much does Linq.Take take?

April 17, 2009 in

I wasn't 100% certain how much the "Take" would take from a list with less elements than the number you want to take. It probably says in the docs, but let me assure you that this test succeeds:

[Test] public void TakeTakesAsMuchAsThereIs() { string[] stuff = {"hi"}; var l = stuff.Take(3).ToList(); Assert.That(l, Has.Count(1)); }

Previous & Next

Scary StructureMap configuration expressions Pt.1Fashion of the week - Building with Rake