2011-10-24 01:44:37 +03:00
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
2011-11-13 21:16:31 +03:00
|
|
|
using NzbDrone.Test.Common;
|
2011-10-24 01:44:37 +03:00
|
|
|
|
|
|
|
namespace NzbDrone.Common.Test
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2011-11-13 21:16:31 +03:00
|
|
|
public class WebClientTests : TestBase
|
2011-10-24 01:44:37 +03:00
|
|
|
{
|
|
|
|
[Test]
|
2011-11-17 09:40:54 +03:00
|
|
|
public void DownloadString_should_be_able_to_dowload_text_file()
|
2011-10-24 01:44:37 +03:00
|
|
|
{
|
2012-02-11 03:48:20 +03:00
|
|
|
var jquery = new HttpProvider().DownloadString("http://www.google.com/robots.txt");
|
2011-10-24 01:44:37 +03:00
|
|
|
|
|
|
|
jquery.Should().NotBeBlank();
|
2011-11-17 09:40:54 +03:00
|
|
|
jquery.Should().Contain("Sitemap");
|
2011-10-24 01:44:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[TestCase("")]
|
|
|
|
[TestCase("http://")]
|
|
|
|
[TestCase(null)]
|
|
|
|
[ExpectedException]
|
|
|
|
public void DownloadString_should_throw_on_error(string url)
|
|
|
|
{
|
2012-02-11 03:48:20 +03:00
|
|
|
var jquery = new HttpProvider().DownloadString(url);
|
2011-10-24 01:44:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|