parent
4d874829e8
commit
6b0a24e28e
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Common.Test.EnvironmentTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class BuildInfoTest : TestBase
|
||||
{
|
||||
|
||||
[TestCase("0.0.0.0")]
|
||||
[TestCase("1.0.0.0")]
|
||||
public void Application_version_should_not_be_default(string version)
|
||||
{
|
||||
BuildInfo.Version.Should().NotBe(new Version(version));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Update;
|
||||
|
||||
namespace NzbDrone.Core.Test.UpdateTests
|
||||
{
|
||||
public class GetUpdateLogFixture : CoreTest<UpdateService>
|
||||
{
|
||||
String _updateLogFolder;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
WithTempAsAppPath();
|
||||
|
||||
_updateLogFolder = Mocker.GetMock<IEnvironmentProvider>().Object.GetUpdateLogFolder();
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(c => c.GetFiles(_updateLogFolder, SearchOption.TopDirectoryOnly))
|
||||
.Returns(new[]
|
||||
{
|
||||
"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<IDiskProvider>()
|
||||
.Setup(c => c.FolderExists(_updateLogFolder))
|
||||
.Returns(true);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_logs_should_return_empty_list_if_directory_doesnt_exist()
|
||||
{
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(c => c.FolderExists(_updateLogFolder))
|
||||
.Returns(false);
|
||||
|
||||
Subject.GetUpdateLogFiles().Should().BeEmpty();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_logs_should_return_list_of_files_in_log_folder()
|
||||
{
|
||||
var logs = Subject.GetUpdateLogFiles();
|
||||
logs.Should().HaveCount(3);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue