public void MergeByOrderedDescendingByFirstItemIsLargest() { const int expectedFirst = 43; var a = new MergeByTestItem[] { new MergeByTestItem { Id = 40 }, new MergeByTestItem { Id = 19 }, new MergeByTestItem { Id = 13 }, new MergeByTestItem { Id = 8 }, new MergeByTestItem { Id = 1 }, }; var b = new MergeByTestItem[] { new MergeByTestItem { Id = 41 }, new MergeByTestItem { Id = 12 }, new MergeByTestItem { Id = 4 }, new MergeByTestItem { Id = 0 } }; var c = new MergeByTestItem[] { new MergeByTestItem { Id = 43 }, new MergeByTestItem { Id = 37 }, new MergeByTestItem { Id = 30 }, new MergeByTestItem { Id = 22 }, new MergeByTestItem { Id = 3 }, }; var combined = new MergeByTestItem[][] { a, b, c }; var mergeOrdered = combined.MergeOrderedByDescending(m => m.Id); Assert.AreEqual(expectedFirst, mergeOrdered.First().Id); }
public void MergeByOrderedByDescendingCombinesSequences() { const int expectedCount = 14; var a = new MergeByTestItem[] { new MergeByTestItem { Id = 40 }, new MergeByTestItem { Id = 19 }, new MergeByTestItem { Id = 13 }, new MergeByTestItem { Id = 8 }, new MergeByTestItem { Id = 1 }, }; var b = new MergeByTestItem[] { new MergeByTestItem { Id = 41 }, new MergeByTestItem { Id = 12 }, new MergeByTestItem { Id = 4 }, new MergeByTestItem { Id = 0 } }; var c = new MergeByTestItem[] { new MergeByTestItem { Id = 43 }, new MergeByTestItem { Id = 37 }, new MergeByTestItem { Id = 30 }, new MergeByTestItem { Id = 22 }, new MergeByTestItem { Id = 3 }, }; var combined = new MergeByTestItem[][] { a, b, c }; var mergeOrdered = combined.MergeOrderedByDescending(m => m.Id); Assert.AreEqual(expectedCount, mergeOrdered.Count()); }