diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-11-17 10:28:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-17 10:28:39 -0500 |
| commit | f6ebdbc45e6dc455b7535dfe341ccba94b2c2a90 (patch) | |
| tree | 3b42753afda908633880519308fddc25bc249d71 /tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs | |
| parent | fc3d6278be89b695aa79dc61d7f1226d4d6e441b (diff) | |
| parent | 04a712ab1d56a29a31e2c4991c16d338348762f4 (diff) | |
Merge pull request #4456 from martinek-stepan/emby-namig-nullable
Emby.Naming - nullable & code coverage
Diffstat (limited to 'tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs')
| -rw-r--r-- | tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs b/tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs new file mode 100644 index 000000000..3892d00f6 --- /dev/null +++ b/tests/Jellyfin.Naming.Tests/Common/NamingOptionsTest.cs @@ -0,0 +1,36 @@ +using Emby.Naming.Common; +using Xunit; + +namespace Jellyfin.Naming.Tests.Common +{ + public class NamingOptionsTest + { + [Fact] + public void TestNamingOptionsCompile() + { + var options = new NamingOptions(); + + Assert.NotEmpty(options.VideoFileStackingRegexes); + Assert.NotEmpty(options.CleanDateTimeRegexes); + Assert.NotEmpty(options.CleanStringRegexes); + Assert.NotEmpty(options.EpisodeWithoutSeasonRegexes); + Assert.NotEmpty(options.EpisodeMultiPartRegexes); + } + + [Fact] + public void TestNamingOptionsEpisodeExpressions() + { + var exp = new EpisodeExpression(string.Empty); + + Assert.False(exp.IsOptimistic); + exp.IsOptimistic = true; + Assert.True(exp.IsOptimistic); + + Assert.Equal(string.Empty, exp.Expression); + Assert.NotNull(exp.Regex); + exp.Expression = "test"; + Assert.Equal("test", exp.Expression); + Assert.NotNull(exp.Regex); + } + } +} |
