예제 #1
0
      public void CanEvaluateChallenge()
      {
         Hashtable props = new Hashtable();
         ISaslClient client = new PlainSaslClient(AUTHID, props, this);

         Assert.IsFalse(client.IsComplete);
         byte[] response = client.EvaluateChallenge(new byte[0]);
         string[] parts = Encoding.UTF8.GetString(response).Split('\0');
         
         Assert.AreEqual(3, parts.Length);
         Assert.AreEqual(AUTHID, parts[0]);
         Assert.AreEqual(USERNAME, parts[1]);
         Assert.AreEqual(PASSWORD, parts[2]);
         Assert.IsTrue(client.IsComplete);
      }
예제 #2
0
      public void HasInitialResponseReturnsTrue()
      {
         ISaslClient client = new PlainSaslClient(AUTHID, new Hashtable(), this);

         Assert.IsTrue(client.HasInitialResponse);
      }
예제 #3
0
      public void ReturnsRightMechanismName()
      {
         ISaslClient client = new PlainSaslClient(AUTHID, new Hashtable(), this);

         Assert.AreEqual("PLAIN", client.MechanismName);
      }