From 931e415e140e27c42326d0c754aa9c82d6cd10d2 Mon Sep 17 00:00:00 2001 From: gtryus Date: Thu, 15 Feb 2018 12:29:18 -0600 Subject: [PATCH] Adjust Unit test code for other uses of CommonAppDataFolder --- .../MediaUtils/FFmpeg/FFmpegDownloadHelper.cs | 13 +------------ src/SayMore/Program.cs | 7 ++++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/SayMore/MediaUtils/FFmpeg/FFmpegDownloadHelper.cs b/src/SayMore/MediaUtils/FFmpeg/FFmpegDownloadHelper.cs index abd26bc61..9d64309ad 100644 --- a/src/SayMore/MediaUtils/FFmpeg/FFmpegDownloadHelper.cs +++ b/src/SayMore/MediaUtils/FFmpeg/FFmpegDownloadHelper.cs @@ -53,18 +53,7 @@ public static string FFmpegForSayMoreFolder } /// ------------------------------------------------------------------------------------ - public static string FFmpegForSayMoreParentFolder - { - get - { -#if DEBUG - //Program.CommonAppDataFolder; gives some resharper folder during tests - return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),"SIL/SayMore"); -#else - return Program.CommonAppDataFolder; -#endif - } - } + public static string FFmpegForSayMoreParentFolder => Program.CommonAppDataFolder; /// ------------------------------------------------------------------------------------ public static string FullPathToFFmpegForSayMoreExe diff --git a/src/SayMore/Program.cs b/src/SayMore/Program.cs index 754f7d8b0..3a74b6e5d 100644 --- a/src/SayMore/Program.cs +++ b/src/SayMore/Program.cs @@ -368,7 +368,7 @@ public static void ArchiveProjectUsingIMDI(Form parentForm) public static List FileLoadErrors { - get + get { if (_projectContext == null || _projectContext.Project == null) // This can happen during unit testing return new List(0); @@ -422,7 +422,12 @@ public static string SilCommonDataFolder /// ------------------------------------------------------------------------------------ public static string CommonAppDataFolder { + //Application.ProductName gives some resharper folder during tests +#if DEBUG + get { return Path.Combine(SilCommonDataFolder, "Saymore"); } +#else get { return Path.Combine(SilCommonDataFolder, Application.ProductName); } +#endif } /// ------------------------------------------------------------------------------------