Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public void RemoveNonExistentTest()
        {
            StringCollection col = new StringCollection();

            String test = "foo", test2 = "bar";
            col.Add(test);
            col.Add(test2);

            col.Remove("baz");
        }
Exemplo n.º 3
0
        public void ThisTest()
        {
            StringCollection col = new StringCollection();
            String test = "foo", test2 = "bar";

            col.Add(test);
            col.Add(test2);

            Assert.AreEqual(test, col[0]);
            Assert.AreEqual(test2, col[1]);

            col[1] = test;
            Assert.AreEqual(test, col[1]);
        }
Exemplo n.º 4
0
        internal SqliteCatalogStoreItem(SqliteCatalogStore store, long itemId)
        {
            _store = store;
            _id = itemId;
            _loaded = false;
            _persisting = false;

            _uri = null;
            _title = null;
            _type = null;
            _tags = new StringCollection();
            _parent = null;
            _aliasOf = null;
            _aliases = new SqliteCatalogStoreItemCollection();
            _children = new SqliteCatalogStoreItemCollection();
        }
Exemplo n.º 5
0
        public void RemoveTest()
        {
            StringCollection col = new StringCollection();

            String test = "foo", test2 = "bar";
            col.Add(test);
            col.Add(test2);

            col.RemoveAt(1);

            Assert.IsTrue(col.Contains(test));
            Assert.IsFalse(col.Contains(test2));

            col.Remove(test);

            Assert.IsFalse(col.Contains(test));
        }
Exemplo n.º 6
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));
        }