Split match/rejected tests, add wider sampling of extensions

pull/7349/head
Joe Rogers 3 years ago
parent cf033b25f8
commit a9a3f6bf02
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

@ -29,42 +29,55 @@ public class ExternalPathParserTests
}
[Theory]
[InlineData("", false)]
[InlineData("MyVideo.srt", false)]
[InlineData("MyVideo.mka", true)]
public void ParseFile_AudioFile_ReturnsPathWhenAudio(string path, bool valid)
[InlineData("")]
[InlineData("MyVideo.ass")]
[InlineData("MyVideo.mks")]
[InlineData("MyVideo.sami")]
[InlineData("MyVideo.srt")]
[InlineData("MyVideo.m4v")]
public void ParseFile_AudioExtensionsNotMatched_ReturnsNull(string path)
{
var actual = _audioPathParser.ParseFile(path, string.Empty);
Assert.Null(_audioPathParser.ParseFile(path, string.Empty));
}
if (valid)
[Theory]
[InlineData("MyVideo.aa")]
[InlineData("MyVideo.aac")]
[InlineData("MyVideo.flac")]
[InlineData("MyVideo.m4a")]
[InlineData("MyVideo.mka")]
[InlineData("MyVideo.mp3")]
public void ParseFile_AudioExtensionsMatched_ReturnsPath(string path)
{
var actual = _audioPathParser.ParseFile(path, string.Empty);
Assert.NotNull(actual);
Assert.Equal(path, actual!.Path);
}
else
[Theory]
[InlineData("")]
[InlineData("MyVideo.aa")]
[InlineData("MyVideo.aac")]
[InlineData("MyVideo.flac")]
[InlineData("MyVideo.mka")]
[InlineData("MyVideo.m4v")]
public void ParseFile_SubtitleExtensionsNotMatched_ReturnsNull(string path)
{
Assert.Null(actual);
}
Assert.Null(_subtitlePathParser.ParseFile(path, string.Empty));
}
[Theory]
[InlineData("", false)]
[InlineData("MyVideo.srt", true)]
[InlineData("MyVideo.mka", false)]
public void ParseFile_SubtitleFile_ReturnsPathWhenSubtitle(string path, bool valid)
[InlineData("MyVideo.ass")]
[InlineData("MyVideo.mks")]
[InlineData("MyVideo.sami")]
[InlineData("MyVideo.srt")]
[InlineData("MyVideo.vtt")]
public void ParseFile_SubtitleExtensionsMatched_ReturnsPath(string path)
{
var actual = _subtitlePathParser.ParseFile(path, string.Empty);
if (valid)
{
Assert.NotNull(actual);
Assert.Equal(path, actual!.Path);
}
else
{
Assert.Null(actual);
}
}
[Theory]
[InlineData("", null, null)]

Loading…
Cancel
Save