From a7981f288632ffd9be0d42c862ac80ec40984184 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 25 Oct 2020 17:16:47 +0100 Subject: [PATCH] Fix test --- FFMpegCore.Test/Resources/VideoLibrary.cs | 5 +++-- FFMpegCore.Test/VideoTest.cs | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/FFMpegCore.Test/Resources/VideoLibrary.cs b/FFMpegCore.Test/Resources/VideoLibrary.cs index b39d6d6..8bb0139 100644 --- a/FFMpegCore.Test/Resources/VideoLibrary.cs +++ b/FFMpegCore.Test/Resources/VideoLibrary.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using FFMpegCore.Enums; namespace FFMpegCore.Test.Resources @@ -44,7 +45,7 @@ public static string OutputLocation(this FileInfo file, string type, string keyw string originalLocation = file.Directory.FullName, outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToLowerInvariant()); - return $"{originalLocation}{Path.DirectorySeparatorChar}{outputFile}"; + return $"{originalLocation}{Path.DirectorySeparatorChar}{Guid.NewGuid()}_{outputFile}"; } } } diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index 65bcbc9..41899c6 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -566,7 +566,7 @@ public void Video_With_Only_Audio_Should_Extract_Metadata() var video = FFProbe.Analyse(VideoLibrary.LocalVideoAudioOnly.FullName); Assert.AreEqual(null, video.PrimaryVideoStream); Assert.AreEqual("aac", video.PrimaryAudioStream.CodecName); - Assert.AreEqual(3, video.Duration.TotalSeconds, 0.5); + Assert.AreEqual(10, video.Duration.TotalSeconds, 0.5); // Assert.AreEqual(1.25, video.Size); } @@ -580,7 +580,7 @@ public void Video_Duration() { FFMpegArguments .FromFileInput(VideoLibrary.LocalVideo) - .OutputToFile(output, false, opt => opt.WithDuration(TimeSpan.FromSeconds(video.Duration.TotalSeconds - 5))) + .OutputToFile(output, false, opt => opt.WithDuration(TimeSpan.FromSeconds(video.Duration.TotalSeconds - 2))) .ProcessSynchronously(); Assert.IsTrue(File.Exists(output)); @@ -589,7 +589,7 @@ public void Video_Duration() Assert.AreEqual(video.Duration.Days, outputVideo.Duration.Days); Assert.AreEqual(video.Duration.Hours, outputVideo.Duration.Hours); Assert.AreEqual(video.Duration.Minutes, outputVideo.Duration.Minutes); - Assert.AreEqual(video.Duration.Seconds - 5, outputVideo.Duration.Seconds); + Assert.AreEqual(video.Duration.Seconds - 2, outputVideo.Duration.Seconds); } finally {