FileHelperTests.cs 476 B

1234567891011121314151617181920212223
  1. using System.IO;
  2. using Xunit;
  3. namespace Jellyfin.Extensions.Tests;
  4. public static class FileHelperTests
  5. {
  6. [Fact]
  7. public static void CreateEmpty_Valid_Correct()
  8. {
  9. var path = Path.Join(Path.GetTempPath(), Path.GetRandomFileName());
  10. var fileInfo = new FileInfo(path);
  11. Assert.False(fileInfo.Exists);
  12. FileHelper.CreateEmpty(path);
  13. fileInfo.Refresh();
  14. Assert.True(fileInfo.Exists);
  15. File.Delete(path);
  16. }
  17. }