diff options
| author | David <daullmer@gmail.com> | 2021-03-23 17:39:55 +0100 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2021-03-23 17:39:55 +0100 |
| commit | c2af50c51dd4d49ce44604ba5b34d77fad01a130 (patch) | |
| tree | 28b062593c981bd6dfbb096422b4046d58fd3d78 /tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | |
| parent | 19e4ef82dda1cbba9d533047950afb42c425749a (diff) | |
Add tests for IsInNetwork
Diffstat (limited to 'tests/Jellyfin.Networking.Tests/NetworkParseTests.cs')
| -rw-r--r-- | tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs index c3469035e..d8541d76b 100644 --- a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs +++ b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs @@ -13,7 +13,7 @@ namespace Jellyfin.Networking.Tests { public class NetworkParseTests { - private static IConfigurationManager GetMockConfig(NetworkConfiguration conf) + internal static IConfigurationManager GetMockConfig(NetworkConfiguration conf) { var configManager = new Mock<IConfigurationManager> { @@ -55,32 +55,6 @@ namespace Jellyfin.Networking.Tests } /// <summary> - /// Check that the value given is in the network provided. - /// </summary> - /// <param name="network">Network address.</param> - /// <param name="value">Value to check.</param> - [Theory] - [InlineData("192.168.10.0/24, !192.168.10.60/32", "192.168.10.60")] - public void IsInNetwork(string network, string value) - { - if (network == null) - { - throw new ArgumentNullException(nameof(network)); - } - - var conf = new NetworkConfiguration() - { - EnableIPV6 = true, - EnableIPV4 = true, - LocalNetworkSubnets = network.Split(',') - }; - - using var nm = new NetworkManager(GetMockConfig(conf), new NullLogger<NetworkManager>()); - - Assert.False(nm.IsInLocalNetwork(value)); - } - - /// <summary> /// Checks IP address formats. /// </summary> /// <param name="address"></param> |
