public void Ctor_PassCommandsWithTheSameName_ThrowsApplicationException(string firstName, string secondName)
        {
            // Arrange
            var firstCommand  = VocabularyCommandStubFactory.Name(firstName);
            var secondCommand = VocabularyCommandStubFactory.Name(firstName);

            // Assert
            var ex = Assert.Throws <ApplicationException>(
                () => new VocabularyRequestHandler(new[] { firstCommand, secondCommand }));

            Assert.AreEqual(ex.Message, Default.CommandNameDuplicated);
        }
        public void Handle_PassNotContaiedCommandName_ReturnsNoSuchCommand()
        {
            // Arrange
            var handler = new VocabularyRequestHandler(
                new []
            {
                VocabularyCommandStubFactory.Name("get")
            });

            // Act
            var result = handler.Handle("add");

            // Assert
            Assert.AreEqual(result, Default.NoSuchCommand);
        }
        public void Handle_PassCommandAndCommandReturnsResult_ReturnsCommandResult(string commandName, string request)
        {
            // Arrange
            var commandResults = "bbb ccc";
            var handler        = new VocabularyRequestHandler(
                new[]
            {
                VocabularyCommandStubFactory.NameAndExecute(commandName, new [] { "aaa" }, commandResults)
            });

            // Act
            var result = handler.Handle(request);

            // Assert
            Assert.AreEqual(result, commandResults);
        }