public void TestInjectRefereneValue_RDNAttributeDoesNotExist_Required_ThrowException()
        {
            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.INITIALS);

            Action action = () => field.InjectReferenceValue(cert);
            action.ShouldThrow<PolicyRequiredException>();
        }
Exemplo n.º 2
0
        public void TestInjectRefereneValue_RDNAttributeDoesNotExist_Required_ThrowException()
        {
            var cert  = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.INITIALS);

            Action action = () => field.InjectReferenceValue(cert);

            action.ShouldThrow <PolicyRequiredException>();
        }
        public void TestInjectRefereneValue_RDNAttributeDoesNotExist_NotRequired_AssertValueCollection()
        {
            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(false, RDNAttributeIdentifier.INITIALS);

            field.InjectReferenceValue(cert);
            IList<String> values = field.GetPolicyValue().GetPolicyValue();
            values.Count.Should().Be(0);
        }
Exemplo n.º 4
0
        public void TestInjectRefereneValue_RDNAttributeDoesNotExist_NotRequired_AssertValueCollection()
        {
            var cert  = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(false, RDNAttributeIdentifier.INITIALS);

            field.InjectReferenceValue(cert);
            IList <String> values = field.GetPolicyValue().GetPolicyValue();

            values.Count.Should().Be(0);
        }
        public void TestInjectRefereneValue_DistinguishedName_AssertValue()
        {
            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.DISTINGUISHED_NAME);
            field.InjectReferenceValue(cert);

            IList<String> values = field.GetPolicyValue().GetPolicyValue();
            values.Count.Should().Be(1);
            values.First().Should().Be("O=Cerner,L=Kansas City,S=MO,C=US,CN=test.email.com");
        }
        public void TestInjectRefereneValue_RDNSingleAttributeExists_AssertValue()
        {
            var cert = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.COMMON_NAME);
            field.InjectReferenceValue(cert);

            IList<String> values = field.GetPolicyValue().GetPolicyValue();
            values.Count.Should().Be(1);
            values.First().Should().Be("test.email.com");
        }
Exemplo n.º 7
0
        public void TestInjectRefereneValue_DistinguishedName_AssertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.DISTINGUISHED_NAME);

            field.InjectReferenceValue(cert);

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

            values.Count.Should().Be(1);
            values.First().Should().Be("O=Cerner,L=Kansas City,S=MO,C=US,CN=test.email.com");
        }
Exemplo n.º 8
0
        public void TestInjectRefereneValue_RDNSingleAttributeExists_AssertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/altNameOnly.der");
            var field = new IssuerAttributeField(true, RDNAttributeIdentifier.COMMON_NAME);

            field.InjectReferenceValue(cert);

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

            values.Count.Should().Be(1);
            values.First().Should().Be("test.email.com");
        }