Пример #1
0
 public static void Aggregate_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Aggregate((i, j) => { canceler(); return(j); }));
     AssertThrows.EventuallyCanceled((source, canceler) => source.Aggregate(0, (i, j) => { canceler(); return(j); }));
     AssertThrows.EventuallyCanceled((source, canceler) => source.Aggregate(0, (i, j) => { canceler(); return(j); }, i => i));
     AssertThrows.EventuallyCanceled((source, canceler) => source.Aggregate(0, (i, j) => { canceler(); return(j); }, (i, j) => i, i => i));
     AssertThrows.EventuallyCanceled((source, canceler) => source.Aggregate(() => 0, (i, j) => { canceler();; return(j); }, (i, j) => i, i => i));
 }
Пример #2
0
        public static void Sum_OperationCanceledException()
        {
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return(x); }));
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((int?)x); }));

            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((long)x); }));
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((long?)x); }));

            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((float)x); }));
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((float?)x); }));

            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((double)x); }));
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((double?)x); }));

            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((decimal)x); }));
            AssertThrows.EventuallyCanceled((source, canceler) => source.Sum(x => { canceler(); return((decimal?)x); }));
        }
Пример #3
0
 public static void Count_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Count(x => { canceler(); return(true); }));
     AssertThrows.EventuallyCanceled((source, canceler) => source.LongCount(x => { canceler(); return(true); }));
 }
Пример #4
0
 public static void Contains_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Contains(-1, new CancelingEqualityComparer <int>(canceler)));
 }
Пример #5
0
 public static void ToDictionary_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.ToLookup(x => x, new CancelingEqualityComparer <int>(canceler)));
     AssertThrows.EventuallyCanceled((source, canceler) => source.ToLookup(x => x, y => y, new CancelingEqualityComparer <int>(canceler)));
 }
Пример #6
0
 public static void All_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.All(x => { canceler(); return(true); }));
 }
Пример #7
0
 public static void SequenceEqual_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.OrderBy(x => x).SequenceEqual(ParallelEnumerable.Range(0, 128).AsOrdered(), new CancelingEqualityComparer <int>(canceler)));
     AssertThrows.EventuallyCanceled((source, canceler) => ParallelEnumerable.Range(0, 128).AsOrdered().SequenceEqual(source.OrderBy(x => x), new CancelingEqualityComparer <int>(canceler)));
 }
 public static void First_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.First(x => { canceler(); return(false); }));
     AssertThrows.EventuallyCanceled((source, canceler) => source.FirstOrDefault(x => { canceler(); return(false); }));
 }
Пример #9
0
 public static void ForAll_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.ForAll(x => canceler()));
 }
Пример #10
0
 public static void Any_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Any(x => { canceler(); return false; }));
 }
Пример #11
0
 public static void Single_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Single(x => { canceler(); return(false); }));
 }