|
|
@ -1,4 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
@ -20,11 +20,18 @@ namespace NzbDrone.Common.Test
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase("")]
|
|
|
|
[TestCase("")]
|
|
|
|
[TestCase("http://")]
|
|
|
|
public void DownloadString_should_throw_on_empty_string(string url)
|
|
|
|
public void DownloadString_should_throw_on_error(string url)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert.Throws<ArgumentException>(() => Subject.DownloadString(url));
|
|
|
|
Assert.Throws<ArgumentException>(() => Subject.DownloadString(url));
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// .net 4.6.2 throws NotSupportedException instead of ArgumentException here
|
|
|
|
|
|
|
|
[TestCase("http://")]
|
|
|
|
|
|
|
|
public void DownloadString_should_throw_on_not_supported_string(string url)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Assert.Throws<NotSupportedException>(() => Subject.DownloadString(url));
|
|
|
|
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|