Add (failing) tests to DisplayRecipientsExtractorTest

This commit is contained in:
Simon Arlott 2023-05-27 12:21:27 +01:00 committed by cketti
parent 9bcd64f54e
commit 424a37eaeb

View file

@ -48,6 +48,45 @@ class DisplayRecipientsExtractorTest {
)
}
@Test
fun `single recipient is identity address with different local part case`() {
val message = buildMessage {
header("To", "Test User <ME@domain.example>")
}
val displayRecipients = displayRecipientsExtractor.extractDisplayRecipients(message, account)
assertThat(displayRecipients).isEqualTo(
DisplayRecipients(recipientNames = listOf("me"), numberOfRecipients = 1),
)
}
@Test
fun `single recipient is identity address with different domain case`() {
val message = buildMessage {
header("To", "Test User <me@DOMAIN.EXAMPLE>")
}
val displayRecipients = displayRecipientsExtractor.extractDisplayRecipients(message, account)
assertThat(displayRecipients).isEqualTo(
DisplayRecipients(recipientNames = listOf("me"), numberOfRecipients = 1),
)
}
@Test
fun `single recipient is identity address with different local part and domain case`() {
val message = buildMessage {
header("To", "Test User <ME@DOMAIN.EXAMPLE>")
}
val displayRecipients = displayRecipientsExtractor.extractDisplayRecipients(message, account)
assertThat(displayRecipients).isEqualTo(
DisplayRecipients(recipientNames = listOf("me"), numberOfRecipients = 1),
)
}
@Test
fun `single recipient is a contact`() {
val message = buildMessage {