public void MissingXmlSettingsTest() { // Setup var expected = new DateTimeSettings(); var parent = new XElement("Parent"); // Act DateTimeSettings actual = DateTimeSettingsExtensions.FromXml(parent); // Check EqualsSuccessTest(expected, actual); }
public void XmlDefaultSettingsTest() { // Setup var expected = new DateTimeSettings(); var parent = new XElement( "Parent", new XElement(DateTimeSettingsExtensions.XmlElementName) ); // Act DateTimeSettings actual = DateTimeSettingsExtensions.FromXml(parent); // Check EqualsSuccessTest(expected, actual); }
public void XmlRoundTripTest() { // Setup var uut = new DateTimeSettings { DateFormat = DateFormat.YearMonthDay, DateSeparatorFormat = DateSeparatorFormat.Dashes, DurationFormat = DurationFormat.HourMinuteSecond, DurationSeparator = DurationSeparator.LettersOnly, MonthFormat = MonthFormat.FullMonth, TimeFormat = TimeFormat.Hour24, TimeZoneIdentifier = "UTC" }; // Act var parent = new XElement("Parent"); uut.ToXml(parent); DateTimeSettings actual = DateTimeSettingsExtensions.FromXml(parent); // Check EqualsSuccessTest(uut, actual); }