public void ListenForClientJoinRoomRequest(IClientConnection clientConnection) { // If connection is valid (Connected == true), then register with JoinRoomController if (clientConnection.Connected) { JoinRoomController jrc = DIContainer.GetInstanceByContextID <JoinRoomController>(InstanceServerApplication.CONTEXT_ID); jrc.AddClientConnection(clientConnection); } }
private void GetNavigationCommandFactory(string ownerUserTag, string roomName, string userTag, LoginSession loginSession, Action <TestExecResult> callback) { _localUserVm.UserTag = userTag; _localUserVm.LoginSession = loginSession; _roomVm.UserTag = ownerUserTag; _roomVm.RoomName = roomName; var navCommandFactory = new JoinRoomController(_roomService, _viewModelFactory); Action <string, string> navigationRequiredCallback = (cbOwnerUserTag, cbRoomName) => Try(() => { Assert.IsFalse(string.IsNullOrEmpty(cbOwnerUserTag), "The Owner must not be null."); Assert.IsFalse(string.IsNullOrEmpty(cbRoomName), "The Room must not be null."); if (callback != null) { callback(TestExecResult.RenavigationRequired); } }); OperationCallback joinRoomCallback = ex => Try(() => { Assert.IsNull(ex, "The JoinRoomController threw an exception: " + ex); Assert.IsNotNull(_roomVm.UserVm.Model, "The Owner must not be null."); Assert.IsNotNull(_roomVm.Model, "The Room must not be null."); Assert.IsNotNull(_localUserVm.Model, "The User must not be null."); Assert.AreEqual(_roomVm.UserTag, _roomVm.UserVm.Model.UserTag); Assert.AreEqual(_roomVm.RoomName, _roomVm.Model.Name); Assert.AreEqual(_roomVm.UserVm.Model.UserId, _roomVm.Model.User.UserId); Assert.AreEqual(_localUserVm.UserId, _localUserVm.Model.UserId); if (callback != null) { callback(TestExecResult.ExecutionCompleted); } }); navCommandFactory.Execute(navigationRequiredCallback, joinRoomCallback); }