public void TestAddProject() { int count = projectAutocomplete.Count; string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; ulong workspace_id = 123456789; ulong client_id = 0; string client_guid = null; string project_name = "testing project adding"; bool is_private = false; string project_guid = TogglDesktop.Toggl.AddProject(guid, workspace_id, client_id, client_guid, project_name, is_private); Assert.IsNotNull(project_guid); Assert.AreNotEqual("", project_guid); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.AreEqual(project_name, te.ProjectLabel); Assert.IsNotNull(projectAutocomplete); Assert.AreEqual(count + 1, projectAutocomplete.Count); }
public void Initialize() { openTimeEntryList = false; timeentries = null; openTimeEntryEditor = false; focusedFieldName = null; editorTimeEntry = new TogglDesktop.Toggl.TogglTimeEntryView(); openSettings = false; settings = new TogglDesktop.Toggl.TogglSettingsView(); running = false; timerTimeEntry = new TogglDesktop.Toggl.TogglTimeEntryView(); openLogin = false; userID = 0; clients = null; projectAutocomplete = null; string path = Path.Combine(Directory.GetCurrentDirectory(), "me.json"); Assert.AreNotEqual("", path); Assert.IsNotNull(path); string json = File.ReadAllText(path); Assert.AreNotEqual("", json); Assert.IsNotNull(json); Assert.IsTrue(TogglDesktop.Toggl.SetLoggedInUser(json)); }
public void TestSetTimeEntryDescription() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryDescription(guid, "blah")); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.AreEqual("blah", te.Description); }
public void TestSetTimeEntryEnd() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryEnd(guid, "23:45")); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.AreEqual("23:45", te.EndTimeString); }
public void TestViewTimeEntryList() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; TogglDesktop.Toggl.ViewTimeEntryList(); Assert.IsNotNull(timeentries); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.AreEqual(guid, te.GUID); }
public void TestSetTimeEntryProject() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; uint task_id = 0; uint project_id = 2567324; string project_guid = null; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryProject(guid, task_id, project_id, project_guid)); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.AreEqual(project_id, te.PID); }
public void TestSetTimeEntryBillable() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryBillable(guid, true)); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.IsTrue(te.Billable); Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryBillable(guid, false)); te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.IsFalse(te.Billable); }
public void TestSetTimeEntryTags() { string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; List <string> tags = new List <string>() { "John", "Anna", "Monica" }; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryTags(guid, tags)); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); string[] assignedTags = te.Tags.Split('\t'); Assert.AreEqual(tags.Count, assignedTags.Length); }
public void TestSetTimeEntryDate() { DateTime now = DateTime.Now; string guid = "07fba193-91c4-0ec8-2894-820df0548a8f"; Assert.IsTrue(TogglDesktop.Toggl.SetTimeEntryDate(guid, now)); TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); DateTime started = TogglDesktop.Toggl.DateTimeFromUnix(te.Started); Assert.AreEqual(now.Year, started.Year); Assert.AreEqual(now.Month, started.Month); Assert.AreEqual(now.Day, started.Day); }
public void TestDeleteTimeEntry() { TogglDesktop.Toggl.ViewTimeEntryList(); string guid = "6c97dc31-582e-7662-1d6f-5e9d623b1685"; TogglDesktop.Toggl.TogglTimeEntryView te = timeentries.Find(x => guid == x.GUID); Assert.IsNotNull(te); Assert.IsTrue(TogglDesktop.Toggl.DeleteTimeEntry(guid)); Assert.IsNotNull(timeentries); te = timeentries.Find(x => guid == x.GUID); Assert.IsNull(te); }
static void Toggl_OnStoppedTimerState() { running = false; timerTimeEntry = new TogglDesktop.Toggl.TogglTimeEntryView(); }
static void Toggl_OnTimeEntryEditor(bool open, TogglDesktop.Toggl.TogglTimeEntryView te, string focused_field_name) { openTimeEntryEditor = open; editorTimeEntry = te; focusedFieldName = focused_field_name; }
static void Toggl_OnRunningTimerState(TogglDesktop.Toggl.TogglTimeEntryView te) { running = true; timerTimeEntry = te; }