2011-04-10 04:28:54 +02:00
|
|
|
|
using System;
|
|
|
|
|
using AutoMoq;
|
|
|
|
|
using MbUnit.Framework;
|
|
|
|
|
using Moq;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
2011-05-19 05:55:35 +02:00
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
2011-04-10 04:28:54 +02:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
// ReSharper disable InconsistentNaming
|
2011-05-19 05:55:35 +02:00
|
|
|
|
public class SyncProviderTest : TestBase
|
2011-04-10 04:28:54 +02:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void None_existing_folder_returns_empty_list()
|
|
|
|
|
{
|
2011-05-19 05:55:35 +02:00
|
|
|
|
const string path = "d:\\bad folder";
|
2011-04-10 04:28:54 +02:00
|
|
|
|
|
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
|
mocker.GetMock<DiskProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(m => m.FolderExists(path)).Returns(false);
|
|
|
|
|
|
|
|
|
|
var result = mocker.Resolve<SyncProvider>().GetUnmappedFolders(path);
|
|
|
|
|
|
|
|
|
|
Assert.IsNotNull(result);
|
|
|
|
|
Assert.IsEmpty(result);
|
|
|
|
|
|
|
|
|
|
mocker.VerifyAllMocks();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
2011-04-10 04:44:01 +02:00
|
|
|
|
[ExpectedException(typeof (ArgumentException))]
|
2011-04-10 04:28:54 +02:00
|
|
|
|
public void empty_folder_path_throws()
|
|
|
|
|
{
|
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
|
mocker.Resolve<SyncProvider>().GetUnmappedFolders("");
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-04-10 04:44:01 +02:00
|
|
|
|
}
|