public void ReturnsCorrectIndex() { var index = mockCollection.IndexOf(itemId: 2); var expected = new SectionedIndex(1, 2); index.Should().Be(expected); }
public void IgnoresUpdatesWhenTheKeyDoesNotExist() { intCollection.InsertItem(1); intCollection.UpdateItem(2, 3); var indexOfItemThree = intCollection.IndexOf(3); indexOfItemThree.Should().BeNull(); }
public void ReturnsCorrectIndex() { List <int> list = new List <int> { 40, 70, 8, 3, 1, 2 }; intCollection.ReplaceWith(list); var index = intCollection.IndexOf(70); var expected = new SectionedIndex(1, 1); index.Should().Be(expected); }
public void ReturnsNullIfEmpty() { var emptyCollection = new GroupedOrderedCollection <MockItem>(d => d.Id, d => d.Start.TimeOfDay, d => d.Start.Date, isDescending: true); var index = emptyCollection.IndexOf(itemId: 0); index.Should().BeNull(); }