Example #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);
        }
Example #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));
        }
Example #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);
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
 }
Example #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));
        }