Exemplo n.º 1
0
 public SyncControl(SyncControlModel model)
     : this()
 {
     Model = model;
     _logBox.GetDiagnosticsMethod = model.GetDiagnostics;
     UpdateDisplay();
 }
Exemplo n.º 2
0
 public SyncControl(SyncControlModel model)
     : this()
 {
     Model = model;
     _logBox.GetDiagnosticsMethod = model.GetDiagnostics;
     UpdateDisplay();
 }
Exemplo n.º 3
0
 public void GetRepositoriesToList_NoRepositoriesKnown_GivesUsb()
 {
     _synchronizer.ExtraRepositorySources.Clear();
     _model = new SyncControlModel(_project, SyncUIFeatures.Advanced, null);
     _model.AddMessagesDisplay(_progress);
     Assert.AreEqual(1, _model.GetRepositoriesToList().Count);
 }
Exemplo n.º 4
0
        public SyncPanel(SyncControlModel model)
        {
            this.Font = SystemFonts.MessageBoxFont;
            _syncControl = new SyncControl(model);
            _syncControl.Location= new Point(25, 40);
            _syncControl.Anchor = AnchorStyles.Top | AnchorStyles.Left;

            this.Controls.Add(_syncControl);
            InitializeComponent();
            // UpdateDisplay();
        }
Exemplo n.º 5
0
        public SyncPanel(SyncControlModel model)
        {
            this.Font             = SystemFonts.MessageBoxFont;
            _syncControl          = new SyncControl(model);
            _syncControl.Location = new Point(25, 40);
            _syncControl.Anchor   = AnchorStyles.Top | AnchorStyles.Left;


            this.Controls.Add(_syncControl);
            InitializeComponent();
            // UpdateDisplay();
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 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);
 }