Esempio n. 1
0
        public RepositorySetup(string userName, bool makeRepository)
        {
            Init(userName);

            ProjectFolder = new TemporaryFolder(RootFolder, ProjectName);

            if (makeRepository)
            {
                RepositorySetup.MakeRepositoryForTest(ProjectFolder.Path, userName, Progress);
            }
            else
            {
                // Remove the folder to make way for a clone which requires the folder to be not present.
                Directory.Delete(ProjectFolder.Path);
            }
            ProjectFolderConfig = new ProjectFolderConfiguration(ProjectFolder.Path);
        }
Esempio n. 2
0
        public RepositoryWithFilesSetup(string userName, string fileName, string fileContents)
        {
            Progress      = new MultiProgress(new IProgress[] { new ConsoleProgress(), _stringProgress });
            RootFolder    = new TemporaryFolder("ChorusTest-" + userName + "-" + Guid.NewGuid());
            ProjectFolder = new TemporaryFolder(RootFolder, "foo project");
            Console.WriteLine("TestRepository Created: {0}", RootFolder.Path);
            var p = ProjectFolder.Combine(fileName);

            File.WriteAllText(p, fileContents);
            UserFile = TempFile.TrackExisting(p);

            RepositorySetup.MakeRepositoryForTest(ProjectFolder.Path, userName, Progress);
            Init(userName);
            SyncOptions options = new SyncOptions();

            options.DoMergeWithOthers = false;
            options.DoPullFromOthers  = false;
            options.DoSendToOthers    = false;
            Synchronizer.SyncNow(options);
        }