public void ParseOrDefault_WithoutScheme_CanParse(string input, string expected) { var result = HttpUriParser.ParseOrDefault(input); var expectedUri = new Uri(expected); Assert.Equal(expectedUri, result); Assert.True(result.IsAbsoluteUri); }
public void ParseOrDefault_WhenNotAbsolute_ParsesAsRelative(string input) { var result = HttpUriParser.ParseOrDefault(input); var expectedUri = new Uri(input, UriKind.Relative); Assert.Equal(expectedUri, result); Assert.True(!result.IsAbsoluteUri); }
public void ParseOrDefault_WhenNullOrEmpty_ReturnsNull(string input) { var result = HttpUriParser.ParseOrDefault(input); Assert.Null(result); }
public void ParseOrDefault_WithInvalidScheme_ReturnsNull(string input) { var result = HttpUriParser.ParseOrDefault(input); Assert.Null(result); }