Ejemplo n.º 1
0
        public virtual void TestContainsAll()
        {
            Collection4TestCase.Item a  = new Collection4TestCase.Item(42);
            Collection4TestCase.Item b  = new Collection4TestCase.Item(a.id + 1);
            Collection4TestCase.Item c  = new Collection4TestCase.Item(b.id + 1);
            Collection4TestCase.Item a_ = new Collection4TestCase.Item(a.id);
            Collection4 needle          = new Collection4();
            Collection4 haystack        = new Collection4();

            haystack.Add(a);
            needle.Add(a);
            needle.Add(b);
            Assert.IsFalse(haystack.ContainsAll(needle));
            needle.Remove(b);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(b);
            haystack.Add(b);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(a_);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(c);
            Assert.IsFalse(haystack.ContainsAll(needle));
            needle.Clear();
            Assert.IsTrue(haystack.ContainsAll(needle));
            haystack.Clear();
            Assert.IsTrue(haystack.ContainsAll(needle));
        }
Ejemplo n.º 2
0
 private void ClearBatchedObjects()
 {
     _batchedMessages.Clear();
     // initial value of _batchedQueueLength is Const4.INT_LENGTH, which is
     // used for to write the number of messages.
     _batchedQueueLength = Const4.IntLength;
 }
Ejemplo n.º 3
0
        public virtual void TestContainsAll()
        {
            var a        = new Item(42);
            var b        = new Item(a.id + 1);
            var c        = new Item(b.id + 1);
            var a_       = new Item(a.id);
            var needle   = new Collection4();
            var haystack = new Collection4();

            haystack.Add(a);
            needle.Add(a);
            needle.Add(b);
            Assert.IsFalse(haystack.ContainsAll(needle));
            needle.Remove(b);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(b);
            haystack.Add(b);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(a_);
            Assert.IsTrue(haystack.ContainsAll(needle));
            needle.Add(c);
            Assert.IsFalse(haystack.ContainsAll(needle));
            needle.Clear();
            Assert.IsTrue(haystack.ContainsAll(needle));
            haystack.Clear();
            Assert.IsTrue(haystack.ContainsAll(needle));
        }
        private void WriteCachedDirty()
        {
            IEnumerator i = _dirtyClassMetadata.GetEnumerator();

            while (i.MoveNext())
            {
                PersistentBase dirty = (PersistentBase)i.Current;
                dirty.Write(SystemTransaction());
                dirty.NotCachedDirty();
            }
            _dirtyClassMetadata.Clear();
        }
Ejemplo n.º 5
0
 public virtual void Reset()
 {
     _calls.Clear();
 }
Ejemplo n.º 6
0
 public virtual void CommitReplicationTransaction(long raisedDatabaseVersion)
 {
     _uuidsDeletedSinceLastReplication.Clear();
     _timeStampIdGenerator.SetMinimumNext(raisedDatabaseVersion);
 }