public void TestDefaultFieldValues() { try { IBM.ICU.Util.HebrewCalendar cal = new IBM.ICU.Util.HebrewCalendar(); cal.Clear(); Logln("cal.clear() -> " + cal.GetTime()); } catch (MissingManifestResourceException ex) { Warnln("could not load the locale data"); } }
public void TestCoverage() { try { { // new HebrewCalendar(TimeZone) IBM.ICU.Util.HebrewCalendar cal = new IBM.ICU.Util.HebrewCalendar(IBM.ICU.Util.TimeZone.GetDefault()); if (cal == null) { Errln("could not create HebrewCalendar with TimeZone"); } } { // new HebrewCalendar(ULocale) IBM.ICU.Util.HebrewCalendar cal_0 = new IBM.ICU.Util.HebrewCalendar(IBM.ICU.Util.ULocale.GetDefault()); if (cal_0 == null) { Errln("could not create HebrewCalendar with ULocale"); } } { // new HebrewCalendar(Locale) IBM.ICU.Util.HebrewCalendar cal_1 = new IBM.ICU.Util.HebrewCalendar(ILOG.J2CsMapping.Util.Locale.GetDefault()); if (cal_1 == null) { Errln("could not create HebrewCalendar with locale"); } } { // new HebrewCalendar(Date) IBM.ICU.Util.HebrewCalendar cal_2 = new IBM.ICU.Util.HebrewCalendar(DateTime.Now); if (cal_2 == null) { Errln("could not create HebrewCalendar with date"); } } { // data IBM.ICU.Util.HebrewCalendar cal_3 = new IBM.ICU.Util.HebrewCalendar(2800, IBM.ICU.Util.HebrewCalendar.SHEVAT, 1); DateTime time = cal_3.GetTime(); String[] calendarLocales = { "iw_IL" }; String[] formatLocales = { "en", "fi", "fr", "hu", "iw", "nl" }; for (int i = 0; i < calendarLocales.Length; ++i) { String calLocName = calendarLocales[i]; ILOG.J2CsMapping.Util.Locale calLocale = IBM.ICU.Impl.LocaleUtility .GetLocaleFromName(calLocName); cal_3 = new IBM.ICU.Util.HebrewCalendar(calLocale); for (int j = 0; j < formatLocales.Length; ++j) { String locName = formatLocales[j]; ILOG.J2CsMapping.Util.Locale formatLocale = IBM.ICU.Impl.LocaleUtility .GetLocaleFromName(locName); DateFormat format = IBM.ICU.Text.DateFormat.GetDateTimeInstance(cal_3, IBM.ICU.Text.DateFormat.FULL, IBM.ICU.Text.DateFormat.FULL, formatLocale); Logln(calLocName + "/" + locName + " --> " + format.Format(time)); } } } } catch (MissingManifestResourceException ex) { Warnln("Could not load the locale data. " + ex.Message); } }