public async Task SendFromServerToEmptyClient() { var scopes = new[] { Scope.Icd, Scope.Reference }; var types = scopes.SelectMany(x => x.GetTypes()); var entitiesCount = new Dictionary <Type, int>(); object al = null; foreach (var type in types) { entitiesCount[type] = sSession.QueryOver(type.Name, () => al).RowCount(); } await s.SendFrom(Side.Server, scopes); // после загрузки проверяем справочные сущности на совпадение var checker = new AfterSyncChecker(clSession); checker.CheckReferenceEntitiesAfterDownload(s.AddedOnServerIdsPerType); foreach (var type in types) { Assert.AreEqual(entitiesCount[type], clSession.QueryOver(type.Name, () => al).RowCount()); } }
public async Task SyncVocsToLoad(ConnectionInfo remote, string local, IEnumerable <Vocabulary> vocsToLoad) { Contract.Requires(Constants.IsClient); var syncer = new Syncer( serverConStr: remote.ConnectionString, clientConStr: local, serverProviderName: remote.ProviderName); using (var s = NHib.OpenSession()) syncer = syncer.OnlySelectedVocs(s, vocsToLoad); Mouse.OverrideCursor = Cursors.AppStarting; await syncer.SendFrom(Side.Server, Scope.Voc); Mouse.OverrideCursor = null; }