mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Moved source code under src folder - massive change
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using System.IO;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.ProviderTests.DiskProviderTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class ArchiveProviderFixture : TestBase<ArchiveService>
|
||||
{
|
||||
[Test]
|
||||
public void Should_extract_to_correct_folder()
|
||||
{
|
||||
var destination = Path.Combine(TempFolder, "destination");
|
||||
Subject.Extract(GetTestFilePath("TestArchive.zip"), destination);
|
||||
|
||||
var destinationFolder = new DirectoryInfo(destination);
|
||||
|
||||
destinationFolder.Exists.Should().BeTrue();
|
||||
destinationFolder.GetDirectories().Should().HaveCount(1);
|
||||
destinationFolder.GetDirectories("*", SearchOption.AllDirectories).Should().HaveCount(3);
|
||||
destinationFolder.GetFiles("*.*", SearchOption.AllDirectories).Should().HaveCount(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.ProviderTests.DiskProviderTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class FreeDiskSpaceFixture : CoreTest<DiskProvider>
|
||||
{
|
||||
[Test]
|
||||
public void should_return_free_disk_space()
|
||||
{
|
||||
var result = Subject.GetAvailableSpace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
|
||||
result.Should().BeGreaterThan(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_space_on_unc()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
var result = Subject.GetAvailableSpace(@"\\localhost\c$\Windows");
|
||||
result.Should().BeGreaterThan(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_throw_if_drive_doesnt_exist()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
Assert.Throws<DirectoryNotFoundException>(() => Subject.GetAvailableSpace(@"Z:\NOT_A_REAL_PATH\DOES_NOT_EXIST".AsOsAgnostic()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_space_on_folder_that_doesnt_exist()
|
||||
{
|
||||
var result = Subject.GetAvailableSpace(@"C:\I_DO_NOT_EXIST".AsOsAgnostic());
|
||||
result.Should().BeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user