Example #1
0
        public void DisassociatePolicyFromGroupTest()
        {
            InitCertPolicyRecords();
            InitCertPolicyGroupRecords();

            CertPolicyGroupManager mgr = CreateManager();

            //act
            mgr.AddPolicyUse("Policy1", "PolicyGroup1", CertPolicyUse.TRUST, true, true);

            CertPolicyGroup policyGroup = mgr.Get("PolicyGroup1");

            policyGroup.CertPolicies.Count.Should().Be(1);

            CertPolicyGroupMap[] map = new CertPolicyGroupMap[] { policyGroup.CertPolicyGroupMaps.First() };
            mgr.RemovePolicy(map);

            policyGroup = mgr.Get("PolicyGroup1");
            policyGroup.CertPolicies.Count.Should().Be(0);
        }