1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-05 13:21:25 -05:00
Files
Radarr/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs
Bogdan 1e06fc5b43 Switch HttpProxySettingsProviderFixture to test cases
(cherry picked from commit 4e8fe6e81b1ac3f53135ad2e2b95d7aae811b87e)
2025-09-28 21:57:01 -05:00

39 lines
1.2 KiB
C#

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Common.Http.Proxy;
using NzbDrone.Core.Http;
using NzbDrone.Test.Common;
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,172.16.0.0/12", true, null, null);
}
[TestCase("http://eu.httpbin.org/get")]
[TestCase("http://google.com/get")]
[TestCase("http://localhost:8654/get")]
[TestCase("http://172.21.0.1:8989/api/v3/indexer/schema")]
public void should_bypass_proxy(string url)
{
var settings = GetProxySettings();
Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeTrue();
}
[TestCase("http://bing.com/get")]
[TestCase("http://172.3.0.1:8989/api/v3/indexer/schema")]
public void should_not_bypass_proxy(string url)
{
var settings = GetProxySettings();
Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeFalse();
}
}
}