FFMpegCore/FFMpegCore.Test/FFMpegOptionsTests.cs
Malte Rosenbjerg 693acabac4 Cleanup after splitting into two packages (#386)
* Move PosterWithAudio to FFMpegCore

* Reduce windows only tests

* Update Directory.Build.props

* Create .editorconfig

* More cleanup

* Enable implicit usings

* Remove unused method

* Apply dotnet format

* Fix unused variable in AudioGateArgument

* Fix boolean conditions in AudioGateArgument

* Merge boolean conditions into pattern

* Use target-typed new

* Add linting to CI

* Add CUDA to HardwareAccelerationDevice enum

* Increase timeout for Video_Join_Image_Sequence

* Adjust Video_Join_Image_Sequence timeout

* Fix expected seconds in Video_Join_Image_Sequence

* Increase timeout for Video_TranscodeToMemory due to macos agents

Former-commit-id: f9f7161686
2023-02-02 21:19:45 +01:00

48 lines
1.3 KiB
C#

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
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);
}
}
}
}