Exemple #1
0
        public static string GetDownloadFolderFor(TransmissionPath trans)
        {
            ensureInitialized();
            var key = string.Format("{0}DownloadFolder", trans);

            return(_config.GetSettingBasedOnTestMode(key));
        }
Exemple #2
0
        public static string DownloadFolder(this IAFPSTConfiguration config)
        {
            var folder = config.GetSettingBasedOnTestMode("DownloadFolder");

            if (Directory.Exists(folder))
            {
                return(folder);
            }

            //Folder doesn't exist, maybe we're running an Integration Test
            //Let's See if we can figure it out.
            bool isRealativePath             = folder.StartsWith(".");
            bool isRunningTestInVisualStudio = Directory.GetCurrentDirectory().EndsWith("Debug");

            if (isRunningTestInVisualStudio && isRealativePath)
            {
                //Let's try babacking up a couple directories
                var newfolder = @"..\..\" + folder;
                if (Directory.Exists(newfolder))
                {
                    return(newfolder);
                }
            }

            throw new ConfigurationErrorsException(string.Format("The DownloadFolder '{0}' does not exist.", folder));
        }
Exemple #3
0
 public static string GetUploadFolderFor(this IAFPSTConfiguration config, TransmissionPath path)
 {
     return(config.GetSettingBasedOnTestMode(string.Format("{0}UploadFolder", path)));
 }
Exemple #4
0
 public static string GetUploadFolderFor(this IAFPSTConfiguration config, string partnerCode)
 {
     return(config.GetSettingBasedOnTestMode(string.Format("{0}UploadFolder", partnerCode)));
 }
Exemple #5
0
 public static string ArchiveFolder(this IAFPSTConfiguration config)
 {
     return(config.GetSettingBasedOnTestMode("ArchiveFolder"));
 }
Exemple #6
0
 public static string EmailServiceEndpoint(this IAFPSTConfiguration config)
 {
     return(config.GetSettingBasedOnTestMode("EmailServiceEndpoint"));
 }
Exemple #7
0
 public static bool RecreateTables(this IAFPSTConfiguration config)
 {
     return(config.GetSettingBasedOnTestMode("RecreateTables") != "0");
 }