public void WithComparerReturnsMinimumPerComparer() { using var strings = SampleData.Strings.AsTestingSequence(); var minima = strings.MinBy(s => s.Length, Comparable <int> .DescendingOrderComparer); Assert.That(MoreEnumerable.Last(minima), Is.EqualTo("world")); }
public void ReturnsMinimum() { using var strings = SampleData.Strings.AsTestingSequence(); var minima = strings.MinBy(s => s.Length); Assert.That(MoreEnumerable.Last(minima), Is.EqualTo("az")); }
public void WithEmptySourceWithComparerThrows() { using var strings = Enumerable.Empty <string>().AsTestingSequence(); Assert.Throws <InvalidOperationException>(() => MoreEnumerable.Last(strings.MinBy(s => s.Length, Comparable <int> .DescendingOrderComparer))); }
public void WithEmptySourceThrows() { using var strings = Enumerable.Empty <string>().AsTestingSequence(); Assert.Throws <InvalidOperationException>(() => MoreEnumerable.Last(strings.MinBy(s => s.Length))); }