mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
initial stage of indexer refactoring. things compile.
This commit is contained in:
parent
7d7b37be5b
commit
9c1ff4af6b
21 changed files with 249 additions and 348 deletions
|
@ -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("");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue