Exemplo n.º 1
0
        public void Average_InjectOverflow_Decimal_Nullable()
        {
            var xs = Observable.Return((decimal?)42.0m, ThreadPoolScheduler.Instance);

            var res = new OverflowInjection <decimal?>(xs, long.MaxValue).Average();

            ReactiveAssert.Throws <OverflowException>(() => res.ForEach(_ => { }));
        }
Exemplo n.º 2
0
        public void Count_Predicate_InjectOverflow()
        {
            var xs = Observable.Return(42, ThreadPoolScheduler.Instance);

            var res = new OverflowInjection <int>(xs, int.MaxValue).Count(_ => true);

            ReactiveAssert.Throws <OverflowException>(() => res.ForEach(_ => { }));
        }
Exemplo n.º 3
0
        public void Average_InjectOverflow_Single()
        {
            var xs = Observable.Return(42.0f, ThreadPoolScheduler.Instance);

            var res = new OverflowInjection <float>(xs, long.MaxValue).Average();

            ReactiveAssert.Throws <OverflowException>(() => res.ForEach(_ => { }));
        }