public void setup()
        {
            mocks = new MockRepository();
            stream = mocks.DynamicMock<XmppStream>();
            tracker = mocks.DynamicMock<IIQTracker>();
            cm = null;

            doc = new XmlDocument();
        }
        public void HasRoomTest()
        {
            cm = new ConferenceManager();
            cm.Stream = stream;

            bool roomExists = cm.HasRoom(jid);
            Assert.IsFalse(roomExists);

            cm.GetRoom(jid);
            roomExists = cm.HasRoom(jid);
            Assert.IsTrue(roomExists);
        }
 /// <summary>
 /// Create.
 /// </summary>
 /// <param name="manager">The manager for this room.</param>
 /// <param name="roomAndNick">room@conference/nick, where "nick" is the desred nickname in the room.</param>
 internal Room(ConferenceManager manager, JID roomAndNick)
 {
     m_manager = manager;
     XmppStream stream = manager.Stream;
     m_jid = roomAndNick;
     m_room = new JID(m_jid.User, m_jid.Server, null);
     stream.OnProtocol += new Jabber.Protocol.ProtocolHandler(m_stream_OnProtocol);
     JabberClient jc = stream as JabberClient;
     if (jc != null)
         jc.OnAfterPresenceOut += new Jabber.Client.PresenceHandler(m_stream_OnAfterPresenceOut);
 }
        private Room CreateRoomPlayback(bool joinRoom, Func<Room, Room> alterRoom)
        {
            cm = new ConferenceManager();
            cm.Stream = stream;

            Room testRoom = cm.GetRoom(jid);
            alterRoom(testRoom);
            if (joinRoom)
            {
                testRoom.Join();
            }

            return testRoom;
        }