public void TestInjectRefereneValue_PolicyQualUriNotExist_Required_AssertException()
        {
            var    cert   = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var    field  = new CertificatePolicyCpsUriExtensionField(true);
            Action action = () => field.InjectReferenceValue(cert);

            action.ShouldThrow <PolicyRequiredException>();
        }
        public void TestInjectRefereneValue_PolicyQualUriDoesNotExist_NotRequired_AssertValueEmpty()
        {
            var cert  = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new CertificatePolicyCpsUriExtensionField(false);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Should().BeEmpty();
        }
        public void TestInjectRefereneValue_PolicyQualUriNotExist_Required_AssertException()
        {

            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new CertificatePolicyCpsUriExtensionField(true);
            Action action = () => field.InjectReferenceValue(cert);
            action.ShouldThrow<PolicyRequiredException>();
        }
        public void TestInjectRefereneValue_PolicyQualUriDoesNotExist_NotRequired_AssertValueEmpty()
        {

            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new CertificatePolicyCpsUriExtensionField(false);
            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Should().BeEmpty();
        }
        public void TestInjectRefereneValue_PolicyQualUriExists_AssertValue()
        {
            var cert = new X509Certificate2(@"resources/certs/CernerDirectProviderCA.der");
            var field = new CertificatePolicyCpsUriExtensionField(false);
            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Should().NotBeEmpty();

            IList<String> usages = field.GetPolicyValue().GetPolicyValue();
            usages.Should().Contain("http://www.cerner.com/CPS");
        }
        public void testInjectRefereneValue_mixedCPS_assertValue()
        {

            var cert = new X509Certificate2(@"resources/certs/policyMixedQualifier.der");
            var field = new CertificatePolicyCpsUriExtensionField(true);
            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Count.Should().Be(2);

            IList<String> usages = field.GetPolicyValue().GetPolicyValue();
            usages.Should().Contain("https://www.phicert.com/cps", "https://www.phicert.com/cps");
        }
        public void testInjectRefereneValue_mixedCPS_assertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/policyMixedQualifier.der");
            var field = new CertificatePolicyCpsUriExtensionField(true);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Count.Should().Be(2);

            IList <String> usages = field.GetPolicyValue().GetPolicyValue();

            usages.Should().Contain("https://www.phicert.com/cps", "https://www.phicert.com/cps");
        }
        public void testInjectRefereneValue_policyQualUriExistsAndRequired_assertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/CernerDirectProviderCA.der");
            var field = new CertificatePolicyCpsUriExtensionField(true);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Should().NotBeEmpty();

            IList <String> usages = field.GetPolicyValue().GetPolicyValue();

            usages.Should().Contain("http://www.cerner.com/CPS");
        }