public virtual void TestSet() { IntList i = new IntList(); i.Add(1); NUnit.Framework.Assert.AreEqual(1, i.Size()); NUnit.Framework.Assert.AreEqual(1, i.Get(0)); i.Set(0, 5); NUnit.Framework.Assert.AreEqual(5, i.Get(0)); try { i.Set(5, 5); NUnit.Framework.Assert.Fail("accepted set of 5 beyond end of list"); } catch (IndexOutOfRangeException) { NUnit.Framework.Assert.IsTrue(true); } i.Set(1, 2); NUnit.Framework.Assert.AreEqual(2, i.Size()); NUnit.Framework.Assert.AreEqual(2, i.Get(1)); }