mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 20:19:42 +01:00
refactored test names. added requested whitespace
Signed-off-by: ardevd <edvard.holst@gmail.com>
This commit is contained in:
parent
d2aa3a7f50
commit
b6edab3d59
@ -9,7 +9,7 @@ import static org.junit.Assert.*;
|
|||||||
public class TextMatchersTest {
|
public class TextMatchersTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertRegularTextMessageParsing() {
|
public void getMessageTypeFromString_regularTextGiven_regularTextMessageTypeReturned() {
|
||||||
String simpleMessageText = "Hello world! Have a cookie!";
|
String simpleMessageText = "Hello world! Have a cookie!";
|
||||||
String messageContainingLink = "Hello https://nextcloud.com! Have a good day";
|
String messageContainingLink = "Hello https://nextcloud.com! Have a good day";
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleLinkMessageParsing() {
|
public void getMessageTypeFromString_singleUrlTextGiven_singleLinkMessageTypeReturned() {
|
||||||
String simpleUrlText = "https://nextcloud.com/";
|
String simpleUrlText = "https://nextcloud.com/";
|
||||||
String complexUrlText = "https://docs.nextcloud.com/server/15/admin_manual/#target-audience";
|
String complexUrlText = "https://docs.nextcloud.com/server/15/admin_manual/#target-audience";
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleLinkImageMessage() {
|
public void getMessageTypeFromString_imageLinkGiven_singleLinkImageMessageReturned() {
|
||||||
String simpleImageText = "https://nextcloud.com/image.jpg";
|
String simpleImageText = "https://nextcloud.com/image.jpg";
|
||||||
String complexImageUrlText = "https://nextcloud.com/wp-content/themes/next/assets/img/features/mobileDesktop.png?x22777";
|
String complexImageUrlText = "https://nextcloud.com/wp-content/themes/next/assets/img/features/mobileDesktop.png?x22777";
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleLinkGifMessage() {
|
public void getMessageTypeFromString_gifLinkGiven_gifMessageTypeReturned() {
|
||||||
String gifImageText = "https://nextcloud.com/funny.gif";
|
String gifImageText = "https://nextcloud.com/funny.gif";
|
||||||
|
|
||||||
assertEquals(ChatMessage.MessageType.SINGLE_LINK_GIF_MESSAGE,
|
assertEquals(ChatMessage.MessageType.SINGLE_LINK_GIF_MESSAGE,
|
||||||
@ -50,7 +50,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleLinkAudioMessage() {
|
public void getMessageTypeFromString_audioLinkGiven_audioMessageTypeReturned() {
|
||||||
String wavLink = "https://nextcloud.com/message.wav";
|
String wavLink = "https://nextcloud.com/message.wav";
|
||||||
String mp3Link = "https://nextcloud.com/message.mp3";
|
String mp3Link = "https://nextcloud.com/message.mp3";
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleLinkVideoMessage() {
|
public void getMessageTypeFromString_videoLinkGiven_videoMessageTypeReturned() {
|
||||||
String mp4Link = "https://nextcloud.com/message.mp4";
|
String mp4Link = "https://nextcloud.com/message.mp4";
|
||||||
String flvLink = "https://nextcloud.com/message.flv";
|
String flvLink = "https://nextcloud.com/message.flv";
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleGiphyMessage() {
|
public void getMessageTypeFromString_giphyLinkGiven_giphyMessageTypeReturned() {
|
||||||
String giphyLink = "https://media.giphy.com/media/11fucLQCTOdvBS/giphy.gif";
|
String giphyLink = "https://media.giphy.com/media/11fucLQCTOdvBS/giphy.gif";
|
||||||
|
|
||||||
assertEquals(ChatMessage.MessageType.SINGLE_LINK_GIPHY_MESSAGE,
|
assertEquals(ChatMessage.MessageType.SINGLE_LINK_GIPHY_MESSAGE,
|
||||||
@ -80,10 +80,10 @@ public class TextMatchersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMessageTypeFromString_assertSingleTenorMessage() {
|
public void getMessageTypeFromString_tenorLinkGiven_tenorMessageTypeReturned() {
|
||||||
String tenorLink = "https://media.tenor.com/images/d98e76e3930cf171cc39e301c9e974af/tenor.gif";
|
String tenorLink = "https://media.tenor.com/images/d98e76e3930cf171cc39e301c9e974af/tenor.gif";
|
||||||
|
|
||||||
assertEquals(ChatMessage.MessageType.SINGLE_LINK_TENOR_MESSAGE,
|
assertEquals(ChatMessage.MessageType.SINGLE_LINK_TENOR_MESSAGE,
|
||||||
TextMatchers.getMessageTypeFromString(tenorLink));
|
TextMatchers.getMessageTypeFromString(tenorLink));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user