Пример #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)));
        }
        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
 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
        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
        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
 public static void ToArray_OperationCanceledException_PreCanceled()
 {
     AssertThrows.AlreadyCanceled(source => source.ToArray());
 }
Пример #9
0
 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));
 }
 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));
 }