예제 #1
0
            public async Task ClearsDonatedIntents()
            {
                doNotShowConfirmationDialog();
                await ViewModel.TryLogout();

                IntentDonationService.Received().ClearAll();
            }
예제 #2
0
            public async Task ClearsDonatedIntents()
            {
                doNotShowConfirmationDialog();

                ViewModel.TryLogout.Execute();
                TestScheduler.Start();

                IntentDonationService.Received().ClearAll();
            }
예제 #3
0
            public async ThreadingTask ShouldDonateStopTimerIntent()
            {
                var secondTimeEntry = Substitute.For <IThreadSafeTimeEntry>();

                await ViewModel.StopTimeEntryCommand.ExecuteAsync();

                subject.OnNext(secondTimeEntry);
                TestScheduler.AdvanceBy(TimeSpan.FromMilliseconds(50).Ticks);
                await ViewModel.StopTimeEntryCommand.ExecuteAsync();

                IntentDonationService.Received().DonateStopCurrentTimeEntry();
            }
예제 #4
0
            public void ShouldDonateStopTimerIntent()
            {
                var secondTimeEntry = Substitute.For <IThreadSafeTimeEntry>();

                ViewModel.StopTimeEntry.Execute(Arg.Any <TimeEntryStopOrigin>());
                TestScheduler.Start();
                TestScheduler.Stop();
                subject.OnNext(secondTimeEntry);
                TestScheduler.AdvanceBy(TimeSpan.FromMilliseconds(50).Ticks);
                ViewModel.StopTimeEntry.Execute(Arg.Any <TimeEntryStopOrigin>());

                TestScheduler.Start();
                IntentDonationService.Received().DonateStopCurrentTimeEntry();
            }
예제 #5
0
            public async Task DonatesTheIntent()
            {
                await CallInteractor(CreatePrototype(ValidTime, ValidDescription, true, ProjectId));

                IntentDonationService.Received().DonateStartTimeEntry(Arg.Any <IWorkspace>(), Arg.Any <ITimeEntry>());
            }
예제 #6
0
        public async Task ClearsDonatedIntents()
        {
            await interactor.Execute();

            IntentDonationService.Received().ClearAll();
        }
예제 #7
0
                public async void ShouldSetShortcutSuggestions()
                {
                    await ViewModel.Initialize();

                    IntentDonationService.Received().SetDefaultShortcutSuggestions(Arg.Any <IWorkspace>());
                }
예제 #8
0
        protected override void InitializeApp(IMvxPluginManager pluginManager, IMvxApplication app)
        {
#if !USE_PRODUCTION_API
            System.Net.ServicePointManager.ServerCertificateValidationCallback
                += (sender, certificate, chain, sslPolicyErrors) => true;
#endif

            const string clientName = "Daneel";
            const string remoteConfigDefaultsFileName = "RemoteConfigDefaults";
            var          version     = NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"].ToString();
            var          database    = new Database();
            var          scheduler   = Scheduler.Default;
            var          timeService = new TimeService(scheduler);
            var          topViewControllerProvider = (ITopViewControllerProvider)Presenter;
            var          mailService                 = new MailService(topViewControllerProvider);
            var          dialogService               = new DialogService(topViewControllerProvider);
            var          platformConstants           = new PlatformConstants();
            var          suggestionProviderContainer = new SuggestionProviderContainer(
                new MostUsedTimeEntrySuggestionProvider(database, timeService, maxNumberOfSuggestions)
                );
            var intentDonationService       = new IntentDonationService();
            var privateSharedStorageService = new PrivateSharedStorageService();

            var appVersion          = Version.Parse(version);
            var keyValueStorage     = new UserDefaultsStorage();
            var permissionsService  = new PermissionsService();
            var userAgent           = new UserAgent(clientName, version);
            var settingsStorage     = new SettingsStorage(Version.Parse(version), keyValueStorage);
            var remoteConfigService = new RemoteConfigService();
            remoteConfigService.SetupDefaults(remoteConfigDefaultsFileName);
            var schedulerProvider   = new IOSSchedulerProvider();
            var calendarService     = new CalendarService(permissionsService);
            var notificationService = new NotificationService(permissionsService, timeService);

            var foundation =
                TogglFoundation
                .ForClient(userAgent, appVersion)
                .WithDatabase(database)
                .WithScheduler(scheduler)
                .WithMailService(mailService)
                .WithTimeService(timeService)
                .WithApiEnvironment(environment)
                .WithGoogleService <GoogleService>()
                .WithRatingService <RatingService>()
                .WithLicenseProvider <LicenseProvider>()
                .WithAnalyticsService(analyticsService)
                .WithSchedulerProvider(schedulerProvider)
                .WithPlatformConstants(platformConstants)
                .WithRemoteConfigService(remoteConfigService)
                .WithNotificationService(notificationService)
                .WithApiFactory(new ApiFactory(environment, userAgent))
                .WithBackgroundService(new BackgroundService(timeService))
                .WithApplicationShortcutCreator <ApplicationShortcutCreator>()
                .WithSuggestionProviderContainer(suggestionProviderContainer)
                .WithIntentDonationService(intentDonationService)
                .WithPrivateSharedStorageService(privateSharedStorageService)
                .WithPlatformInfo(platformInfo)

                .StartRegisteringPlatformServices()
                .WithDialogService(dialogService)
                .WithLastTimeUsageStorage(settingsStorage)
                .WithBrowserService <BrowserService>()
                .WithKeyValueStorage(keyValueStorage)
                .WithUserPreferences(settingsStorage)
                .WithCalendarService(calendarService)
                .WithOnboardingStorage(settingsStorage)
                .WithNavigationService(navigationService)
                .WithPermissionsService(permissionsService)
                .WithAccessRestrictionStorage(settingsStorage)
                .WithPasswordManagerService <OnePasswordService>()
                .WithErrorHandlingService(new ErrorHandlingService(navigationService, settingsStorage))
                .WithFeedbackService(new FeedbackService(userAgent, mailService, dialogService, platformConstants))
                .Build();

            foundation.RevokeNewUserIfNeeded().Initialize();

            base.InitializeApp(pluginManager, app);
        }