public void CheckPositive_Partial() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com/*"); Evidence e = new Evidence(); e.AddHost(new Url("http://www.example.com/index.html")); Assert.IsTrue(umc.Check(e), "Check(+-)"); }
public void CheckNegative() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com"); Evidence e = new Evidence(); e.AddHost(new Url("http://www.go-mono.org")); Assert.IsFalse(umc.Check(e), "Check(-)"); }
public void CheckMultipleEvidences() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com"); Evidence e = new Evidence(); e.AddHost(new Url("http://www.go-mono.org")); // the bad e.AddHost(new Url("http://www.example.com")); // the good e.AddHost(new Zone(SecurityZone.MyComputer)); // and the ugly (couldn't resist ;) Assert.IsTrue(umc.Check(e), "Check(n)"); // check all Url evidence (i.e. do not stop at the first Url evidence) }
public void Check() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com"); Evidence e = null; Assert.IsFalse(umc.Check(e), "Check(null)"); e = new Evidence(); Assert.IsFalse(umc.Check(e), "Check(empty)"); e.AddHost(new Zone(SecurityZone.MyComputer)); Assert.IsFalse(umc.Check(e), "Check(zone)"); Url u = new Url("http://www.example.com"); e.AddAssembly(u); Assert.IsFalse(umc.Check(e), "Check(url-assembly)"); e.AddHost(u); Assert.IsTrue(umc.Check(e), "Check(url-host)"); }