mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using Newtonsoft.Json;
|
|
using System.IO;
|
|
|
|
namespace FFMpegCore.Test
|
|
{
|
|
[TestClass]
|
|
public class FFMpegOptionsTest
|
|
{
|
|
[TestMethod]
|
|
public void Options_Initialized()
|
|
{
|
|
Assert.IsNotNull(GlobalFFOptions.Current);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Options_Defaults_Configured()
|
|
{
|
|
Assert.AreEqual(new FFOptions().BinaryFolder, $"");
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Options_Loaded_From_File()
|
|
{
|
|
Assert.AreEqual(
|
|
GlobalFFOptions.Current.BinaryFolder,
|
|
JsonConvert.DeserializeObject<FFOptions>(File.ReadAllText("ffmpeg.config.json")).BinaryFolder
|
|
);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Options_Set_Programmatically()
|
|
{
|
|
var original = GlobalFFOptions.Current;
|
|
try
|
|
{
|
|
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "Whatever" });
|
|
Assert.AreEqual(
|
|
GlobalFFOptions.Current.BinaryFolder,
|
|
"Whatever"
|
|
);
|
|
}
|
|
finally
|
|
{
|
|
GlobalFFOptions.Configure(original);
|
|
}
|
|
}
|
|
}
|
|
}
|