public void AsObserver_Hides() { var obs = new MyObserver(); var res = obs.AsObserver(); Assert.IsFalse(object.ReferenceEquals(obs, res)); }
public void AsObserver_Forwards() { var obsn = new MyObserver(); obsn.AsObserver().OnNext(42); Assert.AreEqual(obsn.HasOnNext, 42); var ex = new Exception(); var obse = new MyObserver(); obse.AsObserver().OnError(ex); Assert.AreSame(ex, obse.HasOnError); var obsc = new MyObserver(); obsc.AsObserver().OnCompleted(); Assert.IsTrue(obsc.HasOnCompleted); }