本文整理汇总了C#中System.Collections.SortedSet.Concat方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.Concat方法的具体用法?C# SortedSet.Concat怎么用?C# SortedSet.Concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.SortedSet
的用法示例。
在下文中一共展示了SortedSet.Concat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSetCompares
[Category("NotDotNet")] // Running this test against .NET 4.0 fails
public void TestSetCompares ()
{
var empty = new SortedSet<int> ();
var zero = new SortedSet<int> { 0 };
var one = new SortedSet<int> { 1 };
var two = new SortedSet<int> { 2 };
var bit = new SortedSet<int> { 0, 1 };
var trit = new SortedSet<int> { 0, 1, 2 };
var odds = new SortedSet<int> { 1, 3, 5, 7, 9 };
var evens = new SortedSet<int> { 2, 4, 6, 8 };
var digits = new SortedSet<int> { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var squares = new SortedSet<int> { 0, 1, 4, 9 };
var non_prime_odd_digit = odds.GetViewBetween (8, 42);
var non_trit = digits.GetViewBetween (3, 42);
do_test (empty, empty, se: true);
do_test (empty, zero, psb: true);
do_test (empty, digits, psb: true);
do_test (zero, zero, se: true);
do_test (zero, one);
do_test (zero, bit, psb: true);
do_test (zero, trit, psb: true);
do_test (one, bit, psb: true);
do_test (one, trit, psb: true);
do_test (two, bit);
do_test (two, trit, psb: true);
do_test (odds, squares, o: true);
do_test (evens, squares, o: true);
do_test (odds, digits, psb: true);
do_test (evens, digits, psb: true);
do_test (squares, digits, psb: true);
do_test (digits, digits, se: true);
do_test_e (digits, squares.Concat (evens.Concat (odds)), o: true, se: true);
do_test (non_prime_odd_digit, digits, psb: true);
do_test_e (non_prime_odd_digit, new [] { 9 }, o: true, se: true);
do_test (non_trit, digits, psb: true);
do_test (trit, non_trit);
do_test_e (digits, trit.Concat (non_trit), o: true, se: true);
do_test_e (non_trit, new [] { 3, 4, 5, 6, 7, 8, 9 }, o: true, se: true);
do_test (digits.GetViewBetween (0, 2), trit, se: true);
}