Factory class that makes sasl Iathenticator classes. Also check wether sasl mechanism is supported
示例#1
0
		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());
		}
示例#2
0
		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 );
		}