|
|
@ -3,6 +3,7 @@ using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using AutoMoq;
|
|
|
|
using AutoMoq;
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Update.Providers;
|
|
|
|
using NzbDrone.Update.Providers;
|
|
|
@ -59,5 +60,19 @@ namespace NzbDrone.Update.Test
|
|
|
|
Assert.Throws<DirectoryNotFoundException>(() => mocker.Resolve<UpdateProvider>().Verify(targetFolder))
|
|
|
|
Assert.Throws<DirectoryNotFoundException>(() => mocker.Resolve<UpdateProvider>().Verify(targetFolder))
|
|
|
|
.Message.Should().StartWith("Update folder doesn't exist");
|
|
|
|
.Message.Should().StartWith("Update folder doesn't exist");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
public void verify_should_pass_if_update_folder_and_target_folder_both_exist()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const string targetFolder = "c:\\NzbDrone\\";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mocker.GetMock<DiskProvider>()
|
|
|
|
|
|
|
|
.Setup(c => c.FolderExists(It.IsAny<string>()))
|
|
|
|
|
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mocker.Resolve<UpdateProvider>().Verify(targetFolder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mocker.VerifyAllMocks();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|