public void CopyWithChildren() { NetCodeGroup cgChild = new NetCodeGroup(new AllMembershipCondition()); NetCodeGroup cg = new NetCodeGroup(new AllMembershipCondition()); cg.AddChild(cgChild); NetCodeGroup cg2 = (NetCodeGroup)cg.Copy(); Assert.AreEqual(cg.Children.Count, cg2.Children.Count, "Children"); Assert.AreEqual(cg.ToXml().ToString(), cg2.ToXml().ToString(), "ToXml"); }
public void Copy() { NetCodeGroup cg = new NetCodeGroup(new AllMembershipCondition()); NetCodeGroup cg2 = (NetCodeGroup)cg.Copy(); Assert.AreEqual(cg.AttributeString, cg2.AttributeString, "AttributeString"); Assert.AreEqual(cg.Children.Count, cg2.Children.Count, "Children"); Assert.AreEqual(cg.Description, cg2.Description, "Description"); Assert.AreEqual(cg.MergeLogic, cg2.MergeLogic, "MergeLogic"); Assert.AreEqual(cg.Name, cg2.Name, "Name"); Assert.AreEqual(cg.PermissionSetName, cg2.PermissionSetName, "PermissionSetName"); Assert.AreEqual(cg.ToXml().ToString(), cg2.ToXml().ToString(), "ToXml"); }
public static void NetCodeGroupCallMethods() { NetCodeGroup ncg = new NetCodeGroup(new GacMembershipCondition()); string teststring = NetCodeGroup.AbsentOriginScheme; teststring = NetCodeGroup.AnyOtherOriginScheme; ncg.AddConnectAccess("test", new CodeConnectAccess("test", 0)); CodeGroup cg = ncg.Copy(); bool equals = ncg.Equals(new object()); System.Collections.DictionaryEntry[] de = ncg.GetConnectAccessRules(); int hash = ncg.GetHashCode(); ncg.ResetConnectAccess(); PolicyStatement ps = ncg.Resolve(new Evidence()); cg = ncg.ResolveMatchingCodeGroups(new Evidence()); }