Skip to content

Commit

Permalink
fixed GetAvailableFreeSpaceOnDisk Test
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Nov 11, 2023
1 parent 714b27e commit da5ab40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Downloader.Test/UnitTests/FileHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,15 @@ public void GetAvailableFreeSpaceOnDiskTest()
// arrange
var mainDriveRoot = Path.GetPathRoot(DummyFileHelper.TempDirectory);
var mainDrive = new DriveInfo(mainDriveRoot ?? string.Empty);
var mainDriveAvailableFreeSpace = mainDrive.AvailableFreeSpace - 1024;
var mainDriveAvailableFreeSpace = mainDrive.AvailableFreeSpace + 1024;

// act
var availableFreeSpace = FileHelper.GetAvailableFreeSpaceOnDisk(DummyFileHelper.TempDirectory);

// assert
Assert.True(mainDriveAvailableFreeSpace < availableFreeSpace);
Assert.True(availableFreeSpace > 0);
Assert.True(mainDriveAvailableFreeSpace > availableFreeSpace,
$"main space is {mainDriveAvailableFreeSpace} >! available space {availableFreeSpace}");
}

[Fact]
Expand Down

0 comments on commit da5ab40

Please sign in to comment.