示例#1
0
        protected override void Store()
        {
            IntItem item = IntItem.NewIntItem(DEPTH);

            item._isRoot = true;
            Store(item);
        }
示例#2
0
文件: IntItem.cs 项目: erdincay/db4o
        public static IntItem NewIntItem(int depth)
        {
            if (depth == 0)
            {
                return null;
            }

            IntItem root = new IntItem();
            root._intValue = depth;
            root._next = NewIntItem(depth - 1);
            return root;
        }
示例#3
0
        public static IntItem NewIntItem(int depth)
        {
            if (depth == 0)
            {
                return(null);
            }

            IntItem root = new IntItem();

            root._intValue = depth;
            root._next     = NewIntItem(depth - 1);
            return(root);
        }
示例#4
0
        public void Test()
        {
            IntItem item = RetrieveRoot();

            Assert.IsNotNull(item);

            for (int i = 0; i < DEPTH - 1; i++)
            {
                Assert.AreEqual(0, GetField(item, "_intValue"));
                Assert.IsNull(GetField(item, "_next"));
                Assert.AreEqual(DEPTH - i, item.GetIntValue());
                Assert.IsNotNull(item.Next());
                Assert.AreEqual(DEPTH - i, GetField(item, "_intValue"));
                Assert.IsNotNull(GetField(item, "_next"));
                item = item.Next();
            }

            Assert.AreEqual(0, GetField(item, "_intValue"));
            Assert.IsNull(GetField(item, "_next"));
            Assert.AreEqual(1, item.GetIntValue());
            Assert.IsNull(GetField(item, "_next"));
        }