Example #1
0
        public void DatabaseElementsAreRemovedInLIFOOrder()
        {
            var db = new App.Database(1, 2, 3);

            var lastElement = db.Fetch()[db.LastIndex];

            db.Remove();

            var lastElementAfterRemoval = db.Fetch()[db.LastIndex];

            Assert.That(lastElement, Is.Not.EqualTo(lastElementAfterRemoval), "The removal is either not in LIFO order or the element had not been removed");
        }
Example #2
0
        public void DatabaseEmptyArrayRemovalResultsInIOPException()
        {
            var db = new App.Database();

            Assert.That(() => db.Remove(), Throws.InvalidOperationException);
        }