-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: Improve Bind Address validation and help text
Closes #2025 (cherry picked from commit 6bdeafcf8c78e145595f52e885356be1210abe91)
- Loading branch information
Showing
5 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/NzbDrone.Common.Test/ExtensionTests/StringExtensionTests/IsValidIPAddressFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Globalization; | ||
using FluentAssertions; | ||
using NUnit.Framework; | ||
using NzbDrone.Common.Extensions; | ||
|
||
namespace NzbDrone.Common.Test.ExtensionTests.StringExtensionTests | ||
{ | ||
[TestFixture] | ||
public class IsValidIPAddressFixture | ||
{ | ||
[TestCase("192.168.0.1")] | ||
[TestCase("::1")] | ||
[TestCase("2001:db8:4006:812::200e")] | ||
public void should_validate_ip_address(string input) | ||
{ | ||
input.IsValidIpAddress().Should().BeTrue(); | ||
} | ||
|
||
[TestCase("sonarr.tv")] | ||
public void should_not_parse_non_ip_address(string input) | ||
{ | ||
input.IsValidIpAddress().Should().BeFalse(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters