Ejemplo n.º 1
0
        public void Constructor3()
        {
            transport.is_server = false;
            PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(false, pwAuth.GetServer());
            Assert.AreEqual("mary", pwAuth.TransportQuery(PwAuth.USER));
            Assert.AreEqual("2345", pwAuth.TransportQuery(PwAuth.PASSWORD));
        }
Ejemplo n.º 2
0
        public void Constructor4()
        {
            transport.is_server = false;
            PwAuth pwAuth = newPwAuth("tcp://alice@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(false, pwAuth.GetServer());
            Assert.AreEqual("alice", pwAuth.TransportQuery(PwAuth.USER));
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.PASSWORD));
        }
Ejemplo n.º 3
0
        public void Constructor1()
        {
            transport.is_server = true;
            PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(true, pwAuth.GetServer());
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.USER));
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.PASSWORD));
        }