public void WithEmptySourceWithComparerReturnsDefault() { using var strings = Enumerable.Empty <string>().AsTestingSequence(); var minima = strings.MinBy(s => s.Length, Comparable <int> .DescendingOrderComparer); Assert.That(MoreEnumerable.FirstOrDefault(minima), Is.Null); }
public void WithComparerReturnsMinimum() { using var strings = SampleData.Strings.AsTestingSequence(); var minima = strings.MinBy(s => s.Length, Comparable <int> .DescendingOrderComparer); Assert.That(MoreEnumerable.FirstOrDefault(minima), Is.EqualTo("hello")); }
public void WithEmptySourceReturnsDefault() { using var strings = Enumerable.Empty <string>().AsTestingSequence(); var minima = strings.MinBy(s => s.Length); Assert.That(MoreEnumerable.FirstOrDefault(minima), Is.Null); }
public void ReturnsMinimum() { using var strings = SampleData.Strings.AsTestingSequence(); var minima = strings.MinBy(s => s.Length); Assert.That(MoreEnumerable.FirstOrDefault(minima), Is.EqualTo("ax")); }