ResolveUri() public method

public ResolveUri ( Uri baseUri, string relativeUri ) : Uri
baseUri Uri
relativeUri string
return Uri
		public void EmptyEvidenceDeniedAccess ()
		{
			XmlResolver r = new XmlSecureResolver (new XmlUrlResolver (), (Evidence) null);
			r.GetEntity (r.ResolveUri (null, "http://www.go-mono.com"), null, typeof (Stream));
		}
		public void EmptyCtorCannotResolve ()
		{
			XmlSecureResolver r = new XmlSecureResolver (null, (Evidence)null);
			r.ResolveUri (null, "http://www.go-mono.com");
		}
		public void EmptyEvidenceWontMatter ()
		{
			XmlSecureResolver r = new XmlSecureResolver (new XmlUrlResolver (), (Evidence)null);
			Uri uri = r.ResolveUri (null, "http://www.go-mono.com");
			Assert.IsNotNull (uri);
		}
Beispiel #4
0
		public void TestAsync ()
		{
			var loc = Assembly.GetExecutingAssembly ().Location;
			Evidence e = XmlSecureResolver.CreateEvidenceForUrl (loc);
			var ur = new XmlUrlResolver ();
			var sr = new XmlSecureResolver (ur, e);
			Uri resolved = sr.ResolveUri (null, loc);
			Assert.AreEqual ("file", resolved.Scheme);
			var task = sr.GetEntityAsync (resolved, null, typeof (Stream));
			Assert.That (task.Wait (3000));
			Assert.IsTrue (task.Result is FileStream, "Unexpected type: " + task.Result.GetType());
		}