2013-02-07 13:30:50 -01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Umbraco.Core.Strings;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Tests.CoreStrings
|
|
|
|
|
|
{
|
|
|
|
|
|
class MockShortStringHelper : IShortStringHelper
|
|
|
|
|
|
{
|
|
|
|
|
|
public void Freeze()
|
|
|
|
|
|
{
|
|
|
|
|
|
IsFrozen = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsFrozen { get; private set; }
|
|
|
|
|
|
|
2013-02-19 06:30:19 -01:00
|
|
|
|
public string GetShortStringServicesJavaScript(string controllerPath) { return "SSSJS"; }
|
2013-02-19 06:26:58 -01:00
|
|
|
|
|
2013-02-07 13:30:50 -01:00
|
|
|
|
public string CleanStringForSafeAlias(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-ALIAS::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-11-04 15:00:13 +01:00
|
|
|
|
public string CleanStringForSafeCamelAlias(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-ALIAS::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-02-07 13:30:50 -01:00
|
|
|
|
public string CleanStringForSafeAlias(string text, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-ALIAS-CULTURE::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-11-04 15:00:13 +01:00
|
|
|
|
public string CleanStringForSafeCamelAlias(string text, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-ALIAS-CULTURE::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-02-07 13:30:50 -01:00
|
|
|
|
public string CleanStringForUrlSegment(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "URL-SEGMENT::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanStringForUrlSegment(string text, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "URL-SEGMENT-CULTURE::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-03-11 14:58:07 -01:00
|
|
|
|
public string CleanStringForSafeFileName(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-FILE-NAME::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanStringForSafeFileName(string text, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SAFE-FILE-NAME-CULTURE::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-02-07 13:30:50 -01:00
|
|
|
|
public string SplitPascalCasing(string text, char separator)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SPLIT-PASCAL-CASING::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ReplaceMany(string text, IDictionary<string, string> replacements)
|
|
|
|
|
|
{
|
2013-03-11 14:58:07 -01:00
|
|
|
|
return "REPLACE-MANY-A::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ReplaceMany(string text, char[] chars, char replacement)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "REPLACE-MANY-B::" + text;
|
2013-02-07 13:30:50 -01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanString(string text, CleanStringType stringType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "CLEAN-STRING-A::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanString(string text, CleanStringType stringType, char separator)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "CLEAN-STRING-B::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanString(string text, CleanStringType stringType, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "CLEAN-STRING-C::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string CleanString(string text, CleanStringType stringType, char separator, System.Globalization.CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "CLEAN-STRING-D::" + text;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|