public async Task UpdateTodoList()
        {
            string   newTitle = "Nice to have";
            TodoList update   = new TodoList()
            {
                TodoListId = 1, Title = newTitle, UserId = username
            };

            HttpResult <TodoList> result = await client.UpdateTodoListAsync(update, returnContent : true);

            Assert.IsNotNull(result, "Result is null");
            Assert.IsTrue(result.Succeeded, GetRequestFailedMessage(result));
            Assert.AreEqual(result.Content.Title, newTitle);
        }
        private async void TodoListTitleTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            TextBox       todoListTitleTextBox = (TextBox)sender;
            TodoListModel todoList             = GetDataContext <TodoListModel>(sender);

            string newTitle = todoListTitleTextBox.Text;

            if (newTitle != todoList.OriginalTitle)
            {
                HttpResult result;
                using (TodoClient todoClient = ClientFactory.CreateTodoClient())
                {
                    if (String.IsNullOrWhiteSpace(newTitle))
                    {
                        result = await todoClient.DeleteTodoListAsync(todoList.TodoListId);

                        if (result.Succeeded)
                        {
                            TodoPageModel.TodoLists.Remove(todoList);
                        }
                    }
                    else
                    {
                        TodoList update = new TodoList()
                        {
                            TodoListId = todoList.TodoListId, Title = newTitle
                        };
                        result = await todoClient.UpdateTodoListAsync(update);

                        if (!result.Succeeded)
                        {
                            todoList.Title = todoList.OriginalTitle;
                        }
                    }
                }

                if (!result.Succeeded)
                {
                    await ErrorDialog.ShowErrorsAsync(result.Errors);
                }
            }
        }
        private async void OkButton_Click(object sender, EventArgs e)
        {
            TodoList todoList = new TodoList()
            {
                TodoListId = todoListId, Title = TitleTextBox.Text
            };

            HttpResult result;

            using (TodoClient todoClient = ClientFactory.CreateTodoClient())
            {
                result = await todoClient.UpdateTodoListAsync(todoList);
            }

            if (result.Succeeded)
            {
                this.NavigationService.GoBack();
            }
            else
            {
                ErrorDialog.ShowErrors(result.Errors);
            }
        }