internal async Task FullProcessPassed() { const OperatingSystem os = OperatingSystem.Linux64; var operatingSystemProvider = Substitute.For <IOperatingSystemProvider>(); operatingSystemProvider.GetOperatingSystem().Returns(x => os); FFmpegDownloader._linkProvider = new LinkProvider(operatingSystemProvider); var ffmpegExecutablesPath = FFmpeg.ExecutablesPath; try { FFmpeg.ExecutablesPath = Path.Combine(Path.GetTempPath(), System.Guid.NewGuid().ToString("N")); string ffmpegPath = FFmpegDownloader.ComputeFileDestinationPath("ffmpeg", os); string ffprobePath = FFmpegDownloader.ComputeFileDestinationPath("ffprobe", os); // 1- First download await FFmpegDownloader.GetLatestVersion().ConfigureAwait(false); Assert.True(File.Exists(ffmpegPath)); Assert.True(File.Exists(ffprobePath)); // 2- Check updates (same version) await FFmpegDownloader.GetLatestVersion().ConfigureAwait(false); Assert.True(File.Exists(ffmpegPath)); Assert.True(File.Exists(ffprobePath)); // 3- Check updates (outdated version) var fFbinariesVersionInfo = new FFbinariesVersionInfo { Version = new Version().ToString() // "0.0" }; FFmpegDownloader.SaveVersion(fFbinariesVersionInfo); await FFmpegDownloader.GetLatestVersion().ConfigureAwait(false); Assert.True(File.Exists(ffmpegPath)); Assert.True(File.Exists(ffprobePath)); // 4- Missing ffmpeg File.Delete(ffmpegPath); await FFmpegDownloader.GetLatestVersion().ConfigureAwait(false); Assert.True(File.Exists(ffmpegPath)); Assert.True(File.Exists(ffprobePath)); // 5- Missing ffprobe File.Delete(ffprobePath); await FFmpegDownloader.GetLatestVersion().ConfigureAwait(false); Assert.True(File.Exists(ffmpegPath)); Assert.True(File.Exists(ffprobePath)); } finally { FFmpeg.ExecutablesPath = ffmpegExecutablesPath; } }