Exemplo n.º 1
0
 public static bool IsEqualTasks(ManagemAntsServer.Dbo.Task a, ManagemAntsServer.Dbo.Task b)
 {
     return(a.Id == b.Id &&
            a.Name == b.Name &&
            a.Description == b.Description &&
            a.CreatedAt == b.CreatedAt &&
            a.Duration == b.Duration &&
            a.State == b.State &&
            a.ProjectId == b.ProjectId &&
            a.TimeSpent == b.TimeSpent);
 }
Exemplo n.º 2
0
        public void Post()
        {
            var project = _refFixture.Projects[0];
            var newTask = new ManagemAntsServer.Dbo.Task()
            {
                Name        = "NewTaskName",
                Description = "",
                CreatedAt   = new DateTime(),
                Duration    = 2,
                State       = 0,
                ProjectId   = project.Id,
            };

            var result = _taskController.Post(newTask) as Microsoft.AspNetCore.Mvc.OkObjectResult;

            Assert.AreEqual(200, result.StatusCode);

            var task = (result.Value as Task <ManagemAntsServer.Dbo.Task>).Result;

            Assert.IsTrue(TaskUtils.IsEqualTasks(newTask, task));
        }