public void Add_DuplicatedValues_ShoulBeInAscendingOrder() { var heap = new HeapOverList <int>(); var data = new[] { 5, 8, 6, 3, 1, 5, 8, 6, 9, 9, 2 }.ToList(); data.ForEach(item => heap.Add(item)); heap._storage.Should().BeInAscendingOrder(); }
public void Add_NullValues_ShoulBeInAscendingOrder() { var heap = new HeapOverList <TestDataType>(); var data = new[] { 5, 8, 6, 3, 1, 5, 8, 6, 9, 9, 2 } .Select((n, idx) => idx % 4 == 0 ? default(TestDataType) : new TestDataType { Value = n }) .ToList(); data.ForEach(item => heap.Add(item)); heap._storage.Where(item => item != null) .Should().BeInAscendingOrder(item => item.Value); }