public static void HashMembershipConditionCallMethods() { HashMembershipCondition hmc = new HashMembershipCondition(Cryptography.SHA1.Create(), new byte[1]); bool check = hmc.Check(new Evidence()); IMembershipCondition obj = hmc.Copy(); check = hmc.Equals(new object()); int hash = hmc.GetHashCode(); string str = hmc.ToString(); SecurityElement se = new SecurityElement(""); PolicyLevel pl = (PolicyLevel)Activator.CreateInstance(typeof(PolicyLevel), true); hmc.FromXml(se); hmc.FromXml(se, pl); se = hmc.ToXml(); se = hmc.ToXml(pl); }
public void Check () { HashMembershipCondition hash = new HashMembershipCondition (md5, digestMd5); Evidence e = null; Assert.IsFalse (hash.Check (e), "Check (null)"); e = new Evidence (); Assert.IsFalse (hash.Check (e), "Check (empty)"); e.AddHost (new Zone (SecurityZone.MyComputer)); Assert.IsFalse (hash.Check (e), "Check (zone)"); e.AddAssembly (hashEvidence); Assert.IsFalse (hash.Check (e), "Check (hash-assembly)"); e = new Evidence (); e.AddHost (hashEvidence); Assert.IsTrue (hash.Check (e), "Check (MD5-host)"); hash = new HashMembershipCondition (sha1, digestSha1); Assert.IsTrue (hash.Check (e), "Check (SHA1-host)"); }