mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using FFMpegCore.Extensions.Downloader;
|
|
using FFMpegCore.Extensions.Downloader.Enums;
|
|
using FFMpegCore.Test.Utilities;
|
|
|
|
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 = tempDownloadFolder };
|
|
}
|
|
|
|
[OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)]
|
|
public async Task GetSpecificVersionTest()
|
|
{
|
|
var binaries = await FFMpegDownloader.DownloadBinaries(FFMpegVersions.V6_1, options: _ffOptions);
|
|
try
|
|
{
|
|
Assert.HasCount(2, binaries);
|
|
}
|
|
finally
|
|
{
|
|
binaries.ForEach(File.Delete);
|
|
}
|
|
}
|
|
|
|
[OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)]
|
|
public async Task GetAllLatestSuiteTest()
|
|
{
|
|
var binaries = await FFMpegDownloader.DownloadBinaries(options: _ffOptions);
|
|
try
|
|
{
|
|
Assert.HasCount(2, binaries);
|
|
}
|
|
finally
|
|
{
|
|
binaries.ForEach(File.Delete);
|
|
}
|
|
}
|
|
}
|