Esempio n. 1
0
        public void ParsingInput_For_PostCommand()
        {
            //Arrange
            var expectedOutput = new ConsoleInput
            {
                Command  = "->",
                Mesage   = "hello",
                UserName = "******"
            };

            var expectedInput = "John -> hello";

            //Act
            var actualResult = _parseCommand.ParsingInput(expectedInput);

            //Assert
            Assert.AreEqual(expectedOutput.Command, actualResult.Command);
            Assert.AreEqual(expectedOutput.Mesage, actualResult.Mesage);
            Assert.AreEqual(expectedOutput.UserName, actualResult.UserName);
        }
Esempio n. 2
0
        private ConsoleInput CanHandleCommand(string element)
        {
            var parameters = _parseCommand.ParsingInput(element);

            if (parameters.Command == "follows")
            {
                return(parameters);
            }

            return(null);
        }
Esempio n. 3
0
        private ConsoleInput CanHandleCommand(string element)
        {
            var parameters = _parseCommand.ParsingInput(element);

            if (!string.IsNullOrEmpty(parameters.UserName) && string.IsNullOrEmpty(parameters.Command))
            {
                return(parameters);
            }

            return(null);
        }