mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
commit
bd55ec2a51
7 changed files with 32 additions and 37 deletions
|
|
@ -682,4 +682,25 @@ public class ArgumentBuilderTest
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
Assert.ThrowsExactly<FileNotFoundException>(() => argument.Pre());
|
Assert.ThrowsExactly<FileNotFoundException>(() => argument.Pre());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Concat_Escape()
|
||||||
|
{
|
||||||
|
var arg = new DemuxConcatArgument([@"Heaven's River\05 - Investigation.m4b"]);
|
||||||
|
CollectionAssert.AreEquivalent(new[] { @"file 'Heaven'\''s River\05 - Investigation.m4b'" }, arg.Values.ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Audible_Aaxc_Test()
|
||||||
|
{
|
||||||
|
var arg = new AudibleEncryptionKeyArgument("123", "456");
|
||||||
|
Assert.AreEqual("-audible_key 123 -audible_iv 456", arg.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Audible_Aax_Test()
|
||||||
|
{
|
||||||
|
var arg = new AudibleEncryptionKeyArgument("62689101");
|
||||||
|
Assert.AreEqual("-activation_bytes 62689101", arg.Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
[assembly: Parallelize]
|
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using FFMpegCore.Arguments;
|
namespace FFMpegCore.Test;
|
||||||
|
|
||||||
namespace FFMpegCore.Test;
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class FFMpegArgumentProcessorTest
|
public class FFMpegArgumentProcessorTest
|
||||||
|
|
@ -13,7 +11,7 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Processor_GlobalOptions_GetUsed()
|
public void ZZZ_Processor_GlobalOptions_GetUsed()
|
||||||
{
|
{
|
||||||
var globalWorkingDir = "Whatever";
|
var globalWorkingDir = "Whatever";
|
||||||
var processor = CreateArgumentProcessor();
|
var processor = CreateArgumentProcessor();
|
||||||
|
|
@ -45,7 +43,7 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Processor_Options_CanBeOverridden_And_Configured()
|
public void ZZZ_Processor_Options_CanBeOverridden_And_Configured()
|
||||||
{
|
{
|
||||||
var globalConfig = "Whatever";
|
var globalConfig = "Whatever";
|
||||||
|
|
||||||
|
|
@ -75,7 +73,7 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Options_Global_And_Session_Options_Can_Differ()
|
public void ZZZ_Options_Global_And_Session_Options_Can_Differ()
|
||||||
{
|
{
|
||||||
var globalWorkingDir = "Whatever";
|
var globalWorkingDir = "Whatever";
|
||||||
|
|
||||||
|
|
@ -97,25 +95,4 @@ public class FFMpegArgumentProcessorTest
|
||||||
GlobalFFOptions.Configure(new FFOptions());
|
GlobalFFOptions.Configure(new FFOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Concat_Escape()
|
|
||||||
{
|
|
||||||
var arg = new DemuxConcatArgument([@"Heaven's River\05 - Investigation.m4b"]);
|
|
||||||
CollectionAssert.AreEquivalent(new[] { @"file 'Heaven'\''s River\05 - Investigation.m4b'" }, arg.Values.ToArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Audible_Aaxc_Test()
|
|
||||||
{
|
|
||||||
var arg = new AudibleEncryptionKeyArgument("123", "456");
|
|
||||||
Assert.AreEqual("-audible_key 123 -audible_iv 456", arg.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Audible_Aax_Test()
|
|
||||||
{
|
|
||||||
var arg = new AudibleEncryptionKeyArgument("62689101");
|
|
||||||
Assert.AreEqual("-activation_bytes 62689101", arg.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<Nullable>disable</Nullable>
|
<Nullable>disable</Nullable>
|
||||||
<LangVersion>default</LangVersion>
|
<LangVersion>default</LangVersion>
|
||||||
|
<OrderTestsByNameInClass>true</OrderTestsByNameInClass>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,16 @@ public class FFMpegOptionsTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Options_Set_Programmatically()
|
public void ZZZ_Options_Set_Programmatically()
|
||||||
{
|
{
|
||||||
var original = GlobalFFOptions.Current;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "Whatever" });
|
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "Whatever" });
|
||||||
Assert.AreEqual(
|
Assert.AreEqual("Whatever", GlobalFFOptions.Current.BinaryFolder);
|
||||||
"Whatever",
|
|
||||||
GlobalFFOptions.Current.BinaryFolder
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
GlobalFFOptions.Configure(original);
|
GlobalFFOptions.Configure(new FFOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -824,7 +824,6 @@ public class VideoTest
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
var dataReceived = false;
|
var dataReceived = false;
|
||||||
|
|
||||||
GlobalFFOptions.Configure(opt => opt.Encoding = Encoding.UTF8);
|
|
||||||
var success = FFMpegArguments
|
var success = FFMpegArguments
|
||||||
.FromFileInput(TestResources.Mp4Video)
|
.FromFileInput(TestResources.Mp4Video)
|
||||||
.WithGlobalOptions(options => options
|
.WithGlobalOptions(options => options
|
||||||
|
|
@ -832,6 +831,7 @@ public class VideoTest
|
||||||
.OutputToFile(outputFile, false, opt => opt
|
.OutputToFile(outputFile, false, opt => opt
|
||||||
.WithDuration(TimeSpan.FromSeconds(2)))
|
.WithDuration(TimeSpan.FromSeconds(2)))
|
||||||
.NotifyOnError(_ => dataReceived = true)
|
.NotifyOnError(_ => dataReceived = true)
|
||||||
|
.Configure(opt => opt.Encoding = Encoding.UTF8)
|
||||||
.ProcessSynchronously();
|
.ProcessSynchronously();
|
||||||
|
|
||||||
Assert.IsTrue(dataReceived);
|
Assert.IsTrue(dataReceived);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"RootDirectory": ""
|
"BinaryFolder": ""
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue