Exemplo n.º 1
0
 protected override void EstablishNewSession()
 {
     base.EstablishNewSession();
     WaitDesktopIsReady();
     DataStore.AddTypeSafe <SyncSessionInfo>();
     SyncSession = SyncSessionInfo.Create(DataStore, DateTimeManager);
     Transport.Send(SyncSession as SyncSessionInfo);
 }
Exemplo n.º 2
0
        public static void InitSyncSessionInfo(IDataStore datastore, IDateTimeManager dateTimeProvider)
        {
            var session = SyncSessionInfo.Create(dateTimeProvider, null);

            session.HasSuccess = true;
            var syncSessionRepo = new SyncSessionInfoRepository(datastore);

            datastore.AddTypeSafe <SyncSessionInfo>();
            syncSessionRepo.Save(session);
        }
Exemplo n.º 3
0
        public void Create_SecondSync_LowBoundShouldEqualHighOfLastSuccess()
        {
            var last = SyncSessionInfo.Create(Desktop.DataStore, SyncDateTimeProvider);

            last.HasSuccess = true;
            SyncSessionRepository.Save(last);

            SomeTimeLater();
            last            = SyncSessionInfo.Create(Desktop.DataStore, SyncDateTimeProvider);
            last.HasSuccess = true;
            SyncSessionRepository.Save(last);

            SomeTimeLater();
            var result = SyncSessionInfo.Create(Desktop.DataStore, SyncDateTimeProvider);

            Assert.AreEqual(last.HighBoundaryAnchor, result.LowBoundaryAnchor);
        }
Exemplo n.º 4
0
        public void Create_FirstSync_LowBoundShouldEqualMinSyncDate()
        {
            var result = SyncSessionInfo.Create(Desktop.DataStore, SyncDateTimeProvider);

            Assert.AreEqual(new DateTime(1973, 1, 1, 0, 0, 0, DateTimeKind.Utc), result.LowBoundaryAnchor);
        }