public void FirstPredicate_Return_NoMatch() { var value = 42; ReactiveAssert.Throws <InvalidOperationException>(() => Observable.Return(value).First(i => i % 2 != 0)); }
public void Repeat_Value_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat(1, null)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat(DummyScheduler.Instance, 1).Subscribe(null)); }
public void Repeat_Value_Count_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat(1, 0, default)); ReactiveAssert.Throws <ArgumentOutOfRangeException>(() => Observable.Repeat(1, -1, DummyScheduler.Instance)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat(1, 1, DummyScheduler.Instance).Subscribe(null)); }
public void Wait_Empty() { ReactiveAssert.Throws <InvalidOperationException>(() => Observable.Empty <int>().Wait()); }
public void ElementAtOrDefault_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.ElementAtOrDefault(default(IObservable <int>), 2)); ReactiveAssert.Throws <ArgumentOutOfRangeException>(() => Observable.ElementAtOrDefault(DummyObservable <int> .Instance, -1)); }
public void OnError_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => new Subject <int>().OnError(null)); }
public void AnonymousObserver_Error_Null() { var observer = new AnonymousObserver <int>(_ => { }, e => { }, () => { }); ReactiveAssert.Throws <ArgumentNullException>(() => observer.OnError(null)); }
public void CompositeDisposable_RemoveNull() { ReactiveAssert.Throws <ArgumentNullException>(() => new CompositeDisposable().Remove(null)); }
public void ContextDisposable_CreateNullContext() { ReactiveAssert.Throws <ArgumentNullException>(() => new ContextDisposable(null, Disposable.Empty)); }
public void CompositeDisposable_AddNull_via_params_ctor() { IDisposable d1 = null; ReactiveAssert.Throws <ArgumentException>(() => new CompositeDisposable(d1)); }
public void CompositeDisposable_AddNull_via_IEnum_ctor() { IEnumerable <IDisposable> values = new IDisposable[] { null }; ReactiveAssert.Throws <ArgumentException>(() => new CompositeDisposable(values)); }
public void CompositeDisposable_CopyTo_BeyondEnd() { ReactiveAssert.Throws <ArgumentOutOfRangeException>(() => new CompositeDisposable().CopyTo(new IDisposable[2], 2)); }
public void CompositeDisposable_CopyTo_Null() { ReactiveAssert.Throws <ArgumentNullException>(() => new CompositeDisposable().CopyTo(null, 0)); }
public void CompositeDisposable_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => new CompositeDisposable(default(IDisposable[]))); ReactiveAssert.Throws <ArgumentNullException>(() => new CompositeDisposable(default(IEnumerable <IDisposable>))); ReactiveAssert.Throws <ArgumentOutOfRangeException>(() => new CompositeDisposable(-1)); }
public void ObserveOn_Scheduler_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.ObserveOn(default(IObservable <int>), DummyScheduler.Instance)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.ObserveOn(DummyObservable <int> .Instance, default(IScheduler))); }
public void ContextDisposable_CreateNullDisposable() { ReactiveAssert.Throws <ArgumentNullException>(() => new ContextDisposable(new SynchronizationContext(), null)); }
public void Subscribe_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => new Subject <int>().Subscribe(null)); }
public void RefCountDisposable_Ctor_Null() { ReactiveAssert.Throws <ArgumentNullException>(() => new RefCountDisposable(null)); }
public void AnonymousObservable_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => new AnonymousObservable <int>(null)); }
public void ScheduledDisposable_Null() { ReactiveAssert.Throws <ArgumentNullException>(() => new ScheduledDisposable(null, Disposable.Empty)); ReactiveAssert.Throws <ArgumentNullException>(() => new ScheduledDisposable(Scheduler.Immediate, null)); }
public void Wait_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Wait(default(IObservable <int>))); }
public void SubscribeSafe_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => ObservableExtensions.SubscribeSafe <int>(default(IObservable <int>), Observer.Create <int>(_ => { }))); ReactiveAssert.Throws <ArgumentNullException>(() => ObservableExtensions.SubscribeSafe <int>(Observable.Return(42), default(IObserver <int>))); }
public void Switch_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Switch((IObservable <IObservable <int> >)null)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Switch((IObservable <Task <int> >)null)); }
public void RetryWhen_Observable_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.RetryWhen <int, Exception>(null, v => v)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.RetryWhen <int, Exception>(Observable.Return(1), null)); ReactiveAssert.Throws <ArgumentNullException>(() => DummyObservable <int> .Instance.RetryWhen(v => v).Subscribe(null)); }
public void DoWhile_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.DoWhile(DummyObservable <int> .Instance, null)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.DoWhile(default(IObservable <int>), DummyFunc <bool> .Instance)); }
public void Historical_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => new HistoricalScheduler(DateTime.Now, default(IComparer <DateTimeOffset>))); ReactiveAssert.Throws <ArgumentNullException>(() => new HistoricalScheduler().ScheduleAbsolute(42, DateTime.Now, default(Func <IScheduler, int, IDisposable>))); ReactiveAssert.Throws <ArgumentNullException>(() => new HistoricalScheduler().ScheduleRelative(42, TimeSpan.FromSeconds(1), default(Func <IScheduler, int, IDisposable>))); }
public void Repeat_Value_Default_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat(1).Subscribe(null)); }
public void FirstOrDefaultAsync_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.FirstOrDefaultAsync(default(IObservable <int>))); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.FirstOrDefaultAsync(default(IObservable <int>), _ => true)); ReactiveAssert.Throws <ArgumentNullException>(() => Observable.FirstOrDefaultAsync(DummyObservable <int> .Instance, default)); }
public void Repeat_Observable_Default_ArgumentChecking() { ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Repeat <int>(null)); ReactiveAssert.Throws <ArgumentNullException>(() => DummyObservable <int> .Instance.Repeat().Subscribe(null)); }
public void FirstPredicate_Empty() { ReactiveAssert.Throws <InvalidOperationException>(() => Observable.Empty <int>().First(_ => true)); }