public void Given_Existing_10_Items_GetNewer_Returns_Items_Newer_Than_Given_Oldest_Item() { var items = BuildItems(count: 10); var oldestItem = items.First(); var numberOfItems = items.Count - 1; this.Items.InsertBatch(items); var storage = new StreamStorage(ConnectionString, DatabaseName); var gotItems = storage.GetNewer(oldestItem, items.Count).ToList(); Assert.AreEqual(numberOfItems, gotItems.Count); }
public void Given_Existing_10_Items_GetNewer_Returns_Them_Sorted_By_Date_Descending() { var noLimit = int.MaxValue; var items = BuildItems(count: 10); var oldestItem = items.First(); this.Items.InsertBatch(items); var storage = new StreamStorage(ConnectionString, DatabaseName); var gotItems = storage.GetNewer(oldestItem, noLimit).ToList(); Assert.That(gotItems, Is.Ordered.Descending.By("Published")); }