public void ReadXElement_Empty_ThrowsSyncDocumentException() { var frec = new DailyFrecuencyOneTimePerDay(); XElement element = XElement.Parse("<NotDailyFrecuencyOneTimePerDay />"); frec.ReadXElement(element); }
public void ReadXElement_SetTimeOfDay_ReturnsCorrectTimeOfDay() { var frec = new DailyFrecuencyOneTimePerDay(); frec.TimeOfDay = new TimeSpan(12, 13, 14); var element = frec.GetXElement(); var newFrec = new DailyFrecuencyOneTimePerDay(); newFrec.ReadXElement(element); Assert.IsTrue(frec.TimeOfDay == newFrec.TimeOfDay); }
public void GetXElement_SetTimeOfDay_ReturnsCorrectXml() { var frec = new DailyFrecuencyOneTimePerDay(); frec.TimeOfDay = new TimeSpan(12, 13, 14); var element = frec.GetXElement(); var attribute = element.Attribute(DailyFrecuencyOneTimePerDay.CN_TIME_OF_DAY); Assert.IsNotNull(attribute); Assert.IsTrue(frec.TimeOfDay == TimeSpan.FromTicks(long.Parse(attribute.Value))); }
public void ReadXElement_Empty_ThrowsArgumentNullException() { var frec = new DailyFrecuencyOneTimePerDay(); XElement element = null; frec.ReadXElement(element); }