Tests: add video with only audio stream test

This commit is contained in:
Vlad Jerca 2019-04-01 12:56:50 +03:00
parent 3e856845ae
commit c2004fc549
4 changed files with 14 additions and 0 deletions

View file

@ -30,6 +30,9 @@
<None Update="Resources\audio.mp3">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\audio_only.mp4">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\cover.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

View file

@ -17,6 +17,7 @@ public enum ImageType
public static class VideoLibrary
{
public static readonly FileInfo LocalVideo = new FileInfo(".\\Resources\\input.mp4");
public static readonly FileInfo LocalVideoAudioOnly = new FileInfo(".\\Resources\\audio_only.mp4");
public static readonly FileInfo LocalVideoNoAudio = new FileInfo(".\\Resources\\mute.mp4");
public static readonly FileInfo LocalAudio = new FileInfo(".\\Resources\\audio.mp3");
public static readonly FileInfo LocalCover = new FileInfo(".\\Resources\\cover.png");

Binary file not shown.

View file

@ -308,5 +308,15 @@ public void Video_Join_Image_Sequence()
}
}
}
[TestMethod]
public void Video_With_Only_Audio_Should_Extract_Metadata()
{
var video = VideoInfo.FromFileInfo(VideoLibrary.LocalVideoAudioOnly);
Assert.AreEqual(video.VideoFormat, "none");
Assert.AreEqual(video.AudioFormat, "aac");
Assert.AreEqual(video.Duration.TotalSeconds, 79);
Assert.AreEqual(video.Size, 1.25);
}
}
}