Merge branch 'master' of git://github.com/kayone/NzbDrone
This commit is contained in:
commit
f2df76783a
|
@ -69,10 +69,11 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(QualityTypes.SDTV, true)]
|
[TestCase(QualityTypes.SDTV, true)]
|
||||||
[TestCase(QualityTypes.HDTV, true)]
|
[TestCase(QualityTypes.DVD, true)]
|
||||||
public void import_new_file_with_better_quality(QualityTypes currentFileQuality, bool currentFileProper)
|
[TestCase(QualityTypes.HDTV, false)]
|
||||||
|
public void import_new_file_with_better_same_quality(QualityTypes currentFileQuality, bool currentFileProper)
|
||||||
{
|
{
|
||||||
const string fileName = @"WEEDS.S03E01.DUAL.1080p.-HELLYWOOD.mkv";
|
const string newFile = @"WEEDS.S03E01.DUAL.1080p.-HELLYWOOD.mkv";
|
||||||
const int seasonNumber = 3;
|
const int seasonNumber = 3;
|
||||||
const int episodeNumner = 1;
|
const int episodeNumner = 1;
|
||||||
const int size = 12345;
|
const int size = 12345;
|
||||||
|
@ -92,7 +93,7 @@ namespace NzbDrone.Core.Test
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
|
|
||||||
mocker.GetMock<DiskProvider>()
|
mocker.GetMock<DiskProvider>()
|
||||||
.Setup(e => e.GetSize(fileName)).Returns(12345).Verifiable();
|
.Setup(e => e.GetSize(newFile)).Returns(12345).Verifiable();
|
||||||
|
|
||||||
var database = mocker.GetMock<IDatabase>(MockBehavior.Strict);
|
var database = mocker.GetMock<IDatabase>(MockBehavior.Strict);
|
||||||
database.Setup(r => r.Exists<EpisodeFile>(It.IsAny<string>(), It.IsAny<object>())).Returns(false).Verifiable();
|
database.Setup(r => r.Exists<EpisodeFile>(It.IsAny<string>(), It.IsAny<object>())).Returns(false).Verifiable();
|
||||||
|
@ -103,7 +104,7 @@ namespace NzbDrone.Core.Test
|
||||||
.Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode);
|
.Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode);
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
var result = mocker.Resolve<DiskScanProvider>().ImportFile(fakeSeries, fileName);
|
var result = mocker.Resolve<DiskScanProvider>().ImportFile(fakeSeries, newFile);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
|
@ -113,8 +114,8 @@ namespace NzbDrone.Core.Test
|
||||||
result.SeasonNumber.Should().Be(fakeEpisode.SeasonNumber);
|
result.SeasonNumber.Should().Be(fakeEpisode.SeasonNumber);
|
||||||
|
|
||||||
Assert.AreEqual(fakeEpisode.SeriesId, result.SeriesId);
|
Assert.AreEqual(fakeEpisode.SeriesId, result.SeriesId);
|
||||||
Assert.AreEqual(QualityTypes.SDTV, result.Quality);
|
Assert.AreEqual(QualityTypes.HDTV, result.Quality);
|
||||||
Assert.AreEqual(Parser.NormalizePath(fileName), result.Path);
|
Assert.AreEqual(Parser.NormalizePath(newFile), result.Path);
|
||||||
Assert.AreEqual(size, result.Size);
|
Assert.AreEqual(size, result.Size);
|
||||||
Assert.AreEqual(false, result.Proper);
|
Assert.AreEqual(false, result.Proper);
|
||||||
Assert.AreNotEqual(new DateTime(), result.DateAdded);
|
Assert.AreNotEqual(new DateTime(), result.DateAdded);
|
||||||
|
|
Loading…
Reference in New Issue