2023-04-12 05:55:30 +02:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using FFMpegCore.Helpers;
|
2023-04-12 06:42:51 +02:00
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
2023-04-12 05:55:30 +02:00
|
|
|
|
|
|
|
|
|
namespace FFMpegCore.Test;
|
|
|
|
|
|
2023-04-12 06:42:51 +02:00
|
|
|
|
[TestClass]
|
2023-04-12 05:55:30 +02:00
|
|
|
|
public class DownloaderTests
|
|
|
|
|
{
|
2023-04-12 06:42:51 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestSuiteTest()
|
|
|
|
|
{
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
|
|
|
|
var fileNames = FFMpegDownloader.AutoDownloadFFMpegSuite();
|
|
|
|
|
Assert.IsTrue(fileNames.Count == 3);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestFFMpegTest()
|
2023-04-12 05:55:30 +02:00
|
|
|
|
{
|
2023-04-12 06:42:51 +02:00
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
|
|
|
|
var fileNames = FFMpegDownloader.AutoDownloadFFMpeg();
|
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestFFProbeTest()
|
|
|
|
|
{
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
|
|
|
|
var fileNames = FFMpegDownloader.AutoDownloadFFProbe();
|
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestFFPlayTest()
|
|
|
|
|
{
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
|
|
|
|
var fileNames = FFMpegDownloader.AutoDownloadFFPlay();
|
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
2023-04-12 05:55:30 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|