diff options
author | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-08-02 01:08:46 +0200 |
---|---|---|
committer | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-08-02 01:08:46 +0200 |
commit | c4921dc214ac5647f3f123697239cdf871b69572 (patch) | |
tree | 24a9f00156e4306046aa9f158105d8e2d78b01d8 | |
parent | d53c7612abd840c71e7612d55d04d4bfcad4086d (diff) | |
download | jitsi-c4921dc214ac5647f3f123697239cdf871b69572.zip jitsi-c4921dc214ac5647f3f123697239cdf871b69572.tar.gz jitsi-c4921dc214ac5647f3f123697239cdf871b69572.tar.bz2 |
Implemented tests for MessageIrcImpl.
-rw-r--r-- | test/net/java/sip/communicator/impl/protocol/irc/MessageIrcImplTest.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/net/java/sip/communicator/impl/protocol/irc/MessageIrcImplTest.java b/test/net/java/sip/communicator/impl/protocol/irc/MessageIrcImplTest.java new file mode 100644 index 0000000..44e9987 --- /dev/null +++ b/test/net/java/sip/communicator/impl/protocol/irc/MessageIrcImplTest.java @@ -0,0 +1,49 @@ +package net.java.sip.communicator.impl.protocol.irc; + +import junit.framework.*; + +public class MessageIrcImplTest + extends TestCase +{ + + public void testConstruction() + { + new MessageIrcImpl("Message", MessageIrcImpl.DEFAULT_MIME_TYPE, + MessageIrcImpl.DEFAULT_MIME_ENCODING, null); + } + + public void testCorrectConstruction() + { + MessageIrcImpl message = + new MessageIrcImpl("Message", MessageIrcImpl.DEFAULT_MIME_TYPE, + MessageIrcImpl.DEFAULT_MIME_ENCODING, null); + Assert.assertEquals("Message", message.getContent()); + Assert.assertEquals(MessageIrcImpl.DEFAULT_MIME_TYPE, + message.getContentType()); + Assert.assertEquals(MessageIrcImpl.DEFAULT_MIME_ENCODING, + message.getEncoding()); + Assert.assertNull(message.getSubject()); + Assert.assertFalse(message.isAction()); + Assert.assertFalse(message.isCommand()); + } + + public void testActionRecognized() + { + MessageIrcImpl message = + new MessageIrcImpl("/me is a genius!", + MessageIrcImpl.DEFAULT_MIME_TYPE, + MessageIrcImpl.DEFAULT_MIME_ENCODING, null); + Assert.assertTrue(message.isAction()); + Assert.assertTrue(message.isCommand()); + } + + public void testCommandNonActionRecognized() + { + MessageIrcImpl message = + new MessageIrcImpl("/msg user Hi!", + MessageIrcImpl.DEFAULT_MIME_TYPE, + MessageIrcImpl.DEFAULT_MIME_ENCODING, null); + Assert.assertFalse(message.isAction()); + Assert.assertTrue(message.isCommand()); + } +} |