public async Task ClosesTheViewModel() { await ViewModel.Close.Execute(Unit.Default); UserPreferences.DidNotReceive().SetCalendarNotificationsEnabled(Arg.Any <bool>()); UserPreferences.DidNotReceive().SetTimeSpanBeforeCalendarNotifications(Arg.Any <TimeSpan>()); NavigationService.Received().Close(Arg.Any <UpcomingEventsNotificationSettingsViewModel>(), Unit.Default); }
public void DoesNotSetTheEnabledCalendarsToNullWhenCalendarPermissionsWereGranted() { PermissionsChecker.CalendarPermissionGranted.Returns(Observable.Return(true)); UserPreferences.EnabledCalendarIds().Returns(new List <string>()); var viewModel = CreateViewModel(); viewModel.Initialize(false).Wait(); UserPreferences.DidNotReceive().SetEnabledCalendars(Arg.Is <string[]>(strings => strings == null || strings.Length == 0)); }
public async Task SavesTheSelectedOption(CalendarNotificationsOption option, bool enabled, int minutes) { ViewModel.SelectOption.Execute(option); TestScheduler.Start(); UserPreferences.Received().SetCalendarNotificationsEnabled(enabled); if (enabled) { UserPreferences.Received().SetTimeSpanBeforeCalendarNotifications(Arg.Is <TimeSpan>(arg => arg == TimeSpan.FromMinutes(minutes))); } else { UserPreferences.DidNotReceive().SetTimeSpanBeforeCalendarNotifications(Arg.Any <TimeSpan>()); } await NavigationService.Received().Close(Arg.Any <UpcomingEventsNotificationSettingsViewModel>(), Unit.Default); }
public async Task SavesTheSelectedOption(CalendarNotificationsOption option, bool enabled, int minutes) { var selectableOption = new SelectableCalendarNotificationsOptionViewModel(option, false); ViewModel.SelectOption.Execute(selectableOption); TestScheduler.Start(); UserPreferences.Received().SetCalendarNotificationsEnabled(enabled); if (enabled) { UserPreferences.Received().SetTimeSpanBeforeCalendarNotifications(Arg.Is <TimeSpan>(arg => arg == TimeSpan.FromMinutes(minutes))); } else { UserPreferences.DidNotReceive().SetTimeSpanBeforeCalendarNotifications(Arg.Any <TimeSpan>()); } View.Received().Close(); }