Exemple #1
0
        public void CanCreateExternal()
        {
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "EXTERNAL", "OTHER" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(ExternalSaslClient), client);
        }
Exemple #2
0
        public void ReturnsNullIfNoFactoryFound()
        {
            Hashtable props = new Hashtable();

            props.Add(SaslProperties.PolicyNoPlainText, true);
            string[]    mechanisms = new string[] { "PLAIN", "OTHER" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNull(client);
        }
Exemple #3
0
        public void CanCreateDigest()
        {
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "DIGEST-MD5", "OTHER" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(DigestSaslClient), client);
        }
Exemple #4
0
        public void CanCreateAnonymous()
        {
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "ANONYMOUS", "OTHER" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(AnonymousSaslClient), client);
        }
Exemple #5
0
        public void CanCreatePlain()
        {
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "PLAIN", "OTHER" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(PlainSaslClient), client);
        }
Exemple #6
0
        public void ChoosesStrongerMechanism()
        {
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "PLAIN", "OTHER", "CRAM-MD5" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(CramMD5SaslClient), client);
        }
Exemple #7
0
        public void ParsesConfigurationSection()
        {
            // if the TEST mechanism is available, then we know
            // the configuration section worked!
            Hashtable props = new Hashtable();

            string[]    mechanisms = new string[] { "TEST" };
            ISaslClient client     = Sasl.CreateClient(mechanisms, "", "", "", props, this);

            Assert.IsNotNull(client);
            Assert.IsInstanceOfType(typeof(TestSaslClient), client);
        }