public ResolveMatchingCodeGroups ( |
||
evidence | ||
리턴 |
public static void UnionCodeGroupCallMethods() { UnionCodeGroup ucg = new UnionCodeGroup(new GacMembershipCondition(), new PolicyStatement(new PermissionSet(new PermissionState()))); CodeGroup cg = ucg.Copy(); PolicyStatement ps = ucg.Resolve(new Evidence()); cg = ucg.ResolveMatchingCodeGroups(new Evidence()); }
public void ResolveMatchingCodeGroups_ThreeLevel () { UnionCodeGroup level1 = new UnionCodeGroup (new AllMembershipCondition (), new PolicyStatement (new PermissionSet (PermissionState.None))); CodeGroup level2 = level1.Copy (); level1.AddChild (level2); UnionCodeGroup level3 = new UnionCodeGroup (new ZoneMembershipCondition (SecurityZone.Untrusted), new PolicyStatement (new PermissionSet (PermissionState.Unrestricted))); level2.AddChild (level3); CodeGroup match = level1.ResolveMatchingCodeGroups (new Evidence ()); Assert.IsNotNull (match, "Match"); Assert.IsTrue (match.Equals (level1, false), "Equals(false)"); // Equals (true) isn't a deep compare (just one level) Assert.IsTrue (match.Equals (level1, true), "Equals(true)"); }
public void ResolveMatchingCodeGroups_OneLevel () { UnionCodeGroup level1 = new UnionCodeGroup (new AllMembershipCondition (), new PolicyStatement (new PermissionSet (PermissionState.None))); CodeGroup match = level1.ResolveMatchingCodeGroups (new Evidence ()); Assert.IsNotNull (match, "Match"); Assert.IsTrue (match.Equals (level1, false), "Equals(false)"); Assert.IsTrue (match.Equals (level1, true), "Equals(true)"); }
public void ResolveMatchingCodeGroups_NoMatch () { UnionCodeGroup cg = new UnionCodeGroup (new ZoneMembershipCondition (SecurityZone.Untrusted), new PolicyStatement (new PermissionSet (PermissionState.Unrestricted))); Assert.IsNull (cg.ResolveMatchingCodeGroups (new Evidence ())); }
public void ResolveMatchingCodeGroups_Null () { UnionCodeGroup cg = new UnionCodeGroup (new AllMembershipCondition (), new PolicyStatement (new PermissionSet (PermissionState.None))); cg.ResolveMatchingCodeGroups (null); }