public void GetRepositoriesToList_NoRepositoriesKnown_GivesUsb() { _synchronizer.ExtraRepositorySources.Clear(); _model = new SyncControlModel(_project, SyncUIFeatures.Advanced, null); _model.AddMessagesDisplay(_progress); Assert.AreEqual(1, _model.GetRepositoriesToList().Count); }
public void Setup() { _progress = new StringBuilderProgress(); _pathToTestRoot = Path.Combine(Path.GetTempPath(), "ChorusTest"); Directory.CreateDirectory(_pathToTestRoot); string pathToText = Path.Combine(_pathToTestRoot, "foo.txt"); File.WriteAllText(pathToText, "version one of my pretend txt"); RepositorySetup.MakeRepositoryForTest(_pathToTestRoot, "bob",_progress); _project = new ProjectFolderConfiguration(_pathToTestRoot); _project.FolderPath = _pathToTestRoot; _project.IncludePatterns.Add(pathToText); _project.FolderPath = _pathToTestRoot; _synchronizer = Synchronizer.FromProjectConfiguration(_project, new NullProgress()); _model = new SyncControlModel(_project, SyncUIFeatures.Advanced,null); _model.AddMessagesDisplay(_progress); }
public void Sync_NonExistantLangDepotProject_ExitsGracefullyWithCorrectErrorResult() { _model = new SyncControlModel(_project, SyncUIFeatures.Minimal, null); _model.SyncOptions.RepositorySourcesToTry.Add(RepositoryAddress.Create("languageforge", "http://hg-public.languagedepot.org/dummy")); var progress = new ConsoleProgress() {ShowVerbose = true}; _model.AddMessagesDisplay(progress); SyncResults results = null; _model.SynchronizeOver += new EventHandler((sender, e) => results = (sender as SyncResults)); _model.Sync(true); var start = DateTime.Now; while (results == null) { Thread.Sleep(100); Application.DoEvents(); //else the background worker may starve if ((DateTime.Now.Subtract(start).Minutes > 1)) { Assert.Fail("Gave up waiting."); } } Assert.IsFalse(results.Succeeded); Assert.IsNotNull(results.ErrorEncountered); }