Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit bba2b8d

Browse files
committed
add test to verify empty string is returned for last name when customer name has no space
1 parent 27f2158 commit bba2b8d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

example/src/test/java/org/wordpress/android/fluxc/model/customer/WCCustomerMapperTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,19 @@ class WCCustomerMapperTest {
348348
// then
349349
assertEquals("", result.lastName)
350350
}
351+
352+
@Test
353+
fun `given customer name has no space, then last name returns empty string`() {
354+
// given
355+
val siteId = 23
356+
val site = SiteModel().apply { id = siteId }
357+
358+
val customerDTO = CustomerFromAnalyticsDTO(name = "firstnamelastname")
359+
360+
// when
361+
val result = mapper.mapToModel(site, customerDTO)
362+
363+
// then
364+
assertEquals("", result.lastName)
365+
}
351366
}

0 commit comments

Comments
 (0)