2013-08-11 22:55:26 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2013-08-30 01:55:42 +00:00
|
|
|
|
using System.IO;
|
2013-08-11 22:55:26 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Test.DiskProviderTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-08-30 01:55:42 +00:00
|
|
|
|
public class FreeSpaceFixture : TestBase<DiskProvider>
|
2013-08-11 22:55:26 +00:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
2013-08-30 01:55:42 +00:00
|
|
|
|
public void should_get_free_space_for_folder()
|
2013-08-11 22:55:26 +00:00
|
|
|
|
{
|
2013-08-30 01:55:42 +00:00
|
|
|
|
var path = @"C:\".AsOsAgnostic();
|
2013-08-12 04:57:10 +00:00
|
|
|
|
|
2013-08-30 01:55:42 +00:00
|
|
|
|
Subject.GetAvilableSpace(path).Should().NotBe(0);
|
2013-08-11 22:55:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
2013-08-30 01:55:42 +00:00
|
|
|
|
public void should_get_free_space_for_folder_that_doesnt_exist()
|
2013-08-11 22:55:26 +00:00
|
|
|
|
{
|
2013-08-30 01:55:42 +00:00
|
|
|
|
var path = @"C:\".AsOsAgnostic();
|
2013-08-12 04:57:10 +00:00
|
|
|
|
|
2013-08-30 01:55:42 +00:00
|
|
|
|
Subject.GetAvilableSpace(Path.Combine(path, "invalidFolder")).Should().NotBe(0);
|
2013-08-11 22:55:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-08-30 01:55:42 +00:00
|
|
|
|
|
2013-08-11 22:55:26 +00:00
|
|
|
|
[Test]
|
2013-08-30 01:55:42 +00:00
|
|
|
|
public void should_get_free_space_for_drive_that_doesnt_exist()
|
2013-08-11 22:55:26 +00:00
|
|
|
|
{
|
2013-08-30 01:55:42 +00:00
|
|
|
|
WindowsOnly();
|
2013-08-12 04:57:10 +00:00
|
|
|
|
|
2013-08-30 01:55:42 +00:00
|
|
|
|
Subject.GetAvilableSpace("J:\\").Should().NotBe(0);
|
2013-08-11 22:55:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|