mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-20 21:54:58 -04:00
Fixed: Refreshing series that have duplicate season information
This commit is contained in:
@@ -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)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user