protected override void EstablishNewSession() { base.EstablishNewSession(); WaitDesktopIsReady(); DataStore.AddTypeSafe <SyncSessionInfo>(); SyncSession = SyncSessionInfo.Create(DataStore, DateTimeManager); Transport.Send(SyncSession as SyncSessionInfo); }
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); }
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); }
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); }