[StringExtensions] - Display correct variable name when throwing. (#1564)

This commit is contained in:
Ivandro Ismael
2017-04-02 13:51:03 +01:00
committed by Ryan Gribble
parent 8a1aa4a2ee
commit 21a2c57e48
+3 -3
View File
@@ -80,19 +80,19 @@ namespace Octokit
Justification = "Ruby don't care. Ruby don't play that.")]
public static string ToRubyCase(this string propertyName)
{
Ensure.ArgumentNotNullOrEmptyString(propertyName, "s");
Ensure.ArgumentNotNullOrEmptyString(propertyName, "propertyName");
return string.Join("_", propertyName.SplitUpperCase()).ToLowerInvariant();
}
public static string FromRubyCase(this string propertyName)
{
Ensure.ArgumentNotNullOrEmptyString(propertyName, "s");
Ensure.ArgumentNotNullOrEmptyString(propertyName, "propertyName");
return string.Join("", propertyName.Split('_')).ToCapitalizedInvariant();
}
public static string ToCapitalizedInvariant(this string value)
{
Ensure.ArgumentNotNullOrEmptyString(value, "s");
Ensure.ArgumentNotNullOrEmptyString(value, "value");
return string.Concat(value[0].ToString().ToUpperInvariant(), value.Substring(1));
}
static IEnumerable<string> SplitUpperCase(this string source)