Beispiel #1
0
        /// <summary>
        /// Handle command from client
        /// </summary>
        /// <param name="command">command in text format</param>
        /// <returns>Respoinse from server</returns>
        public string SendCommand(string command)
        {
            Response handleResult = ServerConsole.HandleCommand(command, _currentUser.Context);

            if (handleResult.SystemChanged)
            {
                ConnectedUsers.ForEach(u =>
                {
                    if (!ReferenceEquals(_currentUser, u))
                    {
                        u.Callback.Receive(
                            String.Format("{0} performs command: {1}", _currentUser.Context.UserName, command));
                    }
                });
            }
            return(handleResult.Text);
        }
Beispiel #2
0
 public void Console_ParseCommand()
 {
     _serverConsole.HandleCommand("CD C:\\word", _userContext);
     _engineMock.Verify(s => s.Navigate(It.Is <CommandContext>(c => c.Args.Length == 1 && c.Args[0] == "C:\\word")));
 }