Beispiel #1
0
        public void GetAll_NoExceptions()
        {
            IList <ToDoList> toDoLists = null;

            Assert.DoesNotThrow(() => toDoLists = _toDoListDao.GetAll());
            Assert.NotNull(toDoLists);
        }
        public IList <ToDoList> PopulateToDoListCache()
        {
            _toDoListCache = _toDoListDao.GetAll();

            // If there is no 'To Do List' avaliable, create first one
            if (_toDoListCache?.Any() != true)
            {
                var firstToDoList = _toDoListDao.Insert(ToDoList.New(DateTime.Now.Date));
                _toDoListCache.Add(firstToDoList);
                _currentListCache = firstToDoList;
                return(_toDoListCache);
            }

            _currentListCache = _toDoListCache
                                .FirstOrDefault(tdl => tdl.Date.ToShortDateString() == DateTime.Now.ToShortDateString());
            return(_toDoListCache);
        }