Add toString() method to default connection
[xudocci.git] / src / test / java / net / pterodactylus / irc / DefaultConnectionTest.java
1 package net.pterodactylus.irc;
2
3 import static org.hamcrest.MatcherAssert.assertThat;
4 import static org.hamcrest.Matchers.containsString;
5
6 import org.junit.Test;
7
8 /**
9  * Unit test for {@link DefaultConnection}.
10  *
11  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
12  */
13 public class DefaultConnectionTest {
14
15         private static final String HOSTNAME = "some.host.name";
16         private static final int PORT = 12345;
17
18         @Test
19         public void toStringContainsHostnameAndPort() {
20                 DefaultConnection defaultConnection = new DefaultConnection(null, null, HOSTNAME, PORT);
21                 assertThat(defaultConnection.toString(), containsString(HOSTNAME));
22                 assertThat(defaultConnection.toString(), containsString(String.valueOf(PORT)));
23         }
24
25 }