From ebb8dac869e8af84a25fed7b8b353cd9fb345b6c Mon Sep 17 00:00:00 2001 From: brz Date: Fri, 1 Aug 2014 04:24:16 +0430 Subject: [PATCH 1/2] fixed dehumanize actually humanizing strings that are already dehumanized --- release_notes.md | 2 ++ src/Humanizer.Tests/StringDehumanizeTests.cs | 1 + src/Humanizer/StringDehumanizeExtensions.cs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index 0e20cf130..5d1aae00b 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,4 +1,6 @@ ###In Development + - [#320](https://github.com/MehdiK/Humanizer/pull/320): Fixed Dehumanize actually humanizing an alreaddy dehumanized string + [Commits](https://github.com/MehdiK/Humanizer/compare/v1.28.0...master) ###v1.28.0 - 2014-07-06 diff --git a/src/Humanizer.Tests/StringDehumanizeTests.cs b/src/Humanizer.Tests/StringDehumanizeTests.cs index caaed20bd..9e5574d8b 100644 --- a/src/Humanizer.Tests/StringDehumanizeTests.cs +++ b/src/Humanizer.Tests/StringDehumanizeTests.cs @@ -10,6 +10,7 @@ public class StringDehumanizeTests [InlineData("Title Case Sentence Is Camelized", "TitleCaseSentenceIsCamelized")] [InlineData("Mixed case sentence Is Camelized", "MixedCaseSentenceIsCamelized")] [InlineData("lower case sentence is camelized", "LowerCaseSentenceIsCamelized")] + [InlineData("AlreadyDehumanizedStringIsUntouched", "AlreadyDehumanizedStringIsUntouched")] [InlineData("", "")] public void CanDehumanizeIntoAPascalCaseWord(string input, string expectedResult) { diff --git a/src/Humanizer/StringDehumanizeExtensions.cs b/src/Humanizer/StringDehumanizeExtensions.cs index 64c485d6d..53998dd4a 100644 --- a/src/Humanizer/StringDehumanizeExtensions.cs +++ b/src/Humanizer/StringDehumanizeExtensions.cs @@ -18,7 +18,7 @@ public static string Dehumanize(this string input) (from word in input.Split(' ') select word.Humanize(LetterCasing.Title)); - return string.Join("", titlizedWords); + return string.Join("", titlizedWords).Replace(" ", ""); } } } From 8c7eccd8c4da8301dda50de510c171f95addd55d Mon Sep 17 00:00:00 2001 From: brz Date: Fri, 1 Aug 2014 05:18:49 +0430 Subject: [PATCH 2/2] typo --- release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index 5d1aae00b..213191fb1 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,5 @@ ###In Development - - [#320](https://github.com/MehdiK/Humanizer/pull/320): Fixed Dehumanize actually humanizing an alreaddy dehumanized string + - [#320](https://github.com/MehdiK/Humanizer/pull/320): Fixed Dehumanize actually humanizing an already dehumanized string [Commits](https://github.com/MehdiK/Humanizer/compare/v1.28.0...master)