diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-10-12 20:09:15 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-10-12 20:09:15 +0200 |
| commit | 74f4affcda2c0c8e6eebb96f8173533989675e66 (patch) | |
| tree | dedf472ac9a9d98be3f6b1b1af3a06e8fdd35bd0 /Emby.Naming | |
| parent | 2375c35c4a966a469dd97f33deb57b342498b905 (diff) | |
Fix AudioBookListResolver test coverage
Diffstat (limited to 'Emby.Naming')
| -rw-r--r-- | Emby.Naming/AudioBook/AudioBookResolver.cs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookResolver.cs b/Emby.Naming/AudioBook/AudioBookResolver.cs index ed53bd04f..5807d4688 100644 --- a/Emby.Naming/AudioBook/AudioBookResolver.cs +++ b/Emby.Naming/AudioBook/AudioBookResolver.cs @@ -1,3 +1,4 @@ +#nullable enable #pragma warning disable CS1591 using System; @@ -16,21 +17,11 @@ namespace Emby.Naming.AudioBook _options = options; } - public AudioBookFileInfo ParseFile(string path) + public AudioBookFileInfo? Resolve(string path, bool isDirectory = false) { - return Resolve(path, false); - } - - public AudioBookFileInfo ParseDirectory(string path) - { - return Resolve(path, true); - } - - public AudioBookFileInfo Resolve(string path, bool isDirectory = false) - { - if (string.IsNullOrEmpty(path)) + if (path.Length == 0) { - throw new ArgumentNullException(nameof(path)); + throw new ArgumentException("String can't be empty.", nameof(path)); } // TODO |
