Skip to content

Commit 09df856

Browse files
committed
Create test for German Alphabet
1 parent bdb0cda commit 09df856

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/UnidecoderTest.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ public void CharUnidecodeTest()
6767
Assert.Equal(expected, result);
6868
}
6969

70+
/// <summary>
71+
/// According to https://en.wikipedia.org/wiki/German_orthography.
72+
/// https://en.wikipedia.org/wiki/German_orthography
73+
/// With converting "Ä, Ö, Ü, ẞ, ä, ö, ü, ß" to "Ae, Oe, Ue, Ss, ae, oe, ue, ss".
74+
/// </summary>
75+
[Fact]
76+
public void GermanAlphabetTest()
77+
{
78+
string input = "a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ä ö ü ß Ä Ö Ü ẞ";
79+
string expected = "a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ae oe ue ss Ae Oe Ue Ss";
80+
81+
var sb = new StringBuilder(expected.Length);
82+
foreach (char c in input)
83+
{
84+
sb.Append(c.Unidecode());
85+
}
86+
string result = sb.ToString();
87+
88+
Assert.Equal(expected, result);
89+
}
90+
7091
[Fact]
7192
public void UnidecodeOnNullShouldReturnEmptyString()
7293
{

0 commit comments

Comments
 (0)