@@ -31,4 +31,87 @@ public void Combine_must_handle_empty_array() =>
3131
3232 [ Test ]
3333 public void Combine_must_handle_null ( ) => Assert . Throws < ArgumentNullException > ( ( ) => WebPath . Combine ( null ) ) ;
34+
35+
36+ [ Test ]
37+ [ TestCase ( "ftp://hello.com/" , UriKind . Absolute , ExpectedResult = true ) ]
38+ [ TestCase ( "file:///hello.com/" , UriKind . Absolute , ExpectedResult = true ) ]
39+ [ TestCase ( "ws://hello.com/" , UriKind . Absolute , ExpectedResult = true ) ]
40+ [ TestCase ( "wss://hello.com/" , UriKind . Absolute , ExpectedResult = true ) ]
41+ [ TestCase ( "https://hello.com:8080/" , UriKind . Absolute , ExpectedResult = true ) ]
42+ [ TestCase ( "http://hello.com:8080/" , UriKind . Absolute , ExpectedResult = true ) ]
43+ [ TestCase ( "https://hello.com/path" , UriKind . Absolute , ExpectedResult = true ) ]
44+ [ TestCase ( "http://hello.com/path" , UriKind . Absolute , ExpectedResult = true ) ]
45+ [ TestCase ( "https://hello.com/path?query=param" , UriKind . Absolute , ExpectedResult = true ) ]
46+ [ TestCase ( "http://hello.com/path?query=param" , UriKind . Absolute , ExpectedResult = true ) ]
47+ [ TestCase ( "https://hello.com/path#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
48+ [ TestCase ( "http://hello.com/path#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
49+ [ TestCase ( "https://hello.com/path?query=param#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
50+ [ TestCase ( "http://hello.com/path?query=param#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
51+ [ TestCase ( "https://hello.com:8080/path?query=param#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
52+ [ TestCase ( "http://hello.com:8080/path?query=param#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
53+ [ TestCase ( "//hello.com:8080/path?query=param#fragment" , UriKind . Absolute , ExpectedResult = true ) ]
54+ [ TestCase ( "//hello.com:8080/path" , UriKind . Absolute , ExpectedResult = true ) ]
55+ [ TestCase ( "//hello.com:8080" , UriKind . Absolute , ExpectedResult = true ) ]
56+ [ TestCase ( "//hello.com" , UriKind . Absolute , ExpectedResult = true ) ]
57+ [ TestCase ( "/test/test.jpg" , UriKind . Absolute , ExpectedResult = false ) ]
58+ [ TestCase ( "/test" , UriKind . Absolute , ExpectedResult = false ) ]
59+ [ TestCase ( "test" , UriKind . Absolute , ExpectedResult = false ) ]
60+ [ TestCase ( "" , UriKind . Absolute , ExpectedResult = false ) ]
61+ [ TestCase ( null , UriKind . Absolute , ExpectedResult = false ) ]
62+ [ TestCase ( "this is not welformed" , UriKind . Absolute , ExpectedResult = false ) ]
63+ [ TestCase ( "ftp://hello.com/" , UriKind . Relative , ExpectedResult = false ) ]
64+ [ TestCase ( "file:///hello.com/" , UriKind . Relative , ExpectedResult = false ) ]
65+ [ TestCase ( "ws://hello.com/" , UriKind . Relative , ExpectedResult = false ) ]
66+ [ TestCase ( "wss://hello.com/" , UriKind . Relative , ExpectedResult = false ) ]
67+ [ TestCase ( "https://hello.com:8080/" , UriKind . Relative , ExpectedResult = false ) ]
68+ [ TestCase ( "http://hello.com:8080/" , UriKind . Relative , ExpectedResult = false ) ]
69+ [ TestCase ( "https://hello.com/path" , UriKind . Relative , ExpectedResult = false ) ]
70+ [ TestCase ( "http://hello.com/path" , UriKind . Relative , ExpectedResult = false ) ]
71+ [ TestCase ( "https://hello.com/path?query=param" , UriKind . Relative , ExpectedResult = false ) ]
72+ [ TestCase ( "http://hello.com/path?query=param" , UriKind . Relative , ExpectedResult = false ) ]
73+ [ TestCase ( "https://hello.com/path#fragment" , UriKind . Relative , ExpectedResult = false ) ]
74+ [ TestCase ( "http://hello.com/path#fragment" , UriKind . Relative , ExpectedResult = false ) ]
75+ [ TestCase ( "https://hello.com/path?query=param#fragment" , UriKind . Relative , ExpectedResult = false ) ]
76+ [ TestCase ( "http://hello.com/path?query=param#fragment" , UriKind . Relative , ExpectedResult = false ) ]
77+ [ TestCase ( "https://hello.com:8080/path?query=param#fragment" , UriKind . Relative , ExpectedResult = false ) ]
78+ [ TestCase ( "http://hello.com:8080/path?query=param#fragment" , UriKind . Relative , ExpectedResult = false ) ]
79+ [ TestCase ( "//hello.com:8080/path?query=param#fragment" , UriKind . Relative , ExpectedResult = false ) ]
80+ [ TestCase ( "//hello.com:8080/path" , UriKind . Relative , ExpectedResult = false ) ]
81+ [ TestCase ( "//hello.com:8080" , UriKind . Relative , ExpectedResult = false ) ]
82+ [ TestCase ( "//hello.com" , UriKind . Relative , ExpectedResult = false ) ]
83+ [ TestCase ( "/test/test.jpg" , UriKind . Relative , ExpectedResult = true ) ]
84+ [ TestCase ( "/test" , UriKind . Relative , ExpectedResult = true ) ]
85+ [ TestCase ( "test" , UriKind . Relative , ExpectedResult = true ) ]
86+ [ TestCase ( "" , UriKind . Relative , ExpectedResult = false ) ]
87+ [ TestCase ( null , UriKind . Relative , ExpectedResult = false ) ]
88+ [ TestCase ( "this is not welformed" , UriKind . Relative , ExpectedResult = false ) ]
89+ [ TestCase ( "ftp://hello.com/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
90+ [ TestCase ( "file:///hello.com/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
91+ [ TestCase ( "ws://hello.com/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
92+ [ TestCase ( "wss://hello.com/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
93+ [ TestCase ( "https://hello.com:8080/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
94+ [ TestCase ( "http://hello.com:8080/" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
95+ [ TestCase ( "https://hello.com/path" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
96+ [ TestCase ( "http://hello.com/path" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
97+ [ TestCase ( "https://hello.com/path?query=param" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
98+ [ TestCase ( "http://hello.com/path?query=param" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
99+ [ TestCase ( "https://hello.com/path#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
100+ [ TestCase ( "http://hello.com/path#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
101+ [ TestCase ( "https://hello.com/path?query=param#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
102+ [ TestCase ( "http://hello.com/path?query=param#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
103+ [ TestCase ( "https://hello.com:8080/path?query=param#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
104+ [ TestCase ( "http://hello.com:8080/path?query=param#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
105+ [ TestCase ( "//hello.com:8080/path?query=param#fragment" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
106+ [ TestCase ( "//hello.com:8080/path" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
107+ [ TestCase ( "//hello.com:8080" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
108+ [ TestCase ( "//hello.com" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
109+ [ TestCase ( "/test/test.jpg" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
110+ [ TestCase ( "/test" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
111+ [ TestCase ( "test" , UriKind . RelativeOrAbsolute , ExpectedResult = true ) ]
112+ [ TestCase ( "" , UriKind . RelativeOrAbsolute , ExpectedResult = false ) ]
113+ [ TestCase ( null , UriKind . RelativeOrAbsolute , ExpectedResult = false ) ]
114+ [ TestCase ( "this is not welformed" , UriKind . RelativeOrAbsolute , ExpectedResult = false ) ]
115+ public bool IsWellFormedWebPath ( string ? webPath , UriKind uriKind ) => WebPath . IsWellFormedWebPath ( webPath , uriKind ) ;
116+
34117}
0 commit comments