public void AddPolicy() { CertPolicyManager mgr = CreateManager(); CertPolicy expectedPolicy = new CertPolicy("UnitTestPolicy", "", "1 = 1".ToBytesUtf8()); mgr.Add(expectedPolicy); CertPolicy actualCertPolicy = mgr.Get("UnitTestPolicy"); expectedPolicy.Name.Should().BeEquivalentTo("UnitTestPolicy"); expectedPolicy.CreateDate.Should().BeCloseTo(actualCertPolicy.CreateDate); }
public void UpdatePolicyDescriptionTest() { CertPolicyManager mgr = CreateManager(); CertPolicy newCertPolicy = new CertPolicy("UnitTestPolicy", "UnitTest Policy Description", "1 = 1".ToBytesUtf8()); mgr.Add(newCertPolicy); CertPolicy actualCertPolicy = mgr.Get("UnitTestPolicy"); actualCertPolicy.Should().NotBeNull(); actualCertPolicy.Description = "blank"; mgr.Update(actualCertPolicy); CertPolicy updatedCertPolicy = mgr.Get("UnitTestPolicy"); updatedCertPolicy.Description.ShouldBeEquivalentTo("blank"); }
public void UpdatePolicyDataTest() { CertPolicyManager mgr = CreateManager(); CertPolicy newCertPolicy = new CertPolicy("UnitTestPolicy", "UnitTest Policy Description", "1 = 1".ToBytesUtf8()); mgr.Add(newCertPolicy); CertPolicy actualCertPolicy = mgr.Get("UnitTestPolicy"); actualCertPolicy.Should().NotBeNull(); actualCertPolicy.Data = "1 != 1".ToBytesUtf8(); mgr.Update(actualCertPolicy); CertPolicy updatedCertPolicy = mgr.Get("UnitTestPolicy"); updatedCertPolicy.Data.ToUtf8String().ShouldAllBeEquivalentTo("1 != 1"); }