Пример #1
0
 public virtual void TestRefreshBigSet()
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = NewHolderWithBigSet(new BigSetTestCase.Item
                                                                                  ("1"), new BigSetTestCase.Item("2"));
     StoreAndCommit(holder);
     Db().Refresh(holder, int.MaxValue);
     Assert.AreEqual(2, holder._set.Count);
 }
Пример #2
0
 private BigSetTestCase.Holder <BigSetTestCase.Item> NewHolderWithBigSet(params BigSetTestCase.Item
                                                                         [] item)
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = new BigSetTestCase.Holder <BigSetTestCase.Item
                                                                                     >();
     holder._set = NewBigSet(item);
     return(holder);
 }
Пример #3
0
 public virtual void TestPurgeBeforeCommit()
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = NewHolderWithBigSet(new BigSetTestCase.Item
                                                                                  ("foo"));
     Store(holder);
     PurgeAll(holder, holder._set);
     holder = (BigSetTestCase.Holder <BigSetTestCase.Item>)RetrieveOnlyInstance(holder.
                                                                                GetType());
     Assert.AreEqual(1, holder._set.Count);
 }
Пример #4
0
 private void RunTestAfterCommit(IProcedure4 setOperations)
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = NewHolderWithBigSet(new BigSetTestCase.Item
                                                                                  ("1"), new BigSetTestCase.Item("2"));
     StoreAndCommit(holder);
     Db4objects.Db4o.Collections.ISet <BigSetTestCase.Item> set = holder._set;
     Assert.AreEqual(2, set.Count);
     setOperations.Apply(set);
     PurgeAll(holder, holder._set);
     BigSetTestCase.Holder <BigSetTestCase.Item> resurrected = (BigSetTestCase.Holder <BigSetTestCase.Item
                                                                                       >)RetrieveOnlyInstance(holder.GetType());
     IteratorAssert.SameContent(set.GetEnumerator(), resurrected._set.GetEnumerator());
 }
Пример #5
0
 /// <exception cref="System.Exception"></exception>
 public virtual void TestPersistence()
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = new BigSetTestCase.Holder <BigSetTestCase.Item
                                                                                     >();
     holder._set = NewBigSet();
     Db4objects.Db4o.Collections.ISet <BigSetTestCase.Item> set = holder._set;
     set.Add(ItemOne);
     Store(holder);
     Reopen();
     holder = (BigSetTestCase.Holder <BigSetTestCase.Item>)RetrieveOnlyInstance(holder.
                                                                                GetType());
     set = holder._set;
     AssertSinglePersistentItem(set);
 }
Пример #6
0
 private void StoreAndCommit(BigSetTestCase.Holder <BigSetTestCase.Item> holder)
 {
     Store(holder);
     Db().Commit();
 }