From dd1ec5f47b2e2ccb5caaa575393db7494e3f0c01 Mon Sep 17 00:00:00 2001 From: Art O Cathain Date: Sat, 11 Oct 2014 11:54:26 +0100 Subject: [PATCH] add unit test --- .../src/com/fsck/k9/helper/UtilityTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java diff --git a/tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java b/tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java new file mode 100644 index 000000000..0f0e7baa3 --- /dev/null +++ b/tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java @@ -0,0 +1,28 @@ +package com.fsck.k9.mail.internet; + +import com.fsck.k9.helper.Utility; + +import junit.framework.TestCase; + +import java.io.Serializable; +import java.util.LinkedList; + +public class UtilityTest extends TestCase { + + public void testToSerializableList() { + LinkedList input = new LinkedList(Arrays.asList("a", "b")); + + Serializable serializableList = Utility.toSerializableList(input); + + assertEquals(serializableList, input); + } + + public void testToSerializableListAlreadySerializable() { + ArrayList input = new ArrayList(Arrays.asList("a", "b")); + + Serializable serializableList = Utility.toSerializableList(input); + + assertSame(serializableList, input); + } + +}