2013-04-22 06:18:08 +03:00
|
|
|
using System.IO;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Api.RootFolders;
|
|
|
|
|
|
|
|
namespace NzbDrone.Integration.Test
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class RootFolderIntegrationTest : IntegrationTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void should_have_no_root_folder_initially()
|
|
|
|
{
|
|
|
|
RootFolders.All().Should().BeEmpty();
|
|
|
|
|
|
|
|
var rootFolder = new RootFolderResource
|
|
|
|
{
|
|
|
|
Path = Directory.GetCurrentDirectory()
|
|
|
|
};
|
|
|
|
|
|
|
|
var postResponse = RootFolders.Post(rootFolder);
|
|
|
|
|
|
|
|
postResponse.Id.Should().NotBe(0);
|
|
|
|
postResponse.FreeSpace.Should().NotBe(0);
|
|
|
|
|
|
|
|
RootFolders.All().Should().OnlyContain(c => c.Id == postResponse.Id);
|
|
|
|
|
|
|
|
|
2013-04-24 04:56:00 +03:00
|
|
|
RootFolders.Delete(postResponse.Id);
|
|
|
|
|
|
|
|
RootFolders.All().Should().BeEmpty();
|
|
|
|
}
|
2013-04-22 06:18:08 +03:00
|
|
|
}
|
|
|
|
}
|