Fixing unit tests

This commit is contained in:
Sebastien Ros
2016-01-14 09:39:51 -08:00
parent a0c61c0328
commit 2d4c87d1d7
3 changed files with 12 additions and 4 deletions

View File

@@ -53,9 +53,8 @@ namespace Orchard.Tokens.Implementation {
var replacements = Evaluate(options.Predicate == null ? tokens : tokens.Where(options.Predicate), data);
return replacements.Aggregate(tokenset.Item1,
(current, replacement) => replacement.Value == null ?
current : current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}",
(options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value)));
(current, replacement) => current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}",
(options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value ?? "")));
}
private static Tuple<string, IEnumerable<string>> Parse(string text, bool hashMode) {