GetNewer() 공개 메소드

public GetNewer ( Item item, int limit ) : IEnumerable
item Item
limit int
리턴 IEnumerable
예제 #1
0
        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);
        }
예제 #2
0
        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"));
        }