mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
remove method (#6028)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
2c8c441f25
commit
c1acdbe31a
2 changed files with 3 additions and 75 deletions
|
|
@ -269,50 +269,10 @@ class UploadMediaDetailAdapterUnitTest {
|
|||
verify(adapterView, times(3)).adapter
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testRemoveLeadingAndTrailingWhitespace() {
|
||||
// empty space
|
||||
val test1 = " test "
|
||||
val expected1 = "test"
|
||||
Assert.assertEquals(expected1, viewHolder.removeLeadingAndTrailingWhitespace(test1))
|
||||
|
||||
val test2 = " test test "
|
||||
val expected2 = "test test"
|
||||
Assert.assertEquals(expected2, viewHolder.removeLeadingAndTrailingWhitespace(test2))
|
||||
|
||||
// No whitespace
|
||||
val test3 = "No trailing space"
|
||||
val expected3 = "No trailing space"
|
||||
Assert.assertEquals(expected3, viewHolder.removeLeadingAndTrailingWhitespace(test3))
|
||||
|
||||
// blank string
|
||||
val test4 = " \r \t "
|
||||
val expected4 = ""
|
||||
Assert.assertEquals(expected4, viewHolder.removeLeadingAndTrailingWhitespace(test4))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testRemoveLeadingAndTrailingInstanceTab() {
|
||||
val test = "\ttest\t"
|
||||
val expected = "test"
|
||||
Assert.assertEquals(expected, viewHolder.removeLeadingAndTrailingWhitespace(test))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testRemoveLeadingAndTrailingCarriageReturn() {
|
||||
val test = "\rtest\r"
|
||||
val expected = "test"
|
||||
Assert.assertEquals(expected, viewHolder.removeLeadingAndTrailingWhitespace(test))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCaptionJapaneseCharacters() {
|
||||
val test1 = "テスト テスト"
|
||||
val expected1 = "テスト テスト"
|
||||
Assert.assertEquals(expected1, viewHolder.convertIdeographicSpaceToLatinSpace(test1))
|
||||
|
||||
val test2 = " \r \t テスト \r \t "
|
||||
val expected2 = "テスト"
|
||||
Assert.assertEquals(expected2, viewHolder.removeLeadingAndTrailingWhitespace(test2))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue