From 54e28cea23a5c9c8999c66cf106ad59858d97174 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Fri, 17 Oct 2025 15:15:02 +0200 Subject: [PATCH] Use subfolder in temp folder for testing download of binaries --- FFMpegCore.Test/DownloaderTests.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/FFMpegCore.Test/DownloaderTests.cs b/FFMpegCore.Test/DownloaderTests.cs index 7c045d6..bc2208c 100644 --- a/FFMpegCore.Test/DownloaderTests.cs +++ b/FFMpegCore.Test/DownloaderTests.cs @@ -7,11 +7,20 @@ namespace FFMpegCore.Test; [TestClass] public class DownloaderTests { + private FFOptions _ffOptions; + + [TestInitialize] + public void InitializeTestFolder() + { + var tempDownloadFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); + Directory.CreateDirectory(tempDownloadFolder); + _ffOptions = new FFOptions { BinaryFolder = Path.GetTempPath() }; + } + [OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)] public async Task GetSpecificVersionTest() { - var options = new FFOptions { BinaryFolder = Path.GetTempPath() }; - var binaries = await FFMpegDownloader.DownloadBinaries(FFMpegVersions.V6_1, options: options); + var binaries = await FFMpegDownloader.DownloadBinaries(FFMpegVersions.V6_1, options: _ffOptions); try { Assert.HasCount(2, binaries); @@ -25,8 +34,7 @@ public class DownloaderTests [OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)] public async Task GetAllLatestSuiteTest() { - var options = new FFOptions { BinaryFolder = Path.GetTempPath() }; - var binaries = await FFMpegDownloader.DownloadBinaries(options: options); + var binaries = await FFMpegDownloader.DownloadBinaries(options: _ffOptions); try { Assert.HasCount(2, binaries);