Improved error message when nzb download contains an newznab error instead

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Taloth Saldono
2020-04-16 22:16:50 +02:00
committed by Qstick
parent 24ab9768e9
commit db51254827
4 changed files with 39 additions and 0 deletions
@@ -1,4 +1,5 @@
using System.IO;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Download;
using NzbDrone.Core.Test.Framework;
@@ -31,6 +32,17 @@ namespace NzbDrone.Core.Test.Download
Assert.Throws<InvalidNzbException>(() => Subject.Validate(filename, fileContent));
}
[Test]
public void should_throw_on_newznab_error()
{
var filename = "NewznabError";
var fileContent = GivenNzbFile(filename);
var ex = Assert.Throws<InvalidNzbException>(() => Subject.Validate(filename, fileContent));
ex.Message.Should().Contain("201 - Incorrect parameter");
}
[Test]
public void should_validate_nzb()
{