initial stage of indexer refactoring. things compile.

This commit is contained in:
kay.one 2011-05-19 20:47:07 -07:00
commit 9c1ff4af6b
21 changed files with 249 additions and 348 deletions

View file

@ -1,7 +1,10 @@
using System.Linq;
using System;
using System.Linq;
using AutoMoq;
using MbUnit.Framework;
using Moq;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
using SubSonic.Repository;
@ -113,5 +116,30 @@ namespace NzbDrone.Core.Test
Assert.AreEqual(1, rootDir.Id);
Assert.AreEqual(path, rootDir.Path);
}
[Test]
public void None_existing_folder_returns_empty_list()
{
const string path = "d:\\bad folder";
var mocker = new AutoMoqer();
mocker.GetMock<DiskProvider>(MockBehavior.Strict)
.Setup(m => m.FolderExists(path)).Returns(false);
var result = mocker.Resolve<RootDirProvider>().GetUnmappedFolders(path);
Assert.IsNotNull(result);
Assert.IsEmpty(result);
mocker.VerifyAllMocks();
}
[Test]
[ExpectedException(typeof(ArgumentException))]
public void empty_folder_path_throws()
{
var mocker = new AutoMoqer();
mocker.Resolve<RootDirProvider>().GetUnmappedFolders("");
}
}
}