示例#1
0
        public void FogbugzUpdatesTask()
        {
            var ts = new TaskSync();

            var c = new Case {LastUpdated = DateTime.Parse("2013-1-1 9:00am")};
            c.CaseId = 123;
            c.PercentComplete = 20;
            c.Subject = "case subject";
            c.Priority = 1;
            c.Due = DateTime.Parse("2013-2-1 8:00am");
            c.ResetUpdateFlags();

            var t = TaskListSyncTests.CreateOutlookTask();
            t.SetLastModificationDateForTesting(DateTime.Parse("2013-1-1 9:00am"));
            t.PercentComplete = 30;
            t.Subject = "task subject";
            t.Importance = OlImportance.olImportanceLow;
            t.DueDate = DateTime.Parse("2013-3-1");

            ts.SyncTask(c, t);

            Assert.AreEqual(20, t.PercentComplete);
            Assert.AreEqual("case subject (Case 123)", t.Subject);
            Assert.AreEqual(OlImportance.olImportanceHigh, t.Importance); //this doesn't change
            Assert.AreEqual(DateTime.Parse("2013-2-1"), t.DueDate);
            Assert.AreEqual(123, t.GetFogbugzCaseId());
        }
示例#2
0
        public void SetDueDate()
        {
            var c = new Case();
            var t = TaskListSyncTests.CreateOutlookTask();
            t.DueDate = DateTime.Parse("2013-01-01");
                t.SetLastModificationDateForTesting(DateTime.Now);

            var ts = new TaskSync();
            ts.SyncTask(c, t);

            Assert.AreEqual(DateTime.Parse("2013-01-01"), c.Due);
        }
示例#3
0
        public void TaskUpdatesFogbugz()
        {
            var ts = new TaskSync();

            var c = new Case {LastUpdated = DateTime.Parse("2013-1-1 9:00am")};
            c.PercentComplete = 20;
            c.Subject = "case subject";
            c.Priority = 1;
            c.Due = DateTime.Parse("2013-2-1 8:00am");
            c.ResetUpdateFlags();

            var t = TaskListSyncTests.CreateOutlookTask();
            t.SetLastModificationDateForTesting(DateTime.Parse("2013-1-1 10:00am"));
            t.PercentComplete = 30;
            t.Subject = "task subject";
            t.Importance = OlImportance.olImportanceLow;
            t.DueDate = DateTime.Parse("2013-3-1");

            ts.SyncTask(c, t);

            Assert.AreEqual(30, c.PercentComplete);
            Assert.AreEqual("task subject", c.Subject);
            Assert.AreEqual(1, c.Priority); //doesn't change
            Assert.AreEqual(DateTime.Parse("2013-3-1"), c.Due);
        }