From 755e21abc1efcd5448baa0ec5be6615817259ddf Mon Sep 17 00:00:00 2001 From: Daniel Stolt Date: Sat, 2 Aug 2014 18:44:47 +0200 Subject: [PATCH] Fixed three failing unit tests. --- .../Modules/Orchard.Tokens/Tests/DateTokenTests.cs | 1 + .../Orchard.Tokens/Tests/StubWorkContextAccessor.cs | 1 + src/Orchard/Localization/Services/IDateFormatter.cs | 12 ++++++------ .../Services/IDateLocalizationServices.txt | 1 - 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/DateTokenTests.cs b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/DateTokenTests.cs index 473a5c4c2..1a675df05 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/DateTokenTests.cs +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/DateTokenTests.cs @@ -23,6 +23,7 @@ namespace Orchard.Tokens.Tests { builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); + builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/StubWorkContextAccessor.cs b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/StubWorkContextAccessor.cs index 58415dd47..f2eb6fef3 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/StubWorkContextAccessor.cs +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/StubWorkContextAccessor.cs @@ -39,6 +39,7 @@ namespace Orchard.Tokens.Tests { _contextDictonary["CurrentTimeZone"] = TimeZoneInfo.Local; _contextDictonary["CurrentCulture"] = "en-US"; + _contextDictonary["CurrentCalendar"] = null; } public class StubSite : ContentPart, ISite { diff --git a/src/Orchard/Localization/Services/IDateFormatter.cs b/src/Orchard/Localization/Services/IDateFormatter.cs index fad591801..4a519fe23 100644 --- a/src/Orchard/Localization/Services/IDateFormatter.cs +++ b/src/Orchard/Localization/Services/IDateFormatter.cs @@ -18,7 +18,7 @@ namespace Orchard.Localization.Services { /// Parses a date/time string into a DateTimeParts instance using the specified format. /// /// The date/time string to parse. - /// A standard or custom DateTime format string with which to parse the string. + /// A custom DateTime format string with which to parse the string. /// DateTimeParts ParseDateTime(string dateTimeString, string format); @@ -33,7 +33,7 @@ namespace Orchard.Localization.Services { /// Parses a date string into a DateParts instance using the specified format. /// /// The date string to parse. - /// A standard or custom DateTime format string with which to parse the string. + /// A custom DateTime format string with which to parse the string. /// DateParts ParseDate(string dateString, string format); @@ -48,7 +48,7 @@ namespace Orchard.Localization.Services { /// Parses a time string into a TimeParts instance using the specified format. /// /// The date string to parse. - /// A standard or custom DateTime format string with which to parse the string. + /// A custom DateTime format string with which to parse the string. /// TimeParts ParseTime(string timeString, string format); @@ -63,7 +63,7 @@ namespace Orchard.Localization.Services { /// Formats a DateTimeParts instance into a string. /// /// The DateTimeParts instance to format. - /// A standard or custom DateTime format string with which to format the string. + /// A custom DateTime format string with which to format the string. /// string FormatDateTime(DateTimeParts parts, string format); @@ -78,7 +78,7 @@ namespace Orchard.Localization.Services { /// Formats a DateParts instance into a string. /// /// The DateParts instance to format. - /// A standard or custom DateTime format string with which to format the string. + /// A custom DateTime format string with which to format the string. /// string FormatDate(DateParts parts, string format); @@ -93,7 +93,7 @@ namespace Orchard.Localization.Services { /// Formats a TimeParts instance into a string. /// /// The TimeParts instance to format. - /// A standard or custom DateTime format string with which to format the string. + /// A custom DateTime format string with which to format the string. /// string FormatTime(TimeParts parts, string format); } diff --git a/src/Orchard/Localization/Services/IDateLocalizationServices.txt b/src/Orchard/Localization/Services/IDateLocalizationServices.txt index 1b7341488..05e93ae04 100644 --- a/src/Orchard/Localization/Services/IDateLocalizationServices.txt +++ b/src/Orchard/Localization/Services/IDateLocalizationServices.txt @@ -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