2011-10-21 05:04:26 +00:00
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.ProviderTests.DiskProviderTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-02-17 05:44:06 +00:00
|
|
|
|
public class ExtractArchiveFixture : CoreTest
|
2011-10-21 05:04:26 +00:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void Should_extract_to_correct_folder()
|
|
|
|
|
{
|
|
|
|
|
var destination = Path.Combine(TempFolder, "destination");
|
2012-01-26 07:56:05 +00:00
|
|
|
|
Mocker.Resolve<ArchiveProvider>().ExtractArchive(GetTestFilePath("TestArchive.zip"), destination);
|
2011-10-21 05:04:26 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|