@@ -90,6 +90,21 @@ public void UriCtor_Should_Not_Throw_Exception(string uri)
90
90
Assert . IsNotNull ( createdUri ) ;
91
91
}
92
92
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
+
93
108
[ TestMethod ]
94
109
[ DataRow ( "" , typeof ( ArgumentNullException ) , "ExpectedArgumentNullException" ) ]
95
110
[ DataRow ( "foo" , typeof ( ArgumentException ) , "Expected ArgumentException" ) ]
@@ -467,3 +482,4 @@ private static void PrintUriPropertiesToConsole(Uri uri)
467
482
}
468
483
}
469
484
}
485
+
0 commit comments