1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Proxy BypassList tests

Lightly refactored and updated documentation to make it easier for users
This commit is contained in:
Lloyd Sparkes
2016-05-02 11:24:51 +01:00
parent c82b90aca8
commit 2b11ad4585
6 changed files with 55 additions and 6 deletions
@@ -0,0 +1,40 @@
using NzbDrone.Core.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using FluentAssertions;
using NzbDrone.Test.Common;
using NzbDrone.Common.Http.Proxy;
using NzbDrone.Common.Http;
namespace NzbDrone.Core.Test.Http
{
[TestFixture]
public class HttpProxySettingsProviderFixture : TestBase<HttpProxySettingsProvider>
{
private HttpProxySettings GetProxySettings()
{
return new HttpProxySettings(ProxyType.Socks5, "localhost", 8080, "*.httpbin.org,google.com", true, null, null);
}
[Test]
public void should_bypass_proxy()
{
var settings = GetProxySettings();
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://eu.httpbin.org/get")).Should().BeTrue();
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://google.com/get")).Should().BeTrue();
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://localhost:8654/get")).Should().BeTrue();
}
[Test]
public void should_not_bypass_proxy()
{
var settings = GetProxySettings();
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://bing.com/get")).Should().BeFalse();
}
}
}