public void TestDeletedEntry() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); await DataStore.PutAsync(new TimeEntryData() { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime(16, 0), StopTime = MakeTime(16, 36), WorkspaceId = workspace.Id, UserId = user.Id, DeletedAt = MakeTime(16, 39), }); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
private Source(RecentViewController controller, RecentTimeEntriesView dataView) : base(controller.TableView, dataView) { this.controller = controller; this.dataView = dataView; controller.TableView.RegisterClassForCellReuse(typeof(TimeEntryCell), EntryCellId); controller.TableView.RegisterClassForHeaderFooterViewReuse(typeof(SectionHeaderView), SectionHeaderId); }
public void TestInitialGrouping () { var view = new RecentTimeEntriesView (); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestInitialGrouping() { var view = new RecentTimeEntriesView(); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestChangeGroupBottom () { var view = new RecentTimeEntriesView (); var model = Model.ByRemoteId<TimeEntryModel> (1); model.Description += " and some"; Assert.AreEqual (5, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestInitialGrouping() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
public void TestInitialGrouping () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }
public void TestDeleteGroupTop() { var view = new RecentTimeEntriesView(); var model = Model.ByRemoteId <TimeEntryModel> (1); model.Delete(); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestUnPersistGroupBottom() { var view = new RecentTimeEntriesView(); var model = Model.ByRemoteId <TimeEntryModel> (3); model.IsPersisted = false; Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestChangeGroupTop() { var view = new RecentTimeEntriesView(); var model = Model.ByRemoteId <TimeEntryModel> (3); model.Description += " and some"; Assert.AreEqual(5, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestChangeGroupBottom () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); await ChangeData<TimeEntryData> (1, m => m.Description += " and some"); Assert.AreEqual (5, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }
public void TestChangeGroupTopToBottom() { var view = new RecentTimeEntriesView(); var model = Model.ByRemoteId <TimeEntryModel> (3); model.StopTime -= TimeSpan.FromDays(1); model.StartTime -= TimeSpan.FromDays(1); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestChangeGroupTop() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); await ChangeData <TimeEntryData> (3, m => m.Description += " and some"); Assert.AreEqual(5, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
public void TestDeleteGroupBottom() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); var model = await GetByRemoteId <TimeEntryData> (3); await DataStore.DeleteAsync(model); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
public void TestMarkDeletedGroupBottom() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); await ChangeData <TimeEntryData> (3, m => { m.DeletedAt = Time.UtcNow; }); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
public void TestChangeGroupTopToBottom() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); await ChangeData <TimeEntryData> (3, m => { m.StopTime -= TimeSpan.FromDays(1); m.StartTime -= TimeSpan.FromDays(1); }); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 2, 1 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }); }
public void TestDataUpdate() { RunAsync(async delegate { var view = new RecentTimeEntriesView(); await WaitForLoaded(view); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); // Update data var workspaceId = Guid.NewGuid(); var data = await GetByRemoteId <TimeEntryData> (5); data.WorkspaceId = workspaceId; await DataStore.PutAsync(data); Assert.AreEqual(workspaceId, view.Data.ElementAt(0).WorkspaceId, "View failed to update internal data with latest information."); }); }
public void TestTemporaryShared() { var view = new RecentTimeEntriesView(); Model.Update(new TimeEntryModel() { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime(16, 0), StopTime = MakeTime(16, 36), Workspace = workspace, User = user, }); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestPastEntryHidden() { Model.Update(new TimeEntryModel() { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime(16, 0).AddDays(-10), StopTime = MakeTime(16, 36).AddDays(-10), Workspace = workspace, User = user, IsPersisted = true, }); var view = new RecentTimeEntriesView(); Assert.AreEqual(4, view.Count); Assert.AreEqual( new long[] { 5, 4, 3, 2 }, view.Data.Select((entry) => entry.RemoteId.Value).ToArray() ); view.Dispose(); }
public void TestDeleteGroupBottom () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); var model = await GetByRemoteId<TimeEntryData> (3); await DataStore.DeleteAsync (model); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }
public void TestChangeGroupTopToBottom () { var view = new RecentTimeEntriesView (); var model = Model.ByRemoteId<TimeEntryModel> (3); model.StopTime -= TimeSpan.FromDays (1); model.StartTime -= TimeSpan.FromDays (1); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestDeleteGroupTop () { var view = new RecentTimeEntriesView (); var model = Model.ByRemoteId<TimeEntryModel> (1); model.Delete (); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestTemporaryShared () { var view = new RecentTimeEntriesView (); Model.Update (new TimeEntryModel () { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime (16, 0), StopTime = MakeTime (16, 36), Workspace = workspace, User = user, }); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestUnPersistGroupBottom () { var view = new RecentTimeEntriesView (); var model = Model.ByRemoteId<TimeEntryModel> (3); model.IsPersisted = false; Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestPastEntryHidden () { Model.Update (new TimeEntryModel () { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime (16, 0).AddDays (-10), StopTime = MakeTime (16, 36).AddDays (-10), Workspace = workspace, User = user, IsPersisted = true, }); var view = new RecentTimeEntriesView (); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }
public void TestChangeGroupTopToBottom () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); await ChangeData<TimeEntryData> (3, m => { m.StopTime -= TimeSpan.FromDays (1); m.StartTime -= TimeSpan.FromDays (1); }); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }
public void TestDataUpdate () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); // Update data var workspaceId = Guid.NewGuid (); var data = await GetByRemoteId<TimeEntryData> (5); data.WorkspaceId = workspaceId; await DataStore.PutAsync (data); Assert.AreEqual (workspaceId, view.Data.ElementAt (0).WorkspaceId, "View failed to update internal data with latest information."); }); }
public void TestPastEntryHidden () { RunAsync (async delegate { await DataStore.PutAsync (new TimeEntryData () { RemoteId = 6, State = TimeEntryState.Finished, StartTime = MakeTime (16, 0).AddDays (-10), StopTime = MakeTime (16, 36).AddDays (-10), WorkspaceId = workspace.Id, UserId = user.Id, }); var view = new RecentTimeEntriesView (); await WaitForLoaded (view); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 3, 2 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }
public void TestMarkDeletedGroupBottom () { RunAsync (async delegate { var view = new RecentTimeEntriesView (); await WaitForLoaded (view); await ChangeData<TimeEntryData> (3, m => { m.DeletedAt = Time.UtcNow; }); Assert.AreEqual (4, view.Count); Assert.AreEqual ( new long[] { 5, 4, 2, 1 }, view.Data.Select ((entry) => entry.RemoteId.Value).ToArray () ); view.Dispose (); }); }