From 90f45b447aa9282d8dc0820544756b2afd82fe56 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Thu, 25 Feb 2010 03:11:48 +0000 Subject: [PATCH] Adding toString test. LANG-588 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916099 13f79535-47bb-0310-9956-ffa450edef68 --- src/test/java/org/apache/commons/lang3/PairTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/PairTest.java b/src/test/java/org/apache/commons/lang3/PairTest.java index 41e079742..ba1155950 100644 --- a/src/test/java/org/apache/commons/lang3/PairTest.java +++ b/src/test/java/org/apache/commons/lang3/PairTest.java @@ -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 {