1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

Getting model by invalid ID throws a more specific exception.

This commit is contained in:
Keivan Beigi
2013-07-09 15:06:30 -07:00
parent f3534de0c5
commit 54c36e9264
8 changed files with 38 additions and 11 deletions
@@ -84,7 +84,7 @@ namespace NzbDrone.Core.Test.Datastore
[Test]
public void getting_model_with_invalid_id_should_throw()
{
Assert.Throws<InvalidOperationException>(() => Subject.Get(12));
Assert.Throws<ModelNotFoundException>(() => Subject.Get(12));
}
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -31,7 +32,7 @@ namespace NzbDrone.Core.Test.Qualities
public void should_throw_with_id_if_not_exist()
{
var id = 123;
Assert.Throws<InvalidOperationException>(()=> Subject.GetByQualityId(id)).Message.Contains(id.ToString());
Assert.Throws<ModelNotFoundException>(()=> Subject.GetByQualityId(id)).Message.Contains(id.ToString());
}
}