Exemplo n.º 1
0
        public void Download_Subversion_IncludeFiles_ExcludeFolder()
        {
            //Create the excludefilter
            var filefilter   = new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.IncludedFilesFilter, "*.cs");
            var folderfilter = new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.ExcludedFilesFilter, _subFolderLogging + "\\");
            var settings     = new DependencyService.Settings <DownloaderValidSettings>();

            settings.AddSetting(filefilter);
            settings.AddSetting(folderfilter);
            settings.AddSetting(new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.VersionString, "H"));

            var sourceDir = string.Format("{0}/{1}", _svnSrcPath, _componentA);

            IDependencyDownloaderFactory df         = new DownloaderFactory();
            IDependencyDownloader        downloader = df.GetDownloader("Downloader_Subversion");

            downloader.Download(sourceDir, _downloadDir, new DummyWatermark(), false, settings);

            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, "Class1.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, "Class2.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, "Class3.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, "Class4.cs")));
            //The targets file should not be there
            Assert.IsFalse(File.Exists(Path.Combine(_downloadDir, "component.targets")));
            //The subfolder Logging should no be there, too
            Assert.IsFalse(File.Exists(Path.Combine(_downloadDir, _subFolderLogging, "LoggingClass.cs")));
        }
Exemplo n.º 2
0
        public void Download_Subversion_FolderMappingsMoveToSubfolder()
        {
            var targetFolder = @"libs\ComponentA_V10";

            var settings = new DependencyService.Settings <DownloaderValidSettings>();
            //Create the folder mapping
            var mappings = new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.FolderMappings, string.Format("SourceOffset={0}/{1},LocalOffset=.//", _componentA, _subFolderLogging));

            settings.AddSetting(mappings);
            settings.AddSetting(new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.VersionString, "H"));

            var sourceDir = string.Format("{0}/{1}", _svnSrcPath, _componentA);

            IDependencyDownloaderFactory df         = new DownloaderFactory();
            IDependencyDownloader        downloader = df.GetDownloader("Downloader_Subversion");

            downloader.Download(sourceDir, _downloadDir, new DummyWatermark(), false, settings);

            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "ComponentA.1_0.dll")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "component.targets")));
        }
Exemplo n.º 3
0
        public void Download_Subversion_FolderMappingsRenameFolderSameLevel()
        {
            var targetFolder = "ComponentA_renamed";

            var settings = new DependencyService.Settings <DownloaderValidSettings>();
            //Create the folder mapping
            var mappings = new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.FolderMappings, string.Format("SourceOffset={0},LocalOffset={1};", _componentA, targetFolder));

            settings.AddSetting(mappings);
            settings.AddSetting(new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.VersionString, "H"));

            IDependencyDownloaderFactory df         = new DownloaderFactory();
            IDependencyDownloader        downloader = df.GetDownloader("Downloader_Subversion");

            downloader.Download(_svnSrcPath, _downloadDir, new DummyWatermark(), false, settings);

            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "Class1.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "Class2.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "Class3.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "Class4.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, "component.targets")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, targetFolder, _subFolderLogging, "LoggingClass.cs")));
        }
Exemplo n.º 4
0
        public void Download_Subversion_FolderWithExternals()
        {
            var sourceDir = string.Format("{0}/{1}", _svnSrcPath, _componentWithExternals);

            var settings = new DependencyService.Settings <DownloaderValidSettings>();

            settings.AddSetting(new KeyValuePair <DownloaderValidSettings, string>(DownloaderValidSettings.VersionString, "H"));

            IDependencyDownloaderFactory df         = new DownloaderFactory();
            IDependencyDownloader        downloader = df.GetDownloader("Downloader_Subversion");

            downloader.Download(sourceDir, _downloadDir, new DummyWatermark(), false, settings);

            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, "UsingCommon.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, "Common1.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, "Common2.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, "Common3.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, _subFolderSubCommon, "SubCommon1.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, _subFolderSubCommon, "SubCommon2.cs")));
            Assert.IsTrue(File.Exists(Path.Combine(_downloadDir, _subFolderCommon, _subFolderSubCommon, "SubCommon3.cs")));
        }