コード例 #1
0
 public static void ToDictionary_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.ToDictionary(x => x));
     AssertThrows.AlreadyCanceled(source => source.ToDictionary(x => x, EqualityComparer <int> .Default));
     AssertThrows.AlreadyCanceled(source => source.ToDictionary(x => x, y => y));
     AssertThrows.AlreadyCanceled(source => source.ToDictionary(x => x, y => y, EqualityComparer <int> .Default));
 }
コード例 #2
0
        public static void CountLongCount_OperationCanceledException_PreCanceled()
        {
            AssertThrows.AlreadyCanceled(source => source.Count());
            AssertThrows.AlreadyCanceled(source => source.Count(x => true));

            AssertThrows.AlreadyCanceled(source => source.LongCount());
            AssertThrows.AlreadyCanceled(source => source.LongCount(x => true));
        }
コード例 #3
0
        public static void SequenceEqual_OperationCanceledException_PreCanceled()
        {
            AssertThrows.AlreadyCanceled(source => source.SequenceEqual(ParallelEnumerable.Range(0, 2)));
            AssertThrows.AlreadyCanceled(source => source.SequenceEqual(ParallelEnumerable.Range(0, 2), new ModularCongruenceComparer(1)));

            AssertThrows.AlreadyCanceled(source => ParallelEnumerable.Range(0, 2).SequenceEqual(source));
            AssertThrows.AlreadyCanceled(source => ParallelEnumerable.Range(0, 2).SequenceEqual(source, new ModularCongruenceComparer(1)));
        }
コード例 #4
0
        public static void First_OperationCanceledException_PreCanceled()
        {
            AssertThrows.AlreadyCanceled(source => source.First());
            AssertThrows.AlreadyCanceled(source => source.First(x => true));

            AssertThrows.AlreadyCanceled(source => source.FirstOrDefault());
            AssertThrows.AlreadyCanceled(source => source.FirstOrDefault(x => true));
        }
コード例 #5
0
ファイル: AggregateTests.cs プロジェクト: lodejard/AllNetCore
 public static void Aggregate_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.Aggregate((i, j) => i));
     AssertThrows.AlreadyCanceled(source => source.Aggregate(0, (i, j) => i));
     AssertThrows.AlreadyCanceled(source => source.Aggregate(0, (i, j) => i, i => i));
     AssertThrows.AlreadyCanceled(source => source.Aggregate(0, (i, j) => i, (i, j) => i, i => i));
     AssertThrows.AlreadyCanceled(source => source.Aggregate(() => 0, (i, j) => i, (i, j) => i, i => i));
 }
コード例 #6
0
ファイル: SumTests.cs プロジェクト: jnm2/corefx
        public static void Sum_OperationCanceledException_PreCanceled()
        {
            AssertThrows.AlreadyCanceled(source => source.Sum(x => x));
            AssertThrows.AlreadyCanceled(source => source.Sum(x => (int?)x));

            AssertThrows.AlreadyCanceled(source => source.Sum(x => (long)x));
            AssertThrows.AlreadyCanceled(source => source.Sum(x => (long?)x));

            AssertThrows.AlreadyCanceled(source => source.Sum(x => (float)x));
            AssertThrows.AlreadyCanceled(source => source.Sum(x => (float?)x));

            AssertThrows.AlreadyCanceled(source => source.Sum(x => (double)x));
            AssertThrows.AlreadyCanceled(source => source.Sum(x => (double?)x));

            AssertThrows.AlreadyCanceled(source => source.Sum(x => (decimal)x));
            AssertThrows.AlreadyCanceled(source => source.Sum(x => (decimal?)x));
        }
コード例 #7
0
ファイル: MaxTests.cs プロジェクト: lodejard/AllNetCore
        public static void Max_OperationCanceledException_PreCanceled()
        {
            AssertThrows.AlreadyCanceled(source => source.Max(x => x));
            AssertThrows.AlreadyCanceled(source => source.Max(x => (int?)x));

            AssertThrows.AlreadyCanceled(source => source.Max(x => (long)x));
            AssertThrows.AlreadyCanceled(source => source.Max(x => (long?)x));

            AssertThrows.AlreadyCanceled(source => source.Max(x => (float)x));
            AssertThrows.AlreadyCanceled(source => source.Max(x => (float?)x));

            AssertThrows.AlreadyCanceled(source => source.Max(x => (double)x));
            AssertThrows.AlreadyCanceled(source => source.Max(x => (double?)x));

            AssertThrows.AlreadyCanceled(source => source.Max(x => (decimal)x));
            AssertThrows.AlreadyCanceled(source => source.Max(x => (decimal?)x));

            AssertThrows.AlreadyCanceled(source => source.Max(x => new NotComparable(x)));
        }
コード例 #8
0
ファイル: ToArrayTests.cs プロジェクト: lodejard/AllNetCore
 public static void ToArray_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.ToArray());
 }
コード例 #9
0
ファイル: ContainsTests.cs プロジェクト: karthikrajkumar/demo
 public static void Contains_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.Contains(0));
     AssertThrows.AlreadyCanceled(source => source.Contains(0, EqualityComparer <int> .Default));
 }
コード例 #10
0
 public static void All_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.All(x => true));
 }
コード例 #11
0
 public static void ElementAt_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.ElementAt(0));
     AssertThrows.AlreadyCanceled(source => source.ElementAtOrDefault(0));
 }
コード例 #12
0
 public static void Single_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.Single());
     AssertThrows.AlreadyCanceled(source => source.Single(x => true));
 }