public void testSaslFactory(){ SaslFactory saslFactory = new SaslFactory(); ISaslMechanism mechanism = saslFactory.Make( "digest-md5" ); mechanism.Password = password; mechanism.UserName = username; mechanism.Server = server; mechanism.Protocol = "xmpp"; mechanism.Challenge = challenge; Assert.AreEqual(response, mechanism.GetResponse()); }
public void testErrorSaslFactory(){ bool fail = false; SaslFactory saslFactory = new SaslFactory(); try{ ISaslMechanism mechanism = saslFactory.Make( "md5" ); mechanism.Password = password; mechanism.UserName = username; mechanism.Server = server; mechanism.Challenge = challenge; Assert.AreEqual(response, mechanism.GetResponse()); } catch( SaslMechanismNotAvailableException){ fail = true; } Assert.IsTrue( fail ); }