Example #1
0
 /// <summary>
 ///   Add recipient.
 /// </summary>
 public void AddPeer(Peer peer)
 {
     if (!_peers.Contains(peer._user.Bare))
     {
         _peers.Add(peer._user.Bare);
     }
 }
Example #2
0
 public void TestPeerSendMessage()
 {
     var peer = new Peer("*****@*****.**") {Password = "******"};
     peer.Login();
     peer.AddPeer("*****@*****.**");
     peer.SendMessage("message");
     peer.Logout();
 }
Example #3
0
        public void TestPeerSendReceiveMessage()
        {
            // Peer1.

            var peer1 = new Peer("*****@*****.**") {Password = "******"};
            peer1.Login();

            // Peer2.

            var peer2 = new Peer("*****@*****.**") {Password = "******"};
            peer2.Login();
            peer2.OnMessage += OnMessage;

            // Send message.

            peer1.AddPeer(peer2);
            peer1.SendMessage("message");

            // Logout.

            peer1.Logout();
            peer2.Logout();
        }
Example #4
0
 public void TestPeerLogin()
 {
     var peer = new Peer("*****@*****.**") {Password = "******"};
     peer.Login();
     peer.Logout();
 }
Example #5
0
 public void TestPeerCollection()
 {
     var peer = new Peer("*****@*****.**") { Password = "******" };
     peer.AddPeer(new[] { "recipient", "recipient", "recipient2", "*****@*****.**" });
 }