mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
|
using FFMpegCore.FFMPEG;
|
|||
|
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(FFMpegOptions.Options);
|
|||
|
}
|
|||
|
|
|||
|
[TestMethod]
|
|||
|
public void Options_Defaults_Configured()
|
|||
|
{
|
|||
|
Assert.AreEqual(new FFMpegOptions().RootDirectory, ".\\FFMPEG\\bin");
|
|||
|
}
|
|||
|
|
|||
|
[TestMethod]
|
|||
|
public void Options_Loaded_From_File()
|
|||
|
{
|
|||
|
Assert.AreEqual(
|
|||
|
FFMpegOptions.Options.RootDirectory,
|
|||
|
JsonConvert.DeserializeObject<FFMpegOptions>(File.ReadAllText(".\\ffmpeg.config.json")).RootDirectory
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
[TestMethod]
|
|||
|
public void Options_Overrided()
|
|||
|
{
|
|||
|
var original = FFMpegOptions.Options;
|
|||
|
try
|
|||
|
{
|
|||
|
FFMpegOptions.Configure(new FFMpegOptions { RootDirectory = "Whatever" });
|
|||
|
Assert.AreEqual(
|
|||
|
FFMpegOptions.Options.RootDirectory,
|
|||
|
"Whatever"
|
|||
|
);
|
|||
|
}
|
|||
|
finally
|
|||
|
{
|
|||
|
FFMpegOptions.Configure(original);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|