Exemplo n.º 1
0
 private void AssertNotDefined(string className)
 {
     if (_classes.ContainsKey(className))
     {
         throw new ArgumentException("Class '" + className + "' already defined.");
     }
 }
Exemplo n.º 2
0
        private IIndexedNodeWithRange NodeForConstraint(QCon con)
        {
            IIndexedNodeWithRange node = (IIndexedNodeWithRange)_nodeCache.Get(con);

            if (null != node || _nodeCache.ContainsKey(con))
            {
                return(node);
            }
            node = NewNodeForConstraint(con);
            _nodeCache.Put(con, node);
            return(node);
        }
        public virtual void TestContainsKey()
        {
            Hashtable4 table = new Hashtable4();

            Assert.IsFalse(table.ContainsKey(null));
            Assert.IsFalse(table.ContainsKey("foo"));
            table.Put("foo", null);
            Assert.IsTrue(table.ContainsKey("foo"));
            table.Put("bar", "baz");
            Assert.IsTrue(table.ContainsKey("bar"));
            Assert.IsFalse(table.ContainsKey("baz"));
            Assert.IsTrue(table.ContainsKey("foo"));
            table.Remove("foo");
            Assert.IsTrue(table.ContainsKey("bar"));
            Assert.IsFalse(table.ContainsKey("foo"));
        }
Exemplo n.º 4
0
        public virtual void Test()
        {
            Hashtable4          ht        = new Hashtable4();
            ObjectContainerBase container = Container();

            container.ShowInternalClasses(true);
            IQuery q = Db().Query();

            q.Constrain(typeof(Db4oDatabase));
            IObjectSet objectSet = q.Execute();

            while (objectSet.HasNext())
            {
                Db4oDatabase identity = (Db4oDatabase)objectSet.Next();
                Assert.IsFalse(ht.ContainsKey(identity.i_signature));
                ht.Put(identity.i_signature, string.Empty);
            }
            container.ShowInternalClasses(false);
        }