public void CheckShortDatePatternForCurrentCulture() { CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; ICultureUtil cultureUtil = container.Resolve <ICultureUtil>(); string expected = currentCulture.DateTimeFormat.ShortDatePattern; string result = cultureUtil.ShortDatePattern; Assert.AreEqual(expected, result); }
public void CheckDateSeparatorForCurrentCulture() { CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; ICultureUtil cultureUtil = container.Resolve <ICultureUtil>(); string expected = currentCulture.DateTimeFormat.DateSeparator; string result = cultureUtil.DateSeparator; Assert.AreEqual(expected, result); }
public void CheckShortDatePatternForJPCulture() { CultureInfo currentCultureInfo = Thread.CurrentThread.CurrentCulture; CultureInfo newCultureInfo = new CultureInfo("ja-JP"); Thread.CurrentThread.CurrentCulture = newCultureInfo; ICultureUtil cultureUtil = container.Resolve <ICultureUtil>(); string expected = newCultureInfo.DateTimeFormat.ShortDatePattern; string result = cultureUtil.ShortDatePattern; Thread.CurrentThread.CurrentCulture = currentCultureInfo; Assert.AreEqual(expected, result); }
public void CheckDateSeparatorForUSCulture() { CultureInfo currentCultureInfo = Thread.CurrentThread.CurrentCulture; CultureInfo newCultureInfo = new CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = newCultureInfo; ICultureUtil cultureUtil = container.Resolve <ICultureUtil>(); string expected = newCultureInfo.DateTimeFormat.DateSeparator; string result = cultureUtil.DateSeparator; Thread.CurrentThread.CurrentCulture = currentCultureInfo; Assert.AreEqual(expected, result); }
public PatternsUtil(ICultureUtil cultureUtil) { _cultureUtil = cultureUtil; }