Added tests for RootFolderCheck

Fixed: Progress bar colour when series is continuing
Fixed: Episode Title in tables will show proper cursor and underline
This commit is contained in:
Mark McDowall 2014-05-28 07:15:19 -07:00
parent e5ea50e1dc
commit 30c82f2613
5 changed files with 60 additions and 7 deletions

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Disk;
using NzbDrone.Core.HealthCheck.Checks;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Test.HealthCheck.Checks
{
[TestFixture]
public class RootFolderCheckFixture : CoreTest<RootFolderCheck>
{
private void GivenMissingRootFolder()
{
var series = Builder<Series>.CreateListOfSize(1)
.Build()
.ToList();
Mocker.GetMock<ISeriesService>()
.Setup(s => s.GetAllSeries())
.Returns(series);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.GetParentFolder(series.First().Path))
.Returns(@"C:\TV");
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(It.IsAny<String>()))
.Returns(false);
}
[Test]
public void should_not_return_error_when_no_series()
{
Mocker.GetMock<ISeriesService>()
.Setup(s => s.GetAllSeries())
.Returns(new List<Series>());
Subject.Check().ShouldBeOk();
}
[Test]
public void should_return_error_if_series_parent_is_missing()
{
GivenMissingRootFolder();
Subject.Check().ShouldBeError();
}
}
}

View File

@ -1,8 +1,10 @@
using System;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.HealthCheck;
using NzbDrone.Core.HealthCheck.Checks;
using NzbDrone.Core.Test.Framework;

View File

@ -125,6 +125,7 @@
<Compile Include="Framework\CoreTest.cs" />
<Compile Include="Framework\DbTest.cs" />
<Compile Include="Framework\NBuilderExtensions.cs" />
<Compile Include="HealthCheck\Checks\RootFolderCheckFixture.cs" />
<Compile Include="HealthCheck\Checks\DownloadClientCheckFixture.cs" />
<Compile Include="HealthCheck\Checks\UpdateCheckFixture.cs" />
<Compile Include="HealthCheck\Checks\IndexerCheckFixture.cs" />

View File

@ -5,11 +5,6 @@
@import "../Content/mixins";
@import "../Content/variables";
.table {
//table-layout: fixed;
}
.series-title {
.text-overflow();
@ -24,9 +19,10 @@
color: #428bca;
text-decoration: none;
&.focus, &.hover {
&:focus, &:hover {
color: #2a6496;
text-decoration: underline;
cursor: pointer;
}
@media @lg {

View File

@ -47,7 +47,7 @@ define(
Handlebars.registerHelper('EpisodeProgressClass', function () {
if (this.episodeFileCount === this.episodeCount) {
if (this.continuing) {
if (this.status === 'continuing') {
return '';
}