public void MoveItemsToProject_Success() { var client = TodoistClientFactory.Create(); var item = new Item("demo task"); client.Items.AddAsync(item).Wait(); item.DueDate = new DueDate("every fri"); client.Items.UpdateAsync(item).Wait(); var project = new Project(Guid.NewGuid().ToString()); client.Projects.AddAsync(project); var itemInfo = client.Items.GetAsync(item.Id).Result; Assert.True(project.Id != itemInfo.Project.Id); client.Items.MoveAsync(ItemMoveArgument.CreateMoveToProject(itemInfo.Item.Id, project.Id)).Wait(); itemInfo = client.Items.GetAsync(item.Id).Result; Assert.True(project.Id == itemInfo.Project.Id); client.Projects.DeleteAsync(project.Id).Wait(); client.Items.DeleteAsync(item.Id).Wait(); }
public void UpdateOrders_Success() { var client = TodoistClientFactory.Create(); var item = client.Items.QuickAddAsync(new QuickAddItem("Demo task every fri")).Result; var firstProject = client.Projects.GetAsync().Result.First(); client.Items.MoveAsync(ItemMoveArgument.CreateMoveToProject(item.Id, firstProject.Id)).Wait(); client.Items.UpdateDayOrdersAsync(new OrderEntry(item.Id, 2)); client.Items.DeleteAsync(item.Id).Wait(); }