本文整理汇总了C#中System.Collections.SortedSet.SequenceEqual方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.SequenceEqual方法的具体用法?C# SortedSet.SequenceEqual怎么用?C# SortedSet.SequenceEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.SortedSet
的用法示例。
在下文中一共展示了SortedSet.SequenceEqual方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewSymmetricExceptWith
public void ViewSymmetricExceptWith ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
var view = set.GetViewBetween (4, 8);
view.SymmetricExceptWith (new [] { 4, 5, 6, 6, 4 });
Assert.IsTrue (view.SequenceEqual (new [] { 4, 6, 7 }));
Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 4, 6, 7, 9 }));
}
示例2: UnionWith
public void UnionWith ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
set.UnionWith (new [] { 5, 7, 3, 7, 11, 7, 5, 2 });
Assert.IsTrue (set.SequenceEqual (new [] { 1, 2, 3, 5, 7, 9, 11 }));
}
示例3: SymmetricExceptWith
public void SymmetricExceptWith ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
set.SymmetricExceptWith (new [] { 5, 7, 3, 7, 11, 7, 5, 2 });
Assert.IsTrue (set.SequenceEqual (new [] { 1, 2, 9, 11 }));
}
示例4: ViewIntersectWith
public void ViewIntersectWith ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
var view = set.GetViewBetween (4, 8);
view.IntersectWith (new [] { 1, 5, 9 });
Assert.IsTrue (view.SequenceEqual (new [] { 5 }));
Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 5, 9 }));
view.IntersectWith (new [] { 1, 2 });
Assert.IsTrue (view.SequenceEqual (new int [] {}));
Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 9 }));
}
示例5: IntersectWith
public void IntersectWith ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
set.IntersectWith (new [] { 5, 7, 3, 7, 11, 7, 5, 2 });
Assert.IsTrue (set.SequenceEqual (new [] { 3, 5, 7 }));
}
示例6: ViewClear
public void ViewClear ()
{
var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
var view = set.GetViewBetween (3, 7);
view.Clear ();
Assert.AreEqual (0, view.Count);
Assert.IsTrue (set.SequenceEqual (new [] { 1, 9 }));
}
示例7: RemoveWhere
public void RemoveWhere ()
{
var set = new SortedSet<int> { 1, 2, 3, 4, 5, 6 };
Assert.AreEqual (3, set.RemoveWhere (i => i % 2 == 0));
Assert.AreEqual (3, set.Count);
Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 5 }));
}
示例8: GetEnumerator
public void GetEnumerator ()
{
var set = new SortedSet<int> { 5, 3, 1, 2, 6, 4 };
Assert.IsTrue (set.SequenceEqual (new [] { 1, 2, 3, 4, 5, 6 }));
}