public void when_IsActive_is_set_to_true_then_false_then_ActivationStateChanged_pumps_that_value() { var testSchedulerProvider = new TestDispatcherSchedulerProvider(); var activationStateViewModel = new ActivationStateViewModel(new NoOpLogger(), testSchedulerProvider); activationStateViewModel.Activate(); var result = true; activationStateViewModel.ActivationStateChanged .Subscribe(isActive => result = isActive); activationStateViewModel.DeActivate(); Assert.That(result, Is.False); }
public void the_second_time_IsActive_is_set_to_true_then_OnInitialise_does_not_pumps() { var testSchedulerProvider = new TestDispatcherSchedulerProvider(); var activationStateViewModel = new ActivationStateViewModel(new NoOpLogger(), testSchedulerProvider); activationStateViewModel.Activate(); activationStateViewModel.DeActivate(); var result = false; activationStateViewModel.OnInitialise .Subscribe(_ => result = true); activationStateViewModel.Activate(); Assert.That(result, Is.False); }