示例#1
0
        public void GetXElement_SetName_ReturnCorrectXml()
        {
            Schedule sc = new Schedule();
            sc.Name = "Schedule1";

            var element = sc.GetXElement();

            Assert.IsNotNull(element.Attribute(Schedule.CN_NAME));
            Assert.IsTrue(element.Attribute(Schedule.CN_NAME).Value == sc.Name);
        }
示例#2
0
        public void GetXElement_SetIsActiveTrue_ReturnCorrectXml()
        {
            Schedule sc = new Schedule();
            sc.Name = "Schedule1";
            sc.IsActive = true;

            var element = sc.GetXElement();

            Assert.IsNotNull(element.Attribute(Schedule.CN_IS_ACTIVE));
            Assert.IsTrue(bool.Parse(element.Attribute(Schedule.CN_IS_ACTIVE).Value));
        }
示例#3
0
        public void GetXElement_SetDescription_ReturnCorrectXml()
        {
            Schedule sc = new Schedule();
            sc.Name = "Schedule1";
            sc.Description = "Description";

            var element = sc.GetXElement();

            Assert.IsNotNull(element.Attribute(Schedule.CN_DESCRIPTION));
            Assert.IsTrue(element.Attribute(Schedule.CN_DESCRIPTION).Value == sc.Description);
        }
示例#4
0
        public void GetXElement_SetStartOnNull_ReturnCorrectXml()
        {
            Schedule sc = new Schedule();
            sc.Name = "Schedule1";
            sc.StartOn = null;

            var element = sc.GetXElement();

            Assert.IsNull(element.Attribute(Schedule.CN_START_ON));
        }
示例#5
0
        public void GetXElement_SetDailyFrecuencyOneTimePerDay_ReturnsCorrectXml()
        {
            Schedule schedule = new Schedule();
            schedule.Name = "name";
            schedule.DailyFrecuency = new DailyFrecuencyOneTimePerDay();

            var element = schedule.GetXElement();
            Assert.IsNotNull(element.Elements(DailyFrecuencyOneTimePerDay.CN_ONE_TIME_PER_DAY));
        }
示例#6
0
        public void GetXElement_SetPatternWeekly_ReturnsCorrectXml()
        {
            Schedule schedule = new Schedule();
            schedule.Name = "name";
            schedule.Pattern = new WeeklyPattern();

            var element = schedule.GetXElement();
            Assert.IsNotNull(element.Elements(WeeklyPattern.cn_WeeklyPattern));
        }
示例#7
0
 public void GetXElement_SetPatternDaily_ReturnsCorrectXml()
 {
     Schedule schedule = new Schedule();
     schedule.Name = "name";
     schedule.Pattern = new DailyPattern();
     var element = schedule.GetXElement();
     Assert.IsNotNull(element.Element(DailyPattern.CN_DAILY_PATTERN));
 }
示例#8
0
        public void GetXElement_SetEndOnValue_ReturnCorrectXml()
        {
            Schedule sc = new Schedule();
            sc.Name = "Schedule1";
            sc.EndOn = DateTime.Now;

            var element = sc.GetXElement();

            Assert.IsNotNull(element.Attribute(Schedule.CN_END_ON));
            Assert.IsTrue(sc.EndOn == DateTime.Parse(element.Attribute(Schedule.CN_END_ON).Value));
        }