1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-24 08:44:46 +00:00
Sonarr/NzbDrone.Core.Test/SyncProviderTest.cs

39 lines
1 KiB
C#
Raw Normal View History

using System;
using AutoMoq;
using MbUnit.Framework;
using Moq;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
namespace NzbDrone.Core.Test
{
[TestFixture]
// ReSharper disable InconsistentNaming
public class SyncProviderTest
{
[Test]
public void None_existing_folder_returns_empty_list()
{
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<SyncProvider>().GetUnmappedFolders(path);
Assert.IsNotNull(result);
Assert.IsEmpty(result);
mocker.VerifyAllMocks();
}
[Test]
2011-04-10 02:44:01 +00:00
[ExpectedException(typeof (ArgumentException))]
public void empty_folder_path_throws()
{
var mocker = new AutoMoqer();
mocker.Resolve<SyncProvider>().GetUnmappedFolders("");
}
}
2011-04-10 02:44:01 +00:00
}