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();
            });
        }
 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();
        }
Пример #4
0
        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 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 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();
        }
Пример #16
0
        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 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 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 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 ();
        }
Пример #20
0
        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 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 ();
        }
Пример #23
0
        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 ();
            });
        }
Пример #24
0
        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 ();
            });
        }
Пример #25
0
        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 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 ();
        }