/// <summary>
        /// Delete the entire entry
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void DeleteTimeEntryButton_Tapped(object sender, TappedRoutedEventArgs e)
        {
            App.Data.TimeEntries.Remove(this.Entry);
            await TimeEntry.DeleteEntry(this.Entry.Id);

            Frame.Navigate(typeof(MainPage));
            // TODO: Maybe display a popup dialog to confirm?
        }
Ejemplo n.º 2
0
        public void DeleteTimeEntryTest()
        {
            // Create a new test entry
            var task = TimeEntry.StartTimeEntry("To be deleted");

            task.Wait();
            var entry = task.Result;

            // Delete the task
            TimeEntry.DeleteEntry(entry.Id).Wait();
        }
Ejemplo n.º 3
0
        public void StartTimeEntryTest()
        {
            var task = TimeEntry.StartTimeEntry("New time entry");

            task.Wait();
            TimeEntry entry = task.Result;

            Assert.AreNotEqual(0, entry.Id);
            Assert.AreEqual("New time entry", entry.Description);
            Assert.IsTrue(0 > entry.Duration);

            // Clean up
            TimeEntry.DeleteEntry(entry.Id).Wait();
        }
Ejemplo n.º 4
0
        public void CreateTimeEntryWithWorkspaceTest()
        {
            Task <TimeEntry> task = TimeEntry.CreateTimeEntry("New time entry",
                                                              new DateTime(2016, 9, 20, 10, 35, 17), 100, workspaceId: WorkspaceTests.workspaceId);

            task.Wait();
            TimeEntry entry = task.Result;

            Assert.IsNotNull(entry);
            Assert.AreEqual("New time entry", entry.Description);

            // Clean up
            TimeEntry.DeleteEntry(entry.Id).Wait();
        }
Ejemplo n.º 5
0
        public void CreateTimeEntryWithProjectTest()
        {
            Task <TimeEntry> task = TimeEntry.CreateTimeEntry("New time entry",
                                                              new DateTime(2016, 9, 20, 10, 35, 17), 100, projectId: 33544573);

            task.Wait();
            TimeEntry entry = task.Result;

            Assert.IsNotNull(entry);
            Assert.AreEqual("New time entry", entry.Description);
            Assert.AreEqual(33544573, entry.ProjectId);

            // Clean up
            TimeEntry.DeleteEntry(entry.Id).Wait();
        }
Ejemplo n.º 6
0
 public void AfterEach()
 {
     TimeEntry.DeleteEntry(entry.Id);
 }