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); }
//[Ignore("TODO: deal with cm calling OnProtocol +=.")] public void RoomFinishLeaveTest() { using (mocks.Record()) { Expect.Call(stream.Document).Return(doc); stream.OnProtocol += null; IEventRaiser onProtocol = LastCall.IgnoreArguments().GetEventRaiser(); stream.Write((XmlElement)null); LastCall.Callback((Func <XmlElement, bool>) delegate(XmlElement elem) { onProtocol.Raise(new object[] { null, CreateUnavailPacket(elem) }); return(true); }); } using (mocks.Playback()) { Room testRoom = CreateRoomPlayback(false, delegate { return(null); }); testRoom.Leave(REASON); } Assert.IsFalse(cm.HasRoom(jid)); }