public virtual void TestGetByIndex() { Collection4 c = new Collection4(); c.Add("one"); c.Add("two"); Assert.AreEqual("one", c.Get(0)); Assert.AreEqual("two", c.Get(1)); AssertIllegalIndex(c, -1); AssertIllegalIndex(c, 2); }
private void AssertContainsNull(Collection4 c) { Assert.IsTrue(c.Contains(null)); Assert.IsNull(c.Get(null)); int size = c.Size(); c.Ensure(null); Assert.AreEqual(size, c.Size()); }
private void AssertNotContainsNull(Collection4 c) { Assert.IsFalse(c.Contains(null)); Assert.IsNull(c.Get(null)); var size = c.Size(); c.Ensure(null); Assert.AreEqual(size + 1, c.Size()); c.Remove(null); Assert.AreEqual(size, c.Size()); }
/// <exception cref="System.Exception"></exception> public void Run() { c.Get(index); }