public void Should_Sync_With_DB() { using (DatabaseDataContext db = new DatabaseDataContext()) { // TODO: Load all assemblies foreach (AssemblyInfo info in db.AssemblyInfo_Get(null, null, null, null, null, null, null, true)) { PluginLoader.Add(info.Version + ", " + info.Name, info.ReadURL); // Add AssemblyIdentifier !!!!!!!!!!!!!! } } using (IJobManager mgr = new JobManager()) { bool isSynced = false; mgr.SynchronizeOnce(); mgr.SyncCompleted += (sender, eventArgs) => isSynced = true; Timing.WaitUntil(() => isSynced, 10000, "Wait til JobManager is synced"); foreach (Data.Job job in _DB.Job_GetUnfinishedJobs()) { if (!mgr.ContainsKey(job.ID)) Assert.Fail(); } } }