Beispiel #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));
 }
Beispiel #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); }));
        }
Beispiel #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); }));
 }
Beispiel #4
0
 public static void Contains_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Contains(-1, new CancelingEqualityComparer <int>(canceler)));
 }
Beispiel #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)));
 }
Beispiel #6
0
 public static void All_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.All(x => { canceler(); return(true); }));
 }
 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); }));
 }
Beispiel #9
0
 public static void ForAll_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.ForAll(x => canceler()));
 }
Beispiel #10
0
 public static void Any_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Any(x => { canceler(); return false; }));
 }
Beispiel #11
0
 public static void Single_OperationCanceledException()
 {
     AssertThrows.EventuallyCanceled((source, canceler) => source.Single(x => { canceler(); return(false); }));
 }