public void AccessNthItem()
 {
     mruList = new MruList {
         "Item1", "Item2", "Item3", "Item4"
     };
     Assert.AreEqual("Item2", mruList[2]);
 }
        public void InvalidCapacityShouldThrowOutOfRangeException()
        {
            // ReSharper disable once UnusedVariable
            var ex = Assert.Throws <ArgumentOutOfRangeException>(() => { var _ = new MruList(-1); });

            Assert.AreEqual("capacity", ex.ParamName);
        }
 public void MruListAtCapacityDropsLeastRecentlyUsedItems()
 {
     mruList = new MruList(3)
     {
         "Item1", "Item2", "Item3", "Item4"
     };
     CollectionAssert.AreEqual(new[] { "Item4", "Item3", "Item2" }, mruList);
 }
 public void MruListWithCapacityOneHoldsMostRecentItem()
 {
     mruList = new MruList(1)
     {
         "Item1", "Item2"
     };
     CollectionAssert.AreEqual(new[] { "Item2" }, mruList);
 }
 public void MruListWithCapacityZeroHoldsNoItems()
 {
     mruList = new MruList(0)
     {
         "Item1", "Item2", "Item3", "Item4"
     };
     CollectionAssert.IsEmpty(mruList);
 }
 public void Setup()
 {
     mruList = new MruList();
 }