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))
|
|
|
|
|
{
|
2023-05-05 09:30:52 +02:00
|
|
|
|
var fileNames = FFMpegDownloader.DownloadFFMpegSuite();
|
2023-04-12 06:42:51 +02:00
|
|
|
|
Assert.IsTrue(fileNames.Count == 3);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-05 09:54:50 +02:00
|
|
|
|
|
2023-04-12 06:42:51 +02:00
|
|
|
|
[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))
|
|
|
|
|
{
|
2023-05-05 09:30:52 +02:00
|
|
|
|
var fileNames = FFMpegDownloader.DownloadFFMpeg();
|
2023-04-12 06:42:51 +02:00
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-05 09:54:50 +02:00
|
|
|
|
|
2023-04-12 06:42:51 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestFFProbeTest()
|
|
|
|
|
{
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
2023-05-05 09:30:52 +02:00
|
|
|
|
var fileNames = FFMpegDownloader.DownloadFFProbe();
|
2023-04-12 06:42:51 +02:00
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-05 09:54:50 +02:00
|
|
|
|
|
2023-04-12 06:42:51 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetLatestFFPlayTest()
|
|
|
|
|
{
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
|
|
{
|
2023-05-05 09:30:52 +02:00
|
|
|
|
var fileNames = FFMpegDownloader.DownloadFFPlay();
|
2023-04-12 06:42:51 +02:00
|
|
|
|
Assert.IsTrue(fileNames.Count == 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Assert.Inconclusive("This test is only for Windows");
|
2023-04-12 05:55:30 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|