public void ReadXElement_SetOcurenceTypeValue_ReturnsCorrectOcurenceTypeValue()
        {
            var frec = new DailyFrecuencyNTimesPerDay();
            frec.OcurenceTypeValue = DailyFrecuencyNTimesPerDay.OcurenceType.Second;

            var element = frec.GetXElement();

            var newFrec = new DailyFrecuencyNTimesPerDay();
            newFrec.ReadXElement(element);

            Assert.IsTrue(frec.OcurenceTypeValue == newFrec.OcurenceTypeValue);
        }
        public void ReadXElement_SetOcureEveryN_ReturnsCorrectOcureEveryN()
        {
            var frec = new DailyFrecuencyNTimesPerDay();
            frec.OcureEveryN = 10;

            var element = frec.GetXElement();

            var newFrec = new DailyFrecuencyNTimesPerDay();
            newFrec.ReadXElement(element);

            Assert.IsTrue(frec.OcureEveryN == newFrec.OcureEveryN);
        }
        public void ReadXElement_SetStartTimeOfDay_ReturnsCorrectStartTimeOfDay()
        {
            var frec = new DailyFrecuencyNTimesPerDay();
            frec.StartTimeOfDay = new TimeSpan(12, 13, 14);

            var element = frec.GetXElement();

            var newFrec = new DailyFrecuencyNTimesPerDay();
            newFrec.ReadXElement(element);

            Assert.IsTrue(frec.StartTimeOfDay == newFrec.StartTimeOfDay);
        }
        public void GetXElement_SetEndTimeOfDay_ReturnsCorrectXml()
        {
            var frec = new DailyFrecuencyNTimesPerDay();
            frec.EndTimeOfDay = new TimeSpan(12, 13, 14);

            var element = frec.GetXElement();

            var attribute = element.Attribute(DailyFrecuencyNTimesPerDay.CN_END_TIME_OF_DAY);

            Assert.IsNotNull(attribute);
            Assert.IsTrue(frec.EndTimeOfDay == TimeSpan.FromTicks(long.Parse(attribute.Value)));
        }
        public void GetXElement_SetOcurenceTypeValue_ReturnsCorrectXml()
        {
            DailyFrecuencyNTimesPerDay frec = new DailyFrecuencyNTimesPerDay();
            frec.OcurenceTypeValue = DailyFrecuencyNTimesPerDay.OcurenceType.Minute;

            var element = frec.GetXElement();

            var attribute = element.Attribute(DailyFrecuencyNTimesPerDay.CN_OCURENCE_TYPE_VALUE);

            Assert.IsNotNull(attribute);
            Assert.IsTrue(frec.OcurenceTypeValue == ((DailyFrecuencyNTimesPerDay.OcurenceType)int.Parse(attribute.Value)));
        }
        public void GetXElement_SetOcureEveryN_ReturnsCorrectXml()
        {
            DailyFrecuencyNTimesPerDay frec = new DailyFrecuencyNTimesPerDay();
            frec.OcureEveryN = 5;

            var element = frec.GetXElement();

            var attribute = element.Attribute(DailyFrecuencyNTimesPerDay.CN_OCURE_EVERY_N);

            Assert.IsNotNull(attribute);
            Assert.IsTrue(frec.OcureEveryN == int.Parse(attribute.Value));
        }