mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
add unit test
This commit is contained in:
parent
668ee71b6c
commit
dd1ec5f47b
28
tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java
Normal file
28
tests-on-jvm/src/com/fsck/k9/helper/UtilityTest.java
Normal file
@ -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<String> input = new LinkedList<String>(Arrays.asList("a", "b"));
|
||||||
|
|
||||||
|
Serializable serializableList = Utility.toSerializableList(input);
|
||||||
|
|
||||||
|
assertEquals(serializableList, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testToSerializableListAlreadySerializable() {
|
||||||
|
ArrayList<String> input = new ArrayList<String>(Arrays.asList("a", "b"));
|
||||||
|
|
||||||
|
Serializable serializableList = Utility.toSerializableList(input);
|
||||||
|
|
||||||
|
assertSame(serializableList, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user