Пример #1
0
        public void EmptyBehaviorTest()
        {
            StringCollection col = new StringCollection();

            Assert.AreEqual(0, col.Count);
            Assert.IsFalse(col.Contains(String.Empty));
            Assert.AreEqual(-1, col.IndexOf(String.Empty));
        }
Пример #2
0
        public void AddInsertTest()
        {
            StringCollection col = new StringCollection();

            String test = "foo";
            Assert.IsFalse(col.Contains(test));
            Assert.AreEqual(-1, col.IndexOf(test));

            col.Add(test);
            Assert.IsTrue(col.Contains(test));
            Assert.AreEqual(0, col.IndexOf(test));

            String test2 = "bar";

            col.Insert(0, test2);
            Assert.IsTrue(col.Contains(test2));
            Assert.AreEqual(0, col.IndexOf(test2));
            Assert.IsTrue(col.Contains(test));
            Assert.AreEqual(1, col.IndexOf(test));
        }