using ScadaLink.CLI.Commands; namespace ScadaLink.CLI.Tests; /// /// Regression tests for CLI-004 — a malformed --url previously reached /// new Uri(...) in the constructor /// and threw an unhandled . /// public class UrlValidationTests { [Theory] [InlineData("http://localhost:9001")] [InlineData("https://central-host:5000/")] [InlineData("http://central")] public void IsValidManagementUrl_AcceptsAbsoluteHttpUrls(string url) { Assert.True(CommandHelpers.IsValidManagementUrl(url)); } [Theory] [InlineData("localhost:9001")] // no scheme [InlineData("")] // empty [InlineData(" ")] // whitespace [InlineData("not a url")] [InlineData("ftp://central:21")] // non-http scheme public void IsValidManagementUrl_RejectsMalformedOrNonHttpUrls(string url) { Assert.False(CommandHelpers.IsValidManagementUrl(url)); } }