mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
Use subfolder in temp folder for testing download of binaries
This commit is contained in:
parent
2a25bff836
commit
54e28cea23
1 changed files with 12 additions and 4 deletions
|
|
@ -7,11 +7,20 @@ namespace FFMpegCore.Test;
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class DownloaderTests
|
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)]
|
[OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)]
|
||||||
public async Task GetSpecificVersionTest()
|
public async Task GetSpecificVersionTest()
|
||||||
{
|
{
|
||||||
var options = new FFOptions { BinaryFolder = Path.GetTempPath() };
|
var binaries = await FFMpegDownloader.DownloadBinaries(FFMpegVersions.V6_1, options: _ffOptions);
|
||||||
var binaries = await FFMpegDownloader.DownloadBinaries(FFMpegVersions.V6_1, options: options);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.HasCount(2, binaries);
|
Assert.HasCount(2, binaries);
|
||||||
|
|
@ -25,8 +34,7 @@ public class DownloaderTests
|
||||||
[OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)]
|
[OsSpecificTestMethod(OsPlatforms.Windows | OsPlatforms.Linux)]
|
||||||
public async Task GetAllLatestSuiteTest()
|
public async Task GetAllLatestSuiteTest()
|
||||||
{
|
{
|
||||||
var options = new FFOptions { BinaryFolder = Path.GetTempPath() };
|
var binaries = await FFMpegDownloader.DownloadBinaries(options: _ffOptions);
|
||||||
var binaries = await FFMpegDownloader.DownloadBinaries(options: options);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.HasCount(2, binaries);
|
Assert.HasCount(2, binaries);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue