public void TranslateFormatFromDotNetWhereFormatForEraExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "g, gg"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "g', 'gg"); }
public void TranslateFormatFromDotNetWhereFormatForFullLongTimeExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "dddd', 'dd MMMM yyyy HH:mm:ss"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "DW', 'dd' 'MM' 'yyyy' '24h':'min':'ss"); }
public void TranslateFormatFromDotNetWhereFormatForTimeZonesExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "'Hours offset from UTC: 'z', Hours offset from UTC, with a leading zero: 'zz', Offset with minutes: 'zzz"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "'Hours offset from UTC: 'z', Hours offset from UTC, with a leading zero: 'zz', Offset with minutes: 'zzz"); }
public void TranslateFormatFromDotNetWhereFormatForRoundTripExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "yyyy'-'mm'-'dd'T'24h':'min':'ss'.'fffffffK"); }
public void TranslateFormatFromDotNetWhereFormatForLongTimeExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "HH:mm:ss.fffffff"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "24h':'min':'ss'.'fffffff"); }
public void TranslateFormatFromDotNetWhereFormatForNonZeroSplitSecondsExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "F- FF- FFF- FFFF- FFFFFF- FFFFFFF-"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "F'- 'FF'- 'FFF'- 'FFFF'- 'FFFFFF'- 'FFFFFFF'-'"); }
public void TranslateFormatFromDotNetWhereFormatForShortDateExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "MM/dd/yyyy"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "mm'/'dd'/'yyyy"); }
public void TranslateFormatFromDotNetWhereFormatOfDayoftheMonthExpectedInDev2Format() { //initialize IDateTimeParser translatingParser = new DateTimeParser(); string inputFormat = "d, dd, ddd, dddd"; string error; //execute inputFormat = translatingParser.TranslateDotNetToDev2Format(inputFormat, out error); Assert.IsTrue(string.IsNullOrEmpty(error)); Assert.AreEqual(inputFormat, "d', 'dd', 'dW', 'DW"); }
public string GetDateTimeFormatInformation() { var dateTimeParser = new DateTimeParser(); string error; var translatedDateTimeFormat = dateTimeParser.TranslateDotNetToDev2Format(CultureInfo.CurrentUICulture.DateTimeFormat.FullDateTimePattern, out error); return translatedDateTimeFormat; }