Radarr/NzbDrone.Common.Test/WebClientTests.cs

30 lines
793 B
C#
Raw Normal View History

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