public void SplitWhere_EliminateSplitter() { var data = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var split = data.SplitWhere(i => i % 3 == 1, false).ToList(); split[0].Should().BeEquivalentTo(0); split[1].Should().BeEquivalentTo(2, 3); split[2].Should().BeEquivalentTo(5, 6); split[3].Should().BeEquivalentTo(8, 9); }
public void SplitWhere_IncludeSplitter() { var data = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var split = data.SplitWhere(i => i % 3 == 1, true).ToList(); split[0].Should().BeEquivalentTo(0); split[1].Should().BeEquivalentTo(1, 2, 3); split[2].Should().BeEquivalentTo(4, 5, 6); split[3].Should().BeEquivalentTo(7, 8, 9); }