1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

SeriesProvider.GetSeries(int seriesId) will now fail if series is not found.

This commit is contained in:
kay.one 2011-06-18 22:56:52 -07:00
parent 5c055ebb9a
commit a990fb91d5
2 changed files with 4 additions and 5 deletions

View File

@ -106,6 +106,7 @@ public void find_series_empty_repo()
[Test]
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Sequence contains no elements")]
public void Get_series_invalid_series_id_should_return_null()
{
var mocker = new AutoMoqer();

View File

@ -44,11 +44,9 @@ public virtual IList<Series> GetAllSeries()
public virtual Series GetSeries(int seriesId)
{
var series = _database.SingleOrDefault<Series>("WHERE seriesId= @0", seriesId);
if (series != null)
{
series.QualityProfile = _qualityProvider.Get(series.QualityProfileId);
}
var series = _database.Single<Series>("WHERE seriesId= @0", seriesId);
series.QualityProfile = _qualityProvider.Get(series.QualityProfileId);
return series;
}