Fixed #1. Added support for hexEncode function

This commit is contained in:
Shekhar Gulati
2016-05-20 19:16:24 +05:30
parent 34ea17ffd0
commit 62e8fd7347
2 changed files with 32 additions and 14 deletions
+8
View File
@@ -350,4 +350,12 @@ public class StrmanTest {
assertThat(hexDecode("00c1"), equalTo("Á"));
assertThat(hexDecode("00410041"), equalTo("AA"));
}
@Test
public void hexEncode_shouldEncodeStringToHexadecimalFormat() throws Exception {
assertThat(hexEncode("漢"), equalTo("6f22"));
assertThat(hexEncode("A"), equalTo("0041"));
assertThat(hexEncode("Á"), equalTo("00c1"));
assertThat(hexEncode("AA"), equalTo("00410041"));
}
}