|
|
|
@ -135,5 +135,50 @@ namespace NzbDrone.Core.Test.TvTests
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_not_throw_if_duplicate_season_is_in_existing_info()
|
|
|
|
|
{
|
|
|
|
|
var newSeriesInfo = _series.JsonClone();
|
|
|
|
|
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
|
|
|
|
|
.With(s => s.SeasonNumber = 2)
|
|
|
|
|
.Build());
|
|
|
|
|
|
|
|
|
|
_series.Seasons.Add(Builder<Season>.CreateNew()
|
|
|
|
|
.With(s => s.SeasonNumber = 2)
|
|
|
|
|
.Build());
|
|
|
|
|
|
|
|
|
|
_series.Seasons.Add(Builder<Season>.CreateNew()
|
|
|
|
|
.With(s => s.SeasonNumber = 2)
|
|
|
|
|
.Build());
|
|
|
|
|
|
|
|
|
|
GivenNewSeriesInfo(newSeriesInfo);
|
|
|
|
|
|
|
|
|
|
Subject.Execute(new RefreshSeriesCommand(_series.Id));
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ISeriesService>()
|
|
|
|
|
.Verify(v => v.UpdateSeries(It.Is<Series>(s => s.Seasons.Count == 2)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_filter_duplicate_seasons()
|
|
|
|
|
{
|
|
|
|
|
var newSeriesInfo = _series.JsonClone();
|
|
|
|
|
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
|
|
|
|
|
.With(s => s.SeasonNumber = 2)
|
|
|
|
|
.Build());
|
|
|
|
|
|
|
|
|
|
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
|
|
|
|
|
.With(s => s.SeasonNumber = 2)
|
|
|
|
|
.Build());
|
|
|
|
|
|
|
|
|
|
GivenNewSeriesInfo(newSeriesInfo);
|
|
|
|
|
|
|
|
|
|
Subject.Execute(new RefreshSeriesCommand(_series.Id));
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ISeriesService>()
|
|
|
|
|
.Verify(v => v.UpdateSeries(It.Is<Series>(s => s.Seasons.Count == 2)));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|