Fixed three failing unit tests.

This commit is contained in:
Daniel Stolt
2014-08-02 18:44:47 +02:00
parent d892dee699
commit 755e21abc1
4 changed files with 8 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ namespace Orchard.Tokens.Tests {
builder.RegisterType<DateTokens>().As<ITokenProvider>();
builder.RegisterType<StubClock>().As<IClock>();
builder.RegisterType<CultureDateTimeFormatProvider>().As<IDateTimeFormatProvider>();
builder.RegisterType<DefaultDateFormatter>().As<IDateFormatter>();
builder.RegisterType<DefaultDateLocalizationServices>().As<IDateLocalizationServices>();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<SiteCalendarSelector>().As<ICalendarSelector>();

View File

@@ -39,6 +39,7 @@ namespace Orchard.Tokens.Tests {
_contextDictonary["CurrentTimeZone"] = TimeZoneInfo.Local;
_contextDictonary["CurrentCulture"] = "en-US";
_contextDictonary["CurrentCalendar"] = null;
}
public class StubSite : ContentPart, ISite {

View File

@@ -18,7 +18,7 @@ namespace Orchard.Localization.Services {
/// Parses a date/time string into a <c>DateTimeParts</c> instance using the specified format.
/// </summary>
/// <param name="dateTimeString">The date/time string to parse.</param>
/// <param name="format">A standard or custom DateTime format string with which to parse the string.</param>
/// <param name="format">A custom DateTime format string with which to parse the string.</param>
/// <returns></returns>
DateTimeParts ParseDateTime(string dateTimeString, string format);
@@ -33,7 +33,7 @@ namespace Orchard.Localization.Services {
/// Parses a date string into a <c>DateParts</c> instance using the specified format.
/// </summary>
/// <param name="dateString">The date string to parse.</param>
/// <param name="format">A standard or custom DateTime format string with which to parse the string.</param>
/// <param name="format">A custom DateTime format string with which to parse the string.</param>
/// <returns></returns>
DateParts ParseDate(string dateString, string format);
@@ -48,7 +48,7 @@ namespace Orchard.Localization.Services {
/// Parses a time string into a <c>TimeParts</c> instance using the specified format.
/// </summary>
/// <param name="timeString">The date string to parse.</param>
/// <param name="format">A standard or custom DateTime format string with which to parse the string.</param>
/// <param name="format">A custom DateTime format string with which to parse the string.</param>
/// <returns></returns>
TimeParts ParseTime(string timeString, string format);
@@ -63,7 +63,7 @@ namespace Orchard.Localization.Services {
/// Formats a <c>DateTimeParts</c> instance into a string.
/// </summary>
/// <param name="parts">The <c>DateTimeParts</c> instance to format.</param>
/// <param name="format">A standard or custom DateTime format string with which to format the string.</param>
/// <param name="format">A custom DateTime format string with which to format the string.</param>
/// <returns></returns>
string FormatDateTime(DateTimeParts parts, string format);
@@ -78,7 +78,7 @@ namespace Orchard.Localization.Services {
/// Formats a <c>DateParts</c> instance into a string.
/// </summary>
/// <param name="parts">The <c>DateParts</c> instance to format.</param>
/// <param name="format">A standard or custom DateTime format string with which to format the string.</param>
/// <param name="format">A custom DateTime format string with which to format the string.</param>
/// <returns></returns>
string FormatDate(DateParts parts, string format);
@@ -93,7 +93,7 @@ namespace Orchard.Localization.Services {
/// Formats a <c>TimeParts</c> instance into a string.
/// </summary>
/// <param name="parts">The <c>TimeParts</c> instance to format.</param>
/// <param name="format">A standard or custom DateTime format string with which to format the string.</param>
/// <param name="format">A custom DateTime format string with which to format the string.</param>
/// <returns></returns>
string FormatTime(TimeParts parts, string format);
}

View File

@@ -43,7 +43,6 @@ struct DateLocalizationOptions {
TODO:
* Test for proper handling of fraction (f) format specifier - suspect it does not work properly in current state
* Add formatting and parsing of time zone information (add timezone properties to TimeParts structure)
* Add support for both standard and custom format strings
* Write unit tests for DefaultDateLocalizationServices
* Add warning message when saving unsupported combination in settings
* Add support for the different Gregorian calendar types