@@ -90,6 +90,21 @@ public void UriCtor_Should_Not_Throw_Exception(string uri)
9090 Assert . IsNotNull ( createdUri ) ;
9191 }
9292
93+ [ DataRow ( "http://user:[email protected] /Home" , "Index.html?q1=v1&q2=v2#FragmentName" , "http://user:[email protected] /Home/Index.html?q1=v1&q2=v2#FragmentName" ) ] 94+ [ DataRow ( "http://user:[email protected] /Home/" , "Index.html?q1=v1&q2=v2#FragmentName" , "http://user:[email protected] /Home/Index.html?q1=v1&q2=v2#FragmentName" ) ] 95+ [ DataRow ( "http://user:[email protected] /Home" , "/Index.html?q1=v1&q2=v2#FragmentName" , "http://user:[email protected] /Home/Index.html?q1=v1&q2=v2#FragmentName" ) ] 96+ [ DataRow ( "http://user:[email protected] /Home/" , "/Index.html?q1=v1&q2=v2#FragmentName" , "http://user:[email protected] /Home/Index.html?q1=v1&q2=v2#FragmentName" ) ] 97+ public void UriWithParamaters ( string uri , string paramaters , string correctFullUri )
98+ {
99+ Uri baseUri = new ( uri ) ;
100+ Uri fullUri = new ( correctFullUri ) ;
101+ Uri parmUri = new ( paramaters , UriKind . Relative ) ;
102+ Uri finalUri = new ( baseUri , parmUri . OriginalString ) ;
103+ Console . WriteLine ( $ "{ finalUri . OriginalString } == { fullUri . OriginalString } ") ;
104+ Assert . AreEqual ( finalUri . OriginalString , correctFullUri ) ;
105+ Assert . AreEqual ( fullUri . OriginalString , correctFullUri ) ;
106+ }
107+
93108 [ TestMethod ]
94109 [ DataRow ( "" , typeof ( ArgumentNullException ) , "ExpectedArgumentNullException" ) ]
95110 [ DataRow ( "foo" , typeof ( ArgumentException ) , "Expected ArgumentException" ) ]
@@ -467,3 +482,4 @@ private static void PrintUriPropertiesToConsole(Uri uri)
467482 }
468483 }
469484}
485+
0 commit comments