public void Mode_Throws_With_Invalid_HttpBindingSecurityMode_Value() { ExceptionAssert.ThrowsInvalidEnumArgument("value", 99, typeof(HttpBindingSecurityMode), () => { HttpBindingSecurity security = new HttpBindingSecurity(); security.Mode = (HttpBindingSecurityMode)99; }); }
public void Transport_Can_Be_Set() { HttpBindingSecurity security = new HttpBindingSecurity(); HttpTransportSecurity transport = new HttpTransportSecurity(); transport.ClientCredentialType = HttpClientCredentialType.Basic; security.Transport = transport; Assert.AreEqual(HttpClientCredentialType.Basic, security.Transport.ClientCredentialType, "HttpBindingSecurity.Transport.ClientCredentialType should have been HttpClientCredentialType.Basic."); }
public void Mode_Can_Be_Set() { HttpBindingSecurity security = new HttpBindingSecurity(); security.Mode = HttpBindingSecurityMode.Transport; Assert.AreEqual(HttpBindingSecurityMode.Transport, security.Mode, "HttpBindingSecurity.Mode should have been HttpBindingSecurityMode.Transport."); security.Mode = HttpBindingSecurityMode.TransportCredentialOnly; Assert.AreEqual(HttpBindingSecurityMode.TransportCredentialOnly, security.Mode, "HttpBindingSecurity.Mode should have been HttpBindingSecurityMode.TransportCredentialOnly."); }
public void Transport_Resets_To_New_Instance_If_Set_To_Null() { HttpBindingSecurity security = new HttpBindingSecurity(); HttpTransportSecurity transport = security.Transport; transport.ClientCredentialType = HttpClientCredentialType.Basic; security.Transport = null; Assert.AreNotSame(transport, security.Transport, "HttpBindingSecurity.Transport should have been a new instance of HttpTransportSecurity."); Assert.AreEqual(HttpClientCredentialType.None, security.Transport.ClientCredentialType, "HttpBindingSecurity.Transport.ClientCredentialType should have been HttpClientCredentialType.None."); }
private void Initialize() { this.security = new HttpBindingSecurity(); this.httpTransportBindingElement = new HttpTransportBindingElement(); this.httpTransportBindingElement.ManualAddressing = true; this.httpsTransportBindingElement = new HttpsTransportBindingElement(); this.httpsTransportBindingElement.ManualAddressing = true; this.httpHandlerBindingElement = new HttpMessageHandlerBindingElement(); this.httpMessageEncodingBindingElement = new HttpMessageEncodingBindingElement(); }
private void Initialize() { this.security = new HttpBindingSecurity(); this.httpTransportBindingElement = new HttpTransportBindingElement(); this.httpTransportBindingElement.ManualAddressing = true; this.httpsTransportBindingElement = new HttpsTransportBindingElement(); this.httpsTransportBindingElement.ManualAddressing = true; this.httpHandlerBindingElement = new HttpMessageHandlerBindingElement(); this.httpMessageEncodingBindingElement = new HttpMessageEncodingBindingElement(); }
public void Transport_Is_Not_Null() { HttpBindingSecurity security = new HttpBindingSecurity(); Assert.IsNotNull(security.Transport, "HttpBindingSecurity.Transport should not be null."); }
public void Mode_Is_None_By_Default() { HttpBindingSecurity security = new HttpBindingSecurity(); Assert.AreEqual(HttpBindingSecurityMode.None, security.Mode, "HttpBindingSecurity.Mode should have been HttpBindingSecurityMode.None by default."); }
public void Transport_Realm_Is_Empty_String_By_Default() { HttpBindingSecurity security = new HttpBindingSecurity(); Assert.AreEqual(string.Empty, security.Transport.Realm, "HttpBindingSecurity.Transport.Realm should have been empty string."); }
public void Transport_ExtendedProtectionPolicy_PolicyEnforcement_Is_Never_By_Default() { HttpBindingSecurity security = new HttpBindingSecurity(); Assert.AreEqual(PolicyEnforcement.Never, security.Transport.ExtendedProtectionPolicy.PolicyEnforcement, "HttpBindingSecurity.Transport.ExtendedProtectionPolicy.PolicyEnforcement should have been PolicyEnforcement.Never by default."); }
public void Transport_HttpProxyCredentialType_Is_None_By_Default() { HttpBindingSecurity security = new HttpBindingSecurity(); Assert.AreEqual(HttpProxyCredentialType.None, security.Transport.ProxyCredentialType, "HttpBindingSecurity.Transport.ProxyCredentialType should have been HttpProxyCredentialType.None by default."); }