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); }
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); }
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); }
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()); }
/// <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); }
private void StoreAndCommit(BigSetTestCase.Holder <BigSetTestCase.Item> holder) { Store(holder); Db().Commit(); }