示例#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 DueUpdated()
 {
     var c = new Case();
     c.Due = DateTime.Parse("2013-1-1 10:00am");
     c.ResetUpdateFlags();
     c.Due = DateTime.Parse("2013-1-1 11:00am");
     Assert.IsTrue(c.DueUpdated);
 }
示例#3
0
 public void DueNotUpdatedWithSameValue()
 {
     var c = new Case();
     c.Due = DateTime.Parse("2013-1-1 10:00am");
     c.ResetUpdateFlags();
     c.Due = DateTime.Parse("2013-1-1 10:00am");
     Assert.IsFalse(c.DueUpdated);
 }
示例#4
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);
        }
示例#5
0
        public static IEnumerable<Case> ParseCasesXml(string xml)
        {
            using (var sr = new StringReader(xml))
            {
                var x = XmlDynamo.Load(sr);

                var cases = x.cases.Elements("case");
                var caseList = new List<Case>();

                foreach (var currCase in cases)
                {
                    var c = new Case();
                    c.CaseId = int.Parse(currCase.ixBug);
                    c._subject = currCase.sTitle;
                    c.LastUpdated = DateTime.Parse(currCase.dtLastUpdated);
                    if (currCase.dtDue != "")
                        c._due = DateTime.Parse(currCase.dtDue);
                    c.Priority = int.Parse(currCase.ixPriority);
                    c.Opened = DateTime.Parse(currCase.dtOpened);

                    if ((string) currCase.tags != null)
                    {
                        var tags = currCase.tags.Elements("tag");
                        c._tags.Clear();
                        foreach (string tag in tags)
                        {
                            c._tags.Add(tag);
                        }
                    }

                    c.ResetUpdateFlags();

                    caseList.Add(c);
                }

                return caseList;
            }
        }
示例#6
0
 public void TagsUpdatedFalseWhenUnchanged()
 {
     var c = new Case();
     c.AddTag("boom");
     c.ResetUpdateFlags();
     c.AddTag("boom");
     Assert.IsFalse(c.TagsUpdated);
 }
示例#7
0
 public void SubjectUpdated()
 {
     var c = new Case();
     c.Subject = "test";
     c.ResetUpdateFlags();
     c.Subject = "test2";
     Assert.IsTrue(c.SubjectUpdated);
 }
示例#8
0
 public void ResolvedGetSetNotUpdated()
 {
     var c = new Case();
         c.Resolved = true;
         c.ResetUpdateFlags();
         Assert.AreEqual(false, c.ResolvedUpdated);
 }