public void When_cipheroptsommitted_should_contian_none() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.Null(digestChallenge.CipherOptions); }
public void When_charset_ommitted_should_default() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual("iso-8859-1", digestChallenge.CharacterSet.WebName); }
public void When_charset_supplied_should_contain_value() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual("utf-8", digestChallenge.CharacterSet.WebName); }
public void When_a_realm_is_supplied_twice_should_contain_value_once() { const string challange = "realm=\"somerealm\",realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual(1, digestChallenge.Realms.Count()); }
public void When_two_realm_are_supplied_should_contain_both() { const string challange = "realm=\"somerealm1\",realm=\"somerealm2\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual(2, digestChallenge.Realms.Count()); Assert.Contains("somerealm1", digestChallenge.Realms.ToList()); Assert.Contains("somerealm2", digestChallenge.Realms.ToList()); }
public void When_qop_supplied_should_contain_value() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",qop=\"auth-int\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.Contains("auth", digestChallenge.QopOptions.ToList()); Assert.Contains("auth-int", digestChallenge.QopOptions.ToList()); }
public void When_no_qopoption_supplied_should_default_to_Auth() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.Contains("auth", digestChallenge.QopOptions.ToList()); }
public void When_maxbuf_supplied_should_contain_value() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",maxbuf=10000,charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual(10000, digestChallenge.MaximumBufferSize); }
public void When_maxbuf_ommitted_should_default_to_65536() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess"; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.AreEqual(65536, digestChallenge.MaximumBufferSize); }
public void When_cipheropts_supplied_should_contain_value() { const string challange = "realm=\"somerealm\",nonce=\"somenonce\",qop=\"auth\",charset=utf-8,algorithm=md5-sess,cipher=\"3des\""; var digestChallenge = new DigestMD5SaslMechanism.DigestMD5Challenge(challange); Assert.NotNull(digestChallenge.CipherOptions); Assert.AreEqual(1, digestChallenge.CipherOptions.Count()); Assert.Contains("3des", digestChallenge.CipherOptions.ToList()); }