private void ChangeStateTo(VostokApplicationState newState, Exception error = null) { ApplicationState = newState; onApplicationStateChanged.Next(newState); if (error != null) { onApplicationStateChanged.Error(error); } else if (newState.IsTerminal()) { onApplicationStateChanged.Complete(); } }
public void Subscribe_should_pass_latest_value_to_observer_immediately_even_after_complete() { observable.Next("1"); observable.Next("2"); observable.Complete(); observable.Subscribe(observer1); observer1.ReceivedCalls().Should().HaveCount(2); observer1.Received().OnNext("2"); observer1.Received().OnCompleted(); }