本文整理汇总了C#中Db4objects.Db4o.Foundation.Collection4.ContainsAll方法的典型用法代码示例。如果您正苦于以下问题:C# Collection4.ContainsAll方法的具体用法?C# Collection4.ContainsAll怎么用?C# Collection4.ContainsAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Foundation.Collection4
的用法示例。
在下文中一共展示了Collection4.ContainsAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestContainsAll
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));
}
示例2: AssertAllSlotsFreed
/// <exception cref="System.Exception"></exception>
public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
block)
{
LocalObjectContainer container = (LocalObjectContainer)trans.Container();
ITransactionalIdSystem idSystem = trans.IdSystem();
IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
Collection4 allSlots = new Collection4();
while (allSlotIDs.MoveNext())
{
int slotID = ((int)allSlotIDs.Current);
Slot slot = idSystem.CurrentSlot(slotID);
allSlots.Add(slot);
}
Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());
allSlots.Add(bTreeSlot);
Collection4 freedSlots = new Collection4();
IFreespaceManager freespaceManager = container.FreespaceManager();
container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
(freedSlots)));
block.Run();
container.InstallDebugFreespaceManager(freespaceManager);
Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
}
示例3: TestContainsAll
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));
}