How much does Linq.Take take?
17.04.2009 - 14:23 (2 years, 9 months, 2 weeks, 5 days ago)
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));
}