Example #1
0
            public void EmitsTrueWhenTurnedOn()
            {
                var observer = Substitute.For <IObserver <bool> >();

                SettingsStorage.CalendarNotificationsEnabled.Subscribe(observer);

                SettingsStorage.SetCalendarNotificationsEnabled(true);

                Received.InOrder(() =>
                {
                    observer.OnNext(false);
                    observer.OnNext(true);
                });
            }
Example #2
0
            public void DoesNotEmitAnyAdditionalFalseValues()
            {
                var observer = Substitute.For <IObserver <bool> >();

                SettingsStorage.CalendarNotificationsEnabled.Subscribe(observer);

                SettingsStorage.SetCalendarNotificationsEnabled(false);
                SettingsStorage.SetCalendarNotificationsEnabled(false);
                SettingsStorage.SetCalendarNotificationsEnabled(false);

                Received.InOrder(() =>
                {
                    observer.OnNext(false);
                });
            }