1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-19 10:54:05 +02:00
Sonarr/NzbDrone.Common.Test/WebClientTests.cs

30 lines
794 B
C#
Raw Normal View History

2013-03-28 15:07:09 -07:00

2011-10-23 15:44:37 -07:00
using FluentAssertions;
using NUnit.Framework;
2011-11-13 10:16:31 -08:00
using NzbDrone.Test.Common;
2011-10-23 15:44:37 -07:00
namespace NzbDrone.Common.Test
{
[TestFixture]
2011-11-13 10:16:31 -08:00
public class WebClientTests : TestBase
2011-10-23 15:44:37 -07:00
{
[Test]
2011-11-16 22:40:54 -08:00
public void DownloadString_should_be_able_to_dowload_text_file()
2011-10-23 15:44:37 -07:00
{
2013-04-10 16:41:45 -07:00
var jquery = new HttpProvider(new EnvironmentProvider()).DownloadString("http://www.google.com/robots.txt");
2011-10-23 15:44:37 -07:00
jquery.Should().NotBeBlank();
2011-11-16 22:40:54 -08:00
jquery.Should().Contain("Sitemap");
2011-10-23 15:44:37 -07:00
}
[TestCase("")]
[TestCase("http://")]
[TestCase(null)]
[ExpectedException]
public void DownloadString_should_throw_on_error(string url)
{
2013-04-10 16:41:45 -07:00
var jquery = new HttpProvider(new EnvironmentProvider()).DownloadString(url);
2011-10-23 15:44:37 -07:00
}
}
}