Beispiel #1
0
 public void SecureRequest_ClientCertificateOptionAutomatic_CertStoreHasValidAndInvalidCerts_ValidCertificateContextSet()
 {
     using (var handler = new WinHttpHandler())
     {
         var helper = new ClientCertificateHelper();
         TestControl.CurrentUserCertificateStore = helper.ValidAndInvalidClientCertificateCollection;
         handler.ClientCertificateOption         = ClientCertificateOption.Automatic;
         using (HttpResponseMessage response = SendRequestHelper.Send(
                    handler,
                    () => { },
                    TestServer.FakeSecureServerEndpoint))
         {
             Assert.Equal(1, APICallHistory.WinHttpOptionClientCertContext.Count);
             Assert.NotEqual(IntPtr.Zero, APICallHistory.WinHttpOptionClientCertContext[0]);
         }
     }
 }
 public void SecureRequest_ClientCertificateOptionAutomatic_CertStoreHasValidAndInvalidCerts_ValidCertificateContextSet()
 {
     using (var handler = new WinHttpHandler())
     {
         var helper = new ClientCertificateHelper();
         TestControl.CurrentUserCertificateStore = helper.ValidAndInvalidClientCertificateCollection;
         handler.ClientCertificateOption = ClientCertificateOption.Automatic;
         using (HttpResponseMessage response = SendRequestHelper.Send(
             handler,
             () => { },
             TestServer.FakeSecureServerEndpoint))
         {
             Assert.Equal(1, APICallHistory.WinHttpOptionClientCertContext.Count);
             Assert.NotEqual(IntPtr.Zero, APICallHistory.WinHttpOptionClientCertContext[0]);
         }
     }
 }