mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Update logs are now in the UI
This commit is contained in:
parent
54e5874770
commit
3520b56bb6
11 changed files with 158 additions and 25 deletions
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.ProviderTests.UpdateProviderTests
|
||||
{
|
||||
class GetUpdateLogFixture : CoreTest
|
||||
{
|
||||
String UpdateLogFolder;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void setup()
|
||||
{
|
||||
WithTempAsAppPath();
|
||||
|
||||
UpdateLogFolder = Mocker.GetMock<EnviromentProvider>().Object.GetUpdateLogFolder();
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(c => c.GetFiles(UpdateLogFolder, SearchOption.TopDirectoryOnly))
|
||||
.Returns(new List<string>
|
||||
{
|
||||
"C:\\nzbdrone\\update\\2011.09.20-19-08.txt",
|
||||
"C:\\nzbdrone\\update\\2011.10.20-20-08.txt",
|
||||
"C:\\nzbdrone\\update\\2011.12.20-21-08.txt"
|
||||
});
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(c => c.FolderExists(UpdateLogFolder))
|
||||
.Returns(true);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_logs_should_return_empty_list_if_directory_doesnt_exist()
|
||||
{
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(c => c.FolderExists(UpdateLogFolder))
|
||||
.Returns(false);
|
||||
|
||||
var logs = Mocker.Resolve<UpdateProvider>().UpdateLogFile();
|
||||
logs.Should().BeEmpty();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_logs_should_return_list_of_files_in_log_folder()
|
||||
{
|
||||
var logs = Mocker.Resolve<UpdateProvider>().UpdateLogFile();
|
||||
logs.Should().HaveCount(3);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue