public void Delete2PoliciesTest() { CertPolicyManager mgr = CreateManager(); mgr.Count().Should().Be(9); mgr.Remove(new long[] { 1, 2 }); mgr.Count().Should().Be(7); }
public void DeletePolicyTest() { CertPolicyManager mgr = CreateManager(); CertPolicy policy = mgr.Get("Policy2"); mgr.Remove(policy.ID); mgr.Get("Policy2").Should().BeNull(); }
public void DeletePoliciesTest() { CertPolicyManager mgr = CreateManager(); mgr.Count().Should().Be(9); long[] ids = mgr.Select(certPolicy => certPolicy.ID).ToArray(); mgr.Remove(ids); mgr.Count().Should().Be(0); }
public void DeletePolicyWithAssociations() { CertPolicyGroupManager groupMgr = CreatePolicyGroupManager(); CertPolicyGroup policyGroup = groupMgr.Get("PolicyGroup1"); policyGroup.CertPolicies.Count.Should().Be(0); CertPolicyManager policyMgr = CreateManager(); policyMgr.Get("Policy1").Should().NotBeNull(); groupMgr.AddPolicyUse("Policy1", "PolicyGroup1", CertPolicyUse.PRIVATE_RESOLVER, true, true); policyGroup = groupMgr.Get("PolicyGroup1"); policyGroup.CertPolicies.Count.Should().Be(1); CertPolicyManager mgr = CreateManager(); CertPolicy policy = mgr.Get("Policy1"); mgr.Remove(policy.ID); policyMgr.Get("Policy1").Should().BeNull(); }