diff --git a/FFMpegCore.Extensions.Downloader/Enums/EnumExtensions.cs b/FFMpegCore.Extensions.Downloader/Enums/EnumExtensions.cs deleted file mode 100644 index 7743820..0000000 --- a/FFMpegCore.Extensions.Downloader/Enums/EnumExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace FFMpegCore.Extensions.Downloader.Enums; - -public static class EnumExtensions -{ - public static TEnum[] GetFlags(this TEnum input) where TEnum : Enum - { - return Enum.GetValues(input.GetType()) - .Cast() - .Where(input.HasFlag) - .Cast() - .ToArray(); - } -} diff --git a/FFMpegCore.Extensions.Downloader/Extensions/EnumExtensions.cs b/FFMpegCore.Extensions.Downloader/Extensions/EnumExtensions.cs index 7930c13..3336f11 100644 --- a/FFMpegCore.Extensions.Downloader/Extensions/EnumExtensions.cs +++ b/FFMpegCore.Extensions.Downloader/Extensions/EnumExtensions.cs @@ -2,9 +2,9 @@ namespace FFMpegCore.Extensions.Downloader.Extensions; -internal static class EnumExtensions +public static class EnumExtensions { - public static string GetDescription(this Enum enumValue) + internal static string GetDescription(this Enum enumValue) { var field = enumValue.GetType().GetField(enumValue.ToString()); if (field == null) @@ -19,4 +19,13 @@ internal static class EnumExtensions return enumValue.ToString(); } + + public static TEnum[] GetFlags(this TEnum input) where TEnum : Enum + { + return Enum.GetValues(input.GetType()) + .Cast() + .Where(input.HasFlag) + .Cast() + .ToArray(); + } } diff --git a/FFMpegCore.Test/DownloaderTests.cs b/FFMpegCore.Test/DownloaderTests.cs index 7acf30a..a1a92a8 100644 --- a/FFMpegCore.Test/DownloaderTests.cs +++ b/FFMpegCore.Test/DownloaderTests.cs @@ -10,7 +10,8 @@ public class DownloaderTests [OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)] public async Task GetSpecificVersionTest() { - var binaries = await FFMpegDownloader.DownloadFFMpegSuite(FFMpegVersions.V6_1); + var options = new FFOptions { BinaryFolder = Path.GetTempPath() }; + var binaries = await FFMpegDownloader.DownloadFFMpegSuite(FFMpegVersions.V6_1, options: options); try { Assert.HasCount(2, binaries); @@ -21,10 +22,11 @@ public class DownloaderTests } } - [OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)] + [TestMethod] public async Task GetAllLatestSuiteTest() { - var binaries = await FFMpegDownloader.DownloadFFMpegSuite(); + var options = new FFOptions { BinaryFolder = Path.GetTempPath() }; + var binaries = await FFMpegDownloader.DownloadFFMpegSuite(options: options); try { Assert.HasCount(2, binaries); diff --git a/FFMpegCore.Test/Utilities/OsSpecificTestMethod.cs b/FFMpegCore.Test/Utilities/OsSpecificTestMethod.cs index b3563a9..d03eb27 100644 --- a/FFMpegCore.Test/Utilities/OsSpecificTestMethod.cs +++ b/FFMpegCore.Test/Utilities/OsSpecificTestMethod.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using FFMpegCore.Extensions.Downloader.Enums; +using FFMpegCore.Extensions.Downloader.Extensions; namespace FFMpegCore.Test.Utilities;