public static void ViewTaskList() { List <Tasks> taskLists = service.GetAll(); foreach (Tasks task in taskLists) { DisplayTasks(task); } MainMenu(); }
public void TasksService_GetAll() { _repository.Setup(x => x.GetAll()).Returns(new List <Task> { _taskOne, _taskTwo }); var expected = _tasksService.GetAll(); _repository.Verify(x => x.GetAll()); }
public ActionResult <IEnumerable <Task> > Get() { try { return(Ok(_LS.GetAll())); } catch (System.Exception error) { return(BadRequest(error.Message)); } }
// GET: Tasks public ActionResult Index() { List <TasksViewModel> List = new List <TasksViewModel>(); foreach (var item in Ts.GetAll()) { TasksViewModel Tvm = new TasksViewModel(); //Tvm.deadline = item.deadline; Tvm.nomtask = item.nomtask; Tvm.duration = item.duration; Tvm.taskId = item.tasksId; Tvm.projectId = item.projectId; Tvm.projectname = item.proj.projectname; Tvm.diffname = item.Difficultes.Nomdiff; //Tvm.membname = item.team_member.firstName+" "+ item.team_member.lastName; List.Add(Tvm); } return(View(List)); // return View(); }
public void GetAllShouldReturnCorrectNumberOfPagesForTasks() { var options = new DbContextOptionsBuilder <TasksDbContext>() .UseInMemoryDatabase(databaseName: nameof(GetAllShouldReturnCorrectNumberOfPagesForTasks)) .Options; using (var context = new TasksDbContext(options)) { var taskService = new TasksService(context); var added = taskService.Create(new LabIV.DTO.TaskPostDTO { Title = "Booking Commision", Description = "Verify booking commision", DateAdded = DateTime.Parse("2019-06-15T00:00:00"), Deadline = DateTime.Parse("2019-06-17T00:00:00"), TaskImportance = "High", TaskState = "Closed", DateClosed = null, Comments = new List <Comment>() { new Comment { Important = true, Text = "A nice task...", } }, }, null); DateTime from = DateTime.Parse("2019-06-13T00:00:00"); DateTime to = DateTime.Parse("2019-06-19T00:00:00"); var allTasks = taskService.GetAll(1, from, to); Assert.AreEqual(1, allTasks.Entries.Count); Assert.IsNotNull(allTasks); } }
// GET: Task public ActionResult Index(DateTime?id) { if (id.HasValue) { var tasksByDate = tasksService.GetAllBy(id.Value); return(View(tasksByDate)); } else if (Request.Form["date"] != null) { try { var tasksByDate = tasksService.GetAllBy(Convert.ToDateTime(Request.Form["date"])); return(View(tasksByDate)); } catch { return(RedirectToAction("Index")); } } else if (Request.Form["Content"] != null) { try { var tasksByText = tasksService.GetAllByText(Convert.ToString(Request.Form["Content"])); return(View(tasksByText)); } catch { return(RedirectToAction("Index")); } } var tasks = tasksService.GetAll(); return(View(tasks)); }
// GET api/Default1 public IEnumerable <Task> GetTodoes() { return(tasksService.GetAll()); }
public List <Task> GetAll() { return(_service.GetAll()); }
public ActionResult GetAll() { return(Content(JsonConvert.SerializeObject(service.GetAll()), "application/json")); }
// GET: api/TasksWS public IEnumerable <Tasks> Gettach() { return(servicetasks.GetAll()); }
public ActionResult GetAll() { return(Json(tasksService.GetAll(), JsonRequestBehavior.AllowGet)); }