-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exception on FFmpeg proxy file creation
- Loading branch information
1 parent
b6ccac2
commit 4f9adee
Showing
3 changed files
with
94 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.IO; | ||
using Xunit; | ||
|
||
namespace Aurio.FFmpeg.UnitTest | ||
{ | ||
public class FFmpegSourceStreamTests | ||
{ | ||
[Fact] | ||
public void CreateWaveProxy_ProxyFileInfoIsNull() | ||
{ | ||
FileInfo fileInfo = new("X:\\test.file"); | ||
FileInfo? proxyFileInfo = null; | ||
|
||
void act() => FFmpegSourceStream.CreateWaveProxy(fileInfo, proxyFileInfo); | ||
|
||
Assert.Throws<ArgumentNullException>(act); | ||
} | ||
|
||
[Fact] | ||
public void SuggestWaveProxyFileInfo_WithoutDirectory() | ||
{ | ||
var fileInfo = new FileInfo("X:\\folder\\file.wav"); | ||
|
||
var proxyFileInfo = FFmpegSourceStream.SuggestWaveProxyFileInfo(fileInfo); | ||
|
||
Assert.Equal("X:\\folder\\file.wav.ffproxy.wav", proxyFileInfo.FullName); | ||
} | ||
|
||
[Fact] | ||
public void SuggestWaveProxyFileInfo_WithDirectory() | ||
{ | ||
var fileInfo = new FileInfo("X:\\folder\\file.wav"); | ||
var directoryInfo = new DirectoryInfo("Y:\\temp\\dir"); | ||
|
||
var proxyFileInfo = FFmpegSourceStream.SuggestWaveProxyFileInfo( | ||
fileInfo, | ||
directoryInfo | ||
); | ||
|
||
Assert.Equal( | ||
"Y:\\temp\\dir\\87c18cf1c8d8e07552df4ecc1ef629995fca9c59ad47ccf7eb4816de33590af7.ffproxy.wav", | ||
proxyFileInfo.FullName | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters