1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Common.Test/WebClientTests.cs

38 lines
933 B
C#
Raw Normal View History

2013-03-29 01:07:09 +03:00

2013-07-31 09:02:50 +03:00
using System;
2011-10-24 01:44:37 +03:00
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]
2013-06-03 09:12:31 +03:00
public class WebClientTests : TestBase<HttpProvider>
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
{
2013-06-03 09:12:31 +03:00
var jquery = Subject.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://")]
public void DownloadString_should_throw_on_error(string url)
{
2013-07-31 09:02:50 +03:00
Assert.Throws<ArgumentException>(() => Subject.DownloadString(url));
ExceptionVerification.ExpectedWarns(1);
2013-06-03 09:12:31 +03:00
}
2013-07-31 09:02:50 +03:00
2013-06-03 09:12:31 +03:00
[Test]
public void should_get_headers()
{
Subject.GetHeader("http://www.google.com").Should().NotBeEmpty();
2011-10-24 01:44:37 +03:00
}
}
2013-06-03 09:12:31 +03:00
2011-10-24 01:44:37 +03:00
}