Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void when_IsActive_is_set_to_true_then_ActivationStateChanged_pumps_true()
        {
            var testSchedulerProvider = new TestDispatcherSchedulerProvider();

            var activationStateViewModel = new ActivationStateViewModel(new NoOpLogger(), testSchedulerProvider);

            var result = false;

            activationStateViewModel.ActivationStateChanged
            .Subscribe(isActive => result = isActive);

            activationStateViewModel.Activate();

            Assert.That(result, Is.True);
        }