diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-05-04 16:40:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-04 08:40:34 -0600 |
| commit | 0c3ba30de214eddcd6118c3b695b08e5482bf7ed (patch) | |
| tree | a862a90f6c78cd61f78e5af7b75611a37f527ccf /tests/Jellyfin.Extensions.Tests/FileHelperTests.cs | |
| parent | 4096c973c623a72525843d5fe278d1f36fbbc58a (diff) | |
Cleanup file related code (#14023)
Diffstat (limited to 'tests/Jellyfin.Extensions.Tests/FileHelperTests.cs')
| -rw-r--r-- | tests/Jellyfin.Extensions.Tests/FileHelperTests.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/FileHelperTests.cs b/tests/Jellyfin.Extensions.Tests/FileHelperTests.cs new file mode 100644 index 000000000..fb6a5dd0a --- /dev/null +++ b/tests/Jellyfin.Extensions.Tests/FileHelperTests.cs @@ -0,0 +1,23 @@ +using System.IO; +using Xunit; + +namespace Jellyfin.Extensions.Tests; + +public static class FileHelperTests +{ + [Fact] + public static void CreateEmpty_Valid_Correct() + { + var path = Path.Join(Path.GetTempPath(), Path.GetRandomFileName()); + var fileInfo = new FileInfo(path); + + Assert.False(fileInfo.Exists); + + FileHelper.CreateEmpty(path); + + fileInfo.Refresh(); + Assert.True(fileInfo.Exists); + + File.Delete(path); + } +} |
