public void CreateBindingElements_Contains_HttpTransportBindingElement_And_HttpMessageEncodingBindingElement_By_Default() { HttpMessageBinding binding = new HttpMessageBinding(); HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.IsNotNull(transport, "The HttpMessageBinding.CreateBindingElements should have returned a collection with HttpTransportBindingElement."); HttpMessageEncodingBindingElement encoder = binding.CreateBindingElements().Find<HttpMessageEncodingBindingElement>(); Assert.IsNotNull(encoder, "The HttpMessageBinding.CreateBindingElements should have returned a collection with HttpMessageEncodingBindingElement."); }
public void CreateBindingElements_Contains_HttpTransportBindingElement_And_HttpMessageEncodingBindingElement_With_CredentialOnly_Security_Mode() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.TransportCredentialOnly); HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.IsNotNull(transport, "The HttpMessageBinding.CreateBindingElements should have returned a collection with HttpTransportBindingElement."); HttpMessageEncodingBindingElement encoder = binding.CreateBindingElements().Find<HttpMessageEncodingBindingElement>(); Assert.IsNotNull(encoder, "The HttpMessageBinding.CreateBindingElements should have returned a collection with HttpMessageEncodingBindingElement."); }
public void CreateBindingElements_Count_Is_Always_Two() { HttpMessageBinding binding = new HttpMessageBinding(); Assert.AreEqual(2, binding.CreateBindingElements().Count, "The HttpMessageBinding should always have two binding elements."); HttpMessageBinding bindingWithSecurity = new HttpMessageBinding(HttpMessageBindingSecurityMode.Transport); Assert.AreEqual(2, bindingWithSecurity.CreateBindingElements().Count, "The HttpMessageBinding should always have two binding elements."); HttpMessageBinding bindingWithSecurity2 = new HttpMessageBinding(HttpMessageBindingSecurityMode.TransportCredentialOnly); Assert.AreEqual(2, bindingWithSecurity2.CreateBindingElements().Count, "The HttpMessageBinding should always have two binding elements."); }
public void Setting_TransferMode_Configures_The_HttpTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(); binding.TransferMode = TransferMode.StreamedRequest; HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(TransferMode.StreamedRequest, transport.TransferMode, "HttpTransportBindingElement.TransferMode should have been TransferMode.StreamedRequest."); }
public void Setting_Security_Transport_Realm_Configures_The_HttpTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.TransportCredentialOnly); binding.Security.Transport.Realm = "SomeRealm"; HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual("SomeRealm", transport.Realm, "HttpTransportBindingElement.Realm should have been 'SomeRealm'."); }
public void Setting_Security_Transport_ProxyCredentialType_Configures_The_HttpTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.TransportCredentialOnly); binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(AuthenticationSchemes.Basic, transport.ProxyAuthenticationScheme, "HttpTransportBindingElement.ProxyAuthenticationScheme should have been AuthenticationSchemes.Basic."); }
public void Setting_Security_Transport_ClientCredentialType_Certificate_Configures_The_HttpsTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.Transport); binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; HttpsTransportBindingElement transport = binding.CreateBindingElements().Find<HttpsTransportBindingElement>(); Assert.IsTrue(transport.RequireClientCertificate, "HttpsTransportBindingElement.RequireClientCertificate should have been 'true'."); }
public void Setting_MaxReceivedMessageSize_Configures_The_HttpTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(); binding.MaxReceivedMessageSize = 100; HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(100, transport.MaxReceivedMessageSize, "HttpTransportBindingElement.MaxReceivedMessageSize should have been 100."); }
public void Setting_MaxBufferSize_Configures_The_HttpsTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.Transport); binding.MaxBufferSize = 100; HttpsTransportBindingElement transport = binding.CreateBindingElements().Find<HttpsTransportBindingElement>(); Assert.AreEqual(100, transport.MaxBufferSize, "HttpsTransportBindingElement.MaxBufferSize should have been 100."); }
public void Setting_HostNameComparisonMode_Configures_The_HttpTransportBindingElement() { HttpMessageBinding binding = new HttpMessageBinding(); binding.HostNameComparisonMode = HostNameComparisonMode.Exact; HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(HostNameComparisonMode.Exact, transport.HostNameComparisonMode, "HttpTransportBindingElement.HostNameComparisonMode should have been HostNameComparisonMode.Exact."); }
public void HttpTransportBindingElement_Realm_Is_Empty_String_By_Default() { HttpMessageBinding binding = new HttpMessageBinding(); HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(string.Empty, transport.Realm, "HttpTransportBindingElement.Realm should have been an empty string by default."); }
public void HttpTransportBindingElement_ProxyAuthenticationScheme_Is_Anonymous_By_Default() { HttpMessageBinding binding = new HttpMessageBinding(); HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.AreEqual(AuthenticationSchemes.Anonymous, transport.ProxyAuthenticationScheme, "HttpTransportBindingElement.ProxyAuthenticationScheme should have been AuthenticationSchemes.Anonymous by default."); }
public void HttpTransportBindingElement_ManualAddressing_Is_True() { HttpMessageBinding binding = new HttpMessageBinding(); HttpTransportBindingElement transport = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.IsTrue(transport.ManualAddressing, "HttpTransportBindingElement.ManualAddressing should have been 'true'."); binding.Security.Mode = HttpMessageBindingSecurityMode.Transport; HttpsTransportBindingElement transport2 = binding.CreateBindingElements().Find<HttpsTransportBindingElement>(); Assert.IsTrue(transport2.ManualAddressing, "HttpsTransportBindingElement.ManualAddressing should have been 'true'."); binding.Security.Mode = HttpMessageBindingSecurityMode.TransportCredentialOnly; HttpTransportBindingElement transport3 = binding.CreateBindingElements().Find<HttpTransportBindingElement>(); Assert.IsTrue(transport3.ManualAddressing, "HttpTransportBindingElement.ManualAddressing should have been 'true'."); }
public void HttpsTransportBindingElement_RequireClientCertificate_Is_False_By_Default() { HttpMessageBinding binding = new HttpMessageBinding(HttpMessageBindingSecurityMode.Transport); HttpsTransportBindingElement transport = binding.CreateBindingElements().Find<HttpsTransportBindingElement>(); Assert.IsFalse(transport.RequireClientCertificate, "HttpsTransportBindingElement.RequireClientCertificate should have been 'false' by default."); }