示例#1
0
        public void DeleteToDoList_InValidId()
        {
            _repo.Setup(p => p.Delete <ToDoListEntity>(0)).Returns(0);
            var returnObj = _toDoListService.DeleteToDoList(0);

            Assert.IsTrue(returnObj == 0);
        }
示例#2
0
        private static void DeleteToDoList()
        {
            Console.WriteLine("Enter Id of ToDoList for Delete");
            string input = Console.ReadLine();
            int    listId;

            if (int.TryParse(input, out listId) && _toDoListService.ToDoListWithIdExists(listId))
            {
                _toDoListService.DeleteToDoList(listId, _userService.CurrentUser.Id);
                Console.WriteLine("Deleted");
            }
            else
            {
                Console.WriteLine("Invalid id");
            }
            Console.WriteLine();
        }
示例#3
0
        public void DeleteToDoList()
        {
            _writer.WriteLine("Enter Id of ToDoList for Delete");
            string input = _reader.ReadLine();
            int    listId;

            if (int.TryParse(input, out listId) && _toDoListService.ToDoListWithIdExists(listId)
                /*&& _toDoListService.CanEditList(listId,_userService.CurrentUser.Id)*/)
            {
                _toDoListService.DeleteToDoList(listId, _userService.CurrentUser.Id);
                _writer.WriteLine("Deleted");
            }
            else
            {
                _writer.WriteLine("Invalid id");
            }
            _writer.WriteLine("");
        }
 public IActionResult DeleteToDoList(ToDoEntity toDoEntity)
 {
     toDoListService.DeleteToDoList(toDoEntity.Id);
     return(Ok(true));
 }