public void Test_OrOperatorFailFirst()
        {
            var outputs = Connect("prompt : which abfia || echo \"Previous command was wrong!!\" ");

            Assert.AreEqual(2, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual("There is not any compatible action for this command.", outputs[0].Message);
            Assert.AreEqual(ReflectorHelper.GetActionName((EchoCommand cmd) => cmd.Echoed(null)), outputs[1].Name);
        }
        public void Test_FindDefaultActionByParams()
        {
            // Act
            var action = _command.FindAction(null, new string[0]);

            // Assert
            Assert.NotNull(action);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand cmd) => cmd.Get()), action.Name);
        }
        public void Test_FindActionByNameAndParams()
        {
            // Act
            var action = _command.FindAction("set", new object[] { typeof(string).Name });

            // Assert
            Assert.NotNull(action);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand cmd) => cmd.Set(null)), action.Name);
        }
        public void Test_FindActionByName()
        {
            // Act
            var action = _command.FindAction("get");

            // Assert
            Assert.NotNull(action);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand cmd) => cmd.Get()), action.Name);
        }
        public void Test_EchoedActionEchoCommand()
        {
            // Act
            var outputs = Connect("echo:echoed Hello my Dear");

            // Assert
            Assert.AreEqual(1, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual(ReflectorHelper.GetActionName((EchoCommand cmd) => cmd.Echoed()), outputs[0].Name);
        }
        public void Test_SetActionPrompt()
        {
            // Act
            var outputs = Connect(@"prompt : set ""^"" ");

            // Assert
            Assert.AreEqual(1, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand cmd) => cmd.Set(null)), outputs[0].Name);
        }
        public void Test_DoublePipe()
        {
            // Act
            var outputs = Connect("echo true | echo : echoed | prompt : set");

            // Asert
            Assert.AreEqual(1, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand c) => c.Set(null)), outputs[0].Name);
        }
        public void Test_PipeOperator()
        {
            // Act
            var outputs = Connect("prompt : set amour | echo : echoed");

            // Assert
            Assert.AreEqual(1, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual(ReflectorHelper.GetActionName((EchoCommand c) => c.Echoed(null)), outputs[0].Name);
        }
        public void Test_AndOperator()
        {
            // Act
            var outputs = Connect("echo Testing and operator && prompt");

            // Assert
            Assert.AreEqual(2, outputs.Length);
            Assert.AreEqual(0, _extractor.LastOperationStatus);
            Assert.AreEqual(ReflectorHelper.GetActionName((EchoCommand cmd) => cmd.Echoed()), outputs[0].Name);
            Assert.AreEqual(ReflectorHelper.GetActionName((PromptCommand cmd) => cmd.Get()), outputs[1].Name);
        }