Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 /// <exception cref="System.Exception"></exception>
 public void Run()
 {
     c.Get(index);
 }