Ejemplo n.º 1
0
        public void TemplateMilestoneTest()
        {
            var t = new TemplateMilestone(1, "M1");

            t.DurationInDays = 4;
            t.IsKey          = true;
            t.IsNotify       = true;
            Assert.IsTrue(t.IsKey);
            Assert.IsTrue(t.IsNotify);
            t.IsKey    = false;
            t.IsNotify = false;
            Assert.IsFalse(t.IsKey);
            Assert.IsFalse(t.IsNotify);
            t.IsKey    = true;
            t.IsNotify = true;

            var t2 = engine.SaveTemplateMilestone(t);

            t2 = engine.GetTemplateMilestone(t2.Id);

            Assert.AreEqual(t.Title, t2.Title);
            Assert.AreEqual(t.DurationInDays, t2.DurationInDays);
            Assert.AreEqual(t.IsKey, t2.IsKey);
            Assert.AreEqual(t.IsNotify, t2.IsNotify);
            Assert.AreEqual(t.ProjectId, t2.ProjectId);
            Assert.AreNotEqual(t.CreateBy, default(Guid));
            Assert.AreNotEqual(t.CreateOn, default(DateTime));

            foreach (var d in engine.GetTemplateMilestones(1))
            {
                engine.RemoveTemplateMilestone(d.Id);
            }
        }