public void ReturnFiveWhenWeRetrievedFirstIndex() { RecentlyUsedList<int> ob = new RecentlyUsedList<int>(2); ob.MyInsert(3); ob.MyInsert(5); Assert.AreEqual(5, ob[0]); Assert.AreEqual(3, ob[1]); }
public void ReturnOneWhenWeRetrievedSecondIndex() { RecentlyUsedList<int> ob = new RecentlyUsedList<int>(2); ob.MyInsert(1); ob.MyInsert(2); ob.MyInsert(1); ob.MyInsert(2); Assert.AreEqual(2, ob[0]); Assert.AreEqual(1, ob[1]); }
public void ReturnThreeWhenFirstIndexIsRetrieved() { RecentlyUsedList<int> ob = new RecentlyUsedList<int>(2); ob.MyInsert(1); ob.MyInsert(2); ob.MyInsert(3); Assert.AreEqual(3, ob[0]); Assert.AreEqual(2, ob[1]); // Assert.AreEqual(1, ob[2]); }
public void ReturnGarimaWhenWeRetrievedFirstIndex() { RecentlyUsedList<string> ob = new RecentlyUsedList<string>(1); ob.MyInsert("Garima"); Assert.AreEqual("Garima", ob[0]); }
public void ThrowArgumentOutOfRangeExceptionWhenInvalidIndexIsRetrievedWithStrings() { RecentlyUsedList<string> ob = new RecentlyUsedList<string>(2); ob.MyInsert("Garima"); ob.MyInsert("Bhatia"); string result = ob[2]; }
public void ThrowArgumentOutOfRangeExceptionWhenInvalidIndexIsRetrieved() { RecentlyUsedList<Employee> ob = new RecentlyUsedList<Employee>(2); Employee e1 = new Employee(); Employee e2 = new Employee(); Employee e3 = new Employee(); ob.MyInsert(e1); ob.MyInsert(e2); ob.MyInsert(e3); Assert.AreEqual(e3, ob[0]); Assert.AreEqual(e2, ob[1]); Assert.AreEqual(e1, ob[2]); }
public void ReturnETwoWhenFirstIndexIsRetrieved() { RecentlyUsedList<Employee> ob = new RecentlyUsedList<Employee>(2); Employee e1 = new Employee(); Employee e2 = new Employee(); ob.MyInsert(e1); ob.MyInsert(e2); Assert.AreEqual(e2, ob[0]); Assert.AreEqual(e1, ob[1]); }
public void ReturnABCWhenFirstIndexIsRetrieved() { RecentlyUsedList<string> ob = new RecentlyUsedList<string>(2); ob.MyInsert("Garima"); ob.MyInsert("Bhatia"); ob.MyInsert("abc"); Assert.AreEqual("abc", ob[0]); }