blob: ca4a17186c7cc4a388089bed966411e6b2325f6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package cgeo.geocaching;
import cgeo.geocaching.test.R;
import android.test.InstrumentationTestCase;
import java.io.InputStream;
import java.util.Scanner;
public class ParserTest extends InstrumentationTestCase {
private String getFileContent(int resourceId) {
InputStream ins = getInstrumentation().getContext().getResources().openRawResource(resourceId);
return new Scanner(ins).useDelimiter("\\A").next();
}
public void testOwnerDecoding() {
cgCacheWrap caches = cgBase.parseCacheFromText(getFileContent(R.raw.gc1zxez), 0, null);
assertEquals(1, caches.cacheList.size());
final cgCache cache = caches.cacheList.get(0);
assertEquals("Ms.Marple/Mr.Stringer", cache.getOwnerReal());
}
}
|