You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Common.Test/DiskProviderTests/FreeSpaceFixture.cs

44 lines
1.1 KiB

11 years ago
using System.IO;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.DiskProviderTests
{
[TestFixture]
11 years ago
public class FreeSpaceFixture : TestBase<DiskProvider>
{
[Test]
11 years ago
public void should_get_free_space_for_folder()
{
11 years ago
var path = @"C:\".AsOsAgnostic();
11 years ago
Subject.GetAvailableSpace(path).Should().NotBe(0);
}
[Test]
11 years ago
public void should_get_free_space_for_folder_that_doesnt_exist()
{
11 years ago
var path = @"C:\".AsOsAgnostic();
11 years ago
Subject.GetAvailableSpace(Path.Combine(path, "invalidFolder")).Should().NotBe(0);
}
11 years ago
[Test]
11 years ago
public void should_get_free_space_for_drive_that_doesnt_exist()
{
11 years ago
WindowsOnly();
Assert.Throws<DirectoryNotFoundException>(() => Subject.GetAvailableSpace("J:\\").Should().NotBe(0));
}
11 years ago
[Test]
public void should_be_able_to_check_space_on_ramdrive()
{
LinuxOnly();
Subject.GetAvailableSpace("/run/").Should().NotBe(0);
}
}
}