1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00
Sonarr/NzbDrone.Common.Test/WebClientTests.cs
2013-07-30 23:02:50 -07:00

38 lines
951 B
C#

using System;
using System.Net;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class WebClientTests : TestBase<HttpProvider>
{
[Test]
public void DownloadString_should_be_able_to_dowload_text_file()
{
var jquery = Subject.DownloadString("http://www.google.com/robots.txt");
jquery.Should().NotBeBlank();
jquery.Should().Contain("Sitemap");
}
[TestCase("")]
[TestCase("http://")]
public void DownloadString_should_throw_on_error(string url)
{
Assert.Throws<ArgumentException>(() => Subject.DownloadString(url));
ExceptionVerification.ExpectedWarns(1);
}
[Test]
public void should_get_headers()
{
Subject.GetHeader("http://www.google.com").Should().NotBeEmpty();
}
}
}