public void testInjectRefereneValue_subjectAltNameExists_dnsName_assertValue()
 {
     var cert = new X509Certificate2(@"resources/certs/cernerdemos.der");
     var field = new SubjectAltNameExtensionField(false);
     field.InjectReferenceValue(cert);
     field.GetPolicyValue().GetPolicyValue().Count.Should().Be(1);
     field.GetPolicyValue()
         .GetPolicyValue()
         .FirstOrDefault()
         .Should()
         .Be("dns:messaging.cernerdemos.com");
 }
 public void testInjectRefereneValue_subjectAltNameExists_rfc822Name_assertValue()
 {
     var cert = new X509Certificate2(@"resources/certs/[email protected]");
     var field = new SubjectAltNameExtensionField(false);
     field.InjectReferenceValue(cert);
     field.GetPolicyValue().GetPolicyValue().Count.Should().Be(1);
     field.GetPolicyValue()
         .GetPolicyValue()
         .FirstOrDefault()
         .Should()
         .Be("rfc822:[email protected]");
 }
        public void testInjectRefereneValue_subjectAltNameExists_dnsName_assertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/cernerdemos.der");
            var field = new SubjectAltNameExtensionField(false);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Count.Should().Be(1);
            field.GetPolicyValue()
            .GetPolicyValue()
            .FirstOrDefault()
            .Should()
            .Be("dns:messaging.cernerdemos.com");
        }
        public void testInjectRefereneValue_subjectAltNameExists_rfc822Name_assertValue()
        {
            var cert  = new X509Certificate2(@"resources/certs/[email protected]");
            var field = new SubjectAltNameExtensionField(false);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Count.Should().Be(1);
            field.GetPolicyValue()
            .GetPolicyValue()
            .FirstOrDefault()
            .Should()
            .Be("rfc822:[email protected]");
        }
        public void testInjectRefereneValue_noInjection_getPolicyValue_assertException()
        {
            var    field  = new SubjectAltNameExtensionField(true);
            Action action = () => field.GetPolicyValue();

            action.ShouldThrow <InvalidOperationException>();
        }
 public void testInjectRefereneValue_subjectAltNameDoesNotExist_notRequired_assertEmptyCollection()
 {
     var cert = new X509Certificate2(@"resources/certs/dsa1024.der");
     var field = new SubjectAltNameExtensionField(false);
     field.InjectReferenceValue(cert);
     field.GetPolicyValue().GetPolicyValue().Count.Should().Be(0);
 }
        public void testInjectRefereneValue_subjectAltNameDoesNotExist_notRequired_assertEmptyCollection()
        {
            var cert  = new X509Certificate2(@"resources/certs/dsa1024.der");
            var field = new SubjectAltNameExtensionField(false);

            field.InjectReferenceValue(cert);
            field.GetPolicyValue().GetPolicyValue().Count.Should().Be(0);
        }
 public void testInjectRefereneValue_noInjection_getPolicyValue_assertException()
 {
     var field = new SubjectAltNameExtensionField(true);
     Action action = () => field.GetPolicyValue();
     action.ShouldThrow<InvalidOperationException>();
 }