Esempio n. 1
0
            public async Task SubscribesToResumingFromBackgroundSignal()
            {
                AutomaticSyncingService.Start(SyncManager);
                AppResumedFromBackground.OnNext(Foundation.Services.AutomaticSyncingService.MinimumTimeInBackgroundForFullSync);

                await SyncManager.Received().ForceFullSync();
            }
Esempio n. 2
0
            public async Task StopsWhenSyncManagerFails()
            {
                var midnightSubject = new Subject <DateTimeOffset>();

                TimeService.MidnightObservable.Returns(midnightSubject);

                AutomaticSyncingService.Start(SyncManager);
                midnightSubject.OnNext(new DateTimeOffset(2018, 12, 17, 00, 00, 00, TimeSpan.Zero));

                await SyncManager.Received().CleanUp();
            }
Esempio n. 3
0
            public async Task UnsubscribesFromTheSignalWhenStopped()
            {
                var subject = new Subject <TimeSpan>();

                BackgroundService.AppResumedFromBackground.Returns(subject.AsObservable());
                var errors = Observable.Never <Exception>();

                SyncManager.Errors.Returns(errors);

                AutomaticSyncingService.Start(SyncManager);
                SyncManager.ClearReceivedCalls();
                AutomaticSyncingService.Stop();

                subject.OnNext(Foundation.Services.AutomaticSyncingService.MinimumTimeInBackgroundForFullSync);

                await SyncManager.DidNotReceive().ForceFullSync();
            }