Example #1
0
 public virtual void TestUntypedItem()
 {
     ListTypeHandlerPersistedCountTestCase.UntypedItem untypedItem = new ListTypeHandlerPersistedCountTestCase.UntypedItem
                                                                         ();
     untypedItem.list = new ArrayList();
     Store(untypedItem);
     Db4oAssert.PersistedCount(1, typeof(ArrayList));
 }
 protected virtual void AssertReferenceTypeElementCount(int expected)
 {
     if (!IsReferenceElement(ElementClass()))
     {
         return;
     }
     Db4oAssert.PersistedCount(expected, ElementClass());
 }
Example #3
0
 public virtual void TestInterFaceItem()
 {
     ListTypeHandlerPersistedCountTestCase.InterfaceItem interfaceItem = new ListTypeHandlerPersistedCountTestCase.InterfaceItem
                                                                             ();
     interfaceItem.list = new ArrayList();
     Store(interfaceItem);
     Db4oAssert.PersistedCount(1, typeof(ArrayList));
 }
Example #4
0
 private static void AssertFirstClassElementCount(int expected)
 {
     if (!IsFirstClass(CollectionItemType()))
     {
         return;
     }
     Db4oAssert.PersistedCount(expected, CollectionItemType());
 }
        public virtual void TestUntypedItem()
        {
            var untypedItem = new UntypedItem
                                  ();

            untypedItem.list = new ArrayList();
            Store(untypedItem);
            Db4oAssert.PersistedCount(1, typeof(ArrayList));
        }
        public virtual void TestInterFaceItem()
        {
            var interfaceItem = new InterfaceItem
                                    ();

            interfaceItem.list = new ArrayList();
            Store(interfaceItem);
            Db4oAssert.PersistedCount(1, typeof(ArrayList));
        }
        /// <exception cref="System.Exception"></exception>
        public virtual void TestDeletion()
        {
            AssertReferenceTypeElementCount(Elements().Length);
            object item = RetrieveOnlyInstance(ItemFactory().ItemClass());

            Db().Delete(item);
            Db().Purge();
            Db4oAssert.PersistedCount(0, ItemFactory().ItemClass());
            AssertReferenceTypeElementCount(0);
        }
Example #8
0
        public virtual void TestDeletion()
        {
            AssertFirstClassElementCount(Count(_helper.Elements));
            object item = RetrieveOnlyInstance(_helper.ItemType);

            Db().Delete(item);
            Db().Purge();
            Db4oAssert.PersistedCount(0, _helper.ItemType);
            AssertFirstClassElementCount(0);
        }
 public virtual void TestCascadedDelete()
 {
     ListTypeHandlerCascadedDeleteTestCase.Item item = (ListTypeHandlerCascadedDeleteTestCase.Item
                                                        )RetrieveOnlyInstance(typeof(ListTypeHandlerCascadedDeleteTestCase.Item));
     Db4oAssert.PersistedCount(2, typeof(ListTypeHandlerCascadedDeleteTestCase.Element
                                         ));
     Db().Delete(item);
     Db().Purge();
     Db().Commit();
     Db4oAssert.PersistedCount(0, typeof(ListTypeHandlerCascadedDeleteTestCase.Item));
     Db4oAssert.PersistedCount(0, typeof(ArrayList));
     Db4oAssert.PersistedCount(0, typeof(ListTypeHandlerCascadedDeleteTestCase.Element
                                         ));
 }
 public virtual void TestArrayListCount()
 {
     Db4oAssert.PersistedCount(2, typeof(ArrayList));
 }