GetLatest() public method

public GetLatest ( ItemType type, System.DateTime fromDate, System.DateTime toDate, int limit ) : IEnumerable
type ItemType
fromDate System.DateTime
toDate System.DateTime
limit int
return IEnumerable
        public void Given_Existing_10_Items_GetLatest_Returns_Limited_Number_Of_5_Items()
        {
            var limit = 5;
            var items = BuildItems(count: 10);
            this.Items.InsertBatch(items);

            var storage = new StreamStorage(ConnectionString, DatabaseName);

            var gotItems = storage.GetLatest(limit).ToList();

            Assert.AreEqual(limit, gotItems.Count);
        }
        public void Given_Existing_10_Items_GetLatest_Returns_All_10_Items()
        {
            var noLimit = int.MaxValue;
            var items = BuildItems(count: 10);
            this.Items.InsertBatch(items);

            var storage = new StreamStorage(ConnectionString, DatabaseName);

            var gotItems = storage.GetLatest(noLimit).ToList();

            Assert.That(items.Count, Is.EqualTo(gotItems.Count));
        }
        public void Given_Existing_10_Items_GetLatest_Returns_Them_Sorted_By_Date_Descending()
        {
            var noLimit = int.MaxValue;
            var items = BuildItems(count: 10);
            this.Items.InsertBatch(items);

            var storage = new StreamStorage(ConnectionString, DatabaseName);

            var gotItems = storage.GetLatest(noLimit).ToList();

            Assert.That(gotItems, Is.Ordered.Descending.By("Published"));
        }