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
@@ -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());
}
}