Adding toString test. LANG-588

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916099 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2010-02-25 03:11:48 +00:00
parent 88d44051a1
commit 90f45b447a
1 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,14 @@ public class PairTest {
assertEquals(Pair.of(null, "foo").hashCode(), Pair.of(null, "foo").hashCode());
}
@Test
public void testToString() throws Exception {
assertEquals("(null,null)", Pair.of(null, null).toString());
assertEquals("(null,two)", Pair.of(null, "two").toString());
assertEquals("(one,null)", Pair.of("one", null).toString());
assertEquals("(one,two)", Pair.of("one", "two").toString());
}
@Test
@SuppressWarnings("unchecked")
public void testSerialization() throws Exception {