private void SetTitleCommandExecutor(string commandParams) { var argumentsParser = new ArgumentsParser(commandParams); if (argumentsParser.NextArgumentsCount < 1) { throw new MenuException(); } ICommand command = new SetTitleCommand(argumentsParser.GetNextsAsString(' '), _document); command.Execute(); }
public void Execute_DeleteItemInvoked() { // Arrange _document.Title = "1"; var newTitle = "2"; ICommand command = new SetTitleCommand(newTitle, _document); // Act command.Execute(); // Assert Assert.Equal(newTitle, _document.Title); }
public void Unexecute_InsertItemInvoked() { // Arrange string oldTitle = "1"; _document.Title = oldTitle; var newTitle = "2"; ICommand command = new SetTitleCommand(newTitle, _document); command.Execute(); // Act command.Unexecute(); // Assert Assert.Equal(oldTitle, _document.Title); }
public IActionResult SetTitle([FromBody] SetTitleCommand command) { this.boardService.SetTitle(command); return(Ok(new { changed = true })); }